Search

saveEvent

Create or update an event/appointment.

In Erply backend, events (appointments) are listed in the Calendar ยป Tasks module.

To retrieve events, use getEvents.

Function may return error 1043 if creating appointment and employee already has an appointment in the selected time slot. (In that case you need to requery getTimeSlots and select a different start and end time for new appointment.)

Input parameters

Parameter nameDescriptionPossible valueRequired
idID of existing event. If this parameter is present, then an existing event is updated.Integer
descriptionName or explanation of the event.String
typeIDEvent type ID. For a list of types, see getEventTypes. If you have salon/spa module enabled, and want to create appointments or stylist schedule items, skip this parameter and use type = APPOINTMENT or type = SCHEDULE instead.Integer yes
typeEvent type. Use this field only if you have salon/spa module enabled (otherwise returns error 1006) and if you want to create a salon appointment or stylist schedule item. Possible values: APPOINTMENT, SCHEDULE, BREAK, LUNCH, VACATION, SICKDAY.String
startTimeStart date and time of the event, eg. 2010-05-18 15:40:00 (must be specified in the account's default timezone)Datetime (yyyy-mm-dd hh:mm:ss) yes
endTimeEnd date and time of the event, eg. 2010-05-18 16:00:00 (must be specified in the account's default timezone)Datetime (yyyy-mm-dd hh:mm:ss)
customerIDID of the customer related to this event (eg. a phone call or a meeting with particular customer)Integer
contactIDID of the customer's contact personInteger
projectIDID of the project associated with this event. Use getProjects.Integer
employeeIDEmployee whom this task was assigned to. Use getEmployees.Integer
submitterIDEmployee who entered or assigned this task. Use getEmployees.Integer
supplierIDSupplier ID. Use getSuppliers.Integer
statusIDEvent status. For a list of statuses, see getEventStatuses.
If you are using salon/spa module and want to set appointment status to one of the 6 predefined statuses, do not use this parameter - use the "status" field instead.
Integer
statusEvent status ID. Use this field only if you have salon/spa module enabled (otherwise returns error 1006) and if you want to create or update an appointment. Possible values: SCHEDULED, CHECKEDIN, NOSHOW, BEINGSERVICED, CHECKEDOUT, NONE.String
resourceIDResource associated with this event (a projector, a meeting room etc.).Integer
productIDID of the product. If Salon / SPA module is not enabled, function returns error 1006.Integer
warehouseIDID of the salon. If Salon / SPA module is not enabled, function returns error 1006.Integer
checkInTimeIf Salon / SPA module is not enabled, function returns error 1006.Unix timestamp
checkOutTimeIf Salon / SPA module is not enabled, function returns error 1006.Unix timestamp
serviceStartTimeIf Salon / SPA module is not enabled, function returns error 1006.Unix timestamp
completed1 if event is completed, otherwise 00 or 1, by default 0
notesLonger description, associated e-mail message or anything else.Text
notOverlapping(Only applies if you are using Salon module, and only for events of type "APPOINTMENT".)

If set to 1, and if you are creating a new appointment, and it overlaps with an existing appointment (or a lunch, break, vacation or sick day) for the same stylist (employee), API returns error 1043.
0 or 1, by default 0
*************Additional attributes associated with this item.
Attributes must be supplied as a flat list, each attribute defined by the following set of three parameters. Replace # with set number (1, 2, 3, ...). When updating an existing entry, API will only update the attributes specified in input data and leave all other existing attributes unchanged. To delete an attribute, set its value to 'null' or 'undefined'.
attributeName#Attribute name. Name can only contain the following symbols: A-Z, a-z, 0-9, dash and underscore.String
attributeType#Attribute type, possible types are 'text', 'int' and 'double'. By default 'text'.String
attributeValue#Value of the attribute. Set value to 'null' or 'undefined' to delete an attribute.
'text' attribute can be any string, maximum 255 characters.
'int' must be a signed 32-bit integer.
'double' must be a decimal number.
String

Response

Field nameTypeDescription
eventIDIntegerID of the newly-created or updated item