Create or update events in Apptoto. Apptoto's auto messages will be sent for the events created if Auto Messages are turned on. Otherwise, be sure to include #auto in the event information in order to tell Apptoto to send the Auto Messages configured for the account.
To update existing events, be sure to provide either an external_id or id, otherwise a new event will be created. For the event properties, this API acts like a patch... meaning that only the events fields you specify will be updated.
However, if you provide a value for the "participants" or "custom_data" field, then provide all of the data. Meaning, it does not act as a patch for custom_data or individual participants.
Please note that participants will not be removed from an event if messages have already started going out to that participant. This "feature" can be turned off, so ask [email protected] if you need it turned off.
Also, please note that we do not support moving an appointment from one calendar to another at this time. If you need this, please contact [email protected] .
The body of the PUT request should look like the following:
{
"events": [
EVENTS TO CREATE OR UPDATE
]
}
Each Event object should have the following properties
Field | Type | Description |
---|---|---|
calendar | String (Required unless calendar_id specified) | The name of the calendar to add the event to. If the calendar doesn't exist then a new one will be provisioned. |
calendar_id | Integer (Required unless calendar specified) | The id of the calendar |
title | String (Required if new event) | The title of the event |
start_time | String (Required if new event) | The start time of the event in ISO 8601 combined date and time format including timezone offset. e.g. 2016-06-21T14:00:00-08:00 |
end_time | String (Required if new event) | The end time of the event in ISO 8601 combined date and time format including timezone offset. e.g. 2016-06-21T14:00:00-08:00 |
time_zone | String | The time zone the event is in. This will influence what time will be used in messages sent as long as the "Use time zone specified for event" option is enabled for the account (which it is by default). See this page for timezones supported. |
location | String | The location of the event |
content | String | The content / body of the vent |
all_day | Boolean Default: false | Specifies that event should be treated as an all day event |
show_as | Integer Default: null | null: "Busy" 0: "Free" 1: "Tentative" 2: "Busy" 3: "Out of Office" 4: "Working Elsewhere" |
external_id | String | An optional unique identifier (should be unique across all calendars in user's account). Can be used to fetch updates and update events. |
id | integer | The event's Apptoto id if you are doing updates. Either the external_id or id field needs to exist for an update to take place. |
custom_data | JSON Hash | A hash of custom data to be attached to the event. Custom data can be used in Apptoto conditions and message templates. |
participants | Array | Array of participants to be added. This is optional. Apptoto can extract participants from the title/location/content for you. But if you want to explicitly include participants you can include them in this Array. |
Each Participant object should include the following properties
Field | Type | Description |
---|---|---|
name | String | The name of the participant |
String | The SMTP email address of the participant | |
phone | String | The phone of the participant. This phone number will be normalized based on the user's country setting. Alternatively you can include the full normalized phone number (e.g. +441212121212) and Apptoto will then skip normalization. |
contact_id | Integer | The id of a contact in Apptoto to directly link the event to. You should not include name/email/phone if you provide an explicit contact_id. |
contact_external_id | String | The external_id of a contact you've created in Apptoto. The external_id can be specified when you create it in Apptoto through the API, or for some types of Address Books (like Salesforce, you can use the Salesforce contact id as the external_id) |
Example Result:
{
events: [ EVENTS CREATED OR UPDATED ]
}