EventsAPI

new EventsAPI(rest)

This class is used to interact with Events in TidyHQ.
Parameters:
NameTypeDescription
restRestThe rest instance to use for requests.

Methods

(async) createEvent(event, optionsopt) → {Promise.<TidyAPI_V1_Event>}

Create a new event.
Parameters:
NameTypeAttributesDefaultDescription
eventTidy_V1_EventParamsThe event to create. Requires a name and start_at.
optionsObject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- The event.
Type: 
Promise.<TidyAPI_V1_Event>

(async) deleteEvent(event_id, optionsopt) → {Promise.<TidyAPI_Response>}

Delete an event.
Parameters:
NameTypeAttributesDefaultDescription
event_idnumberThe ID of the event.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- Success or failure.
Type: 
Promise.<TidyAPI_Response>

(async) getEvent(event_id, optionsopt) → {Promise.<TidyAPI_V1_Event>}

Get a single event.
Parameters:
NameTypeAttributesDefaultDescription
event_idnumberThe ID of the event.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- The event.
Type: 
Promise.<TidyAPI_V1_Event>

(async) getEvents(optionsopt) → {Promise.<TidyAPI_V1_Events>}

Get a list of events.
Parameters:
NameTypeAttributesDefaultDescription
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
limitnumber<optional>
The maximum number of contacts to return.
offsetnumber<optional>
The number of contacts to skip.
start_atstring<optional>
The start date of the events to return in ISO 8601 format.
end_atstring<optional>
The end date of the events to return in ISO 8601 format.
publicboolean<optional>
Whether to return only public events or not.
Returns:
- The list of events.
Type: 
Promise.<TidyAPI_V1_Events>

(async) updateEvent(event_id, event, optionsopt) → {Promise.<TidyAPI_V1_Event>}

Update an event.
Parameters:
NameTypeAttributesDefaultDescription
event_idnumberThe ID of the event.
eventTidy_V1_EventParamsThe event to update. Requires at least one parameter.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- The event.
Type: 
Promise.<TidyAPI_V1_Event>