Function: event.AddAttachment

Adds an attachment to an Event. Only works for accepted Events.

Syntax

{
	"method": "event.AddAttachment",
	"params": {
		"id": "...",
		"type": "...",
		"mimeType": "...",
		"name": "...",
		"time": "...",
		"data": "...",
		"inReport": "...",
	},
	"id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
}
AdvFuture<int> AddAttachment( AdvGuid id
	 AdvString type,
	 AdvString mimeType,
	 AdvString name,
	 AdvTime time,
	 std::vector<uint8_t> data,
	 std::optional<bool> inReport = std::nullopt );
public Task<long> AddAttachmentAsync(Guid id,
		EnumAttachmentType type,
		string mimeType,
		string name,
		DateTime time,
		byte[] data,
		bool? inReport = null,
		CancellationToken ct = default);
addAttachment(id: string, type: EnumAttachmentType, mimeType: string, name: string, time: Date, data: string, inReport?: boolean | undefined): Promise<number>;

Parameters

id : guid

Id of the Event to add the attachment to.

type : string (EnumAttachmentType)

Type of the attachment.

mimeType : string

The attachment’s mime type.

name : string

Display name to use for the attachment.

time : time

Associates a creation date.

data : data

Binary data of the attachment.

inReport : bool optional ≥wg 0.4.17

States if the attachment should be part of a report.

Result : int

Id of the newly added attachment. This Id is only valid in the context of the Event the attachment was created for.

Errors

Data.NotFound ≥wg 0.4.9

The requested data was not found or the caller does not have the required permission to access it. For additional information, see Data.NotFound.

Data.Forbidden ≥wg 0.4.9

The caller does not have the required permissions to access the data. For additional information, see Data.Forbidden.

Data.Validation ≥wg 0.4.9

One or more Properties within the submitted Data Object were invalid. For additional information, see Data.Validation.

Event.AddAttachment.SettingsPreventAdding ≥wg 0.4.9

Adding attachments is disabled in the settings.

Event.AddAttachment.NoAttachmentLicense ≥wg 0.4.9

The product is not licensed for attachment handling.

Event.AddAttachment.EventIsCompleted ≥wg 0.4.9

Attachments cannot be added to events that are already completed.

Event.AddAttachment.StationHasNoControl ≥wg 0.4.9

Attachments can only be added if the station is allowed to modify the event.

Event.AddAttachment.NotAccepted ≥wg 0.4.9

Attachments can only be added if the event was accepted or this prerequisite is disabled in the settings.

Event.AddAttachment.IOError ≥wg 0.4.9

Internal I/O error.

Remarks

This method requires API write access.