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 name Description Possible value Required
id  ID of existing event. If this parameter is present, then an existing event is updated.  Integer    
description  Name or explanation of the event.  String    
typeID  Event 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  
type  Event 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    
startTime  Start 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  
endTime  End 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)   
customerID  ID of the customer related to this event (eg. a phone call or a meeting with particular customer)  Integer    
contactID  ID of the customer's contact person  Integer    
projectID  ID of the project associated with this event. Use getProjects Integer    
employeeID  Employee whom this task was assigned to. Use getEmployees Integer    
submitterID  Employee who entered or assigned this task. Use getEmployees Integer    
supplierID  Supplier ID. Use getSuppliers Integer    
statusID  Event 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    
status  Event 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    
resourceID  Resource associated with this event (a projector, a meeting room etc.).  Integer    
productID  ID of the product. If Salon / SPA module is not enabled, function returns error 1006.  Integer    
warehouseID  ID of the salon. If Salon / SPA module is not enabled, function returns error 1006.  Integer    
checkInTime  If Salon / SPA module is not enabled, function returns error 1006.  Unix timestamp    
checkOutTime  If Salon / SPA module is not enabled, function returns error 1006.  Unix timestamp    
serviceStartTime  If Salon / SPA module is not enabled, function returns error 1006.  Unix timestamp    
completed  1 if event is completed, otherwise 0  0 or 1, by default 0    
notes  Longer 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 name Type Description
eventID  Integer  ID of the newly-created or updated item