/v1/events

Fetch a range of "events".

Please note that you can also use this API to fetch one event by id or external_id (for legacy reasons). The new proper way to fetch one event is to use the /v1/event (singular) API.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

If you do not specify a phone_number, email_address or participant_id... then events will not be duplicated, an each event will contain all of it's participants.

However, if you specify a phone_number, email_address or participant_id... then events may be listed more than once, and each event entry returned will only have the matching participant in the participants array included.

Searching

Pass a q query parameter to restrict the results to events that match a query expressed in Apptoto's appointment search language. Examples:

  • q=fred -- bare term, matches the event's title, location or content, or a participant's name, email or phone
  • q=fred smith -- multiple bare terms are ANDed; both must match
  • q="fred smith" -- quoted, matches the phrase exactly
  • q="Fred Smith" or "Jane Doe" or "Sam Brown" -- one request covering a list of people, instead of one request per person
  • q=name:fred -- match against the participant name only
  • q=event.title:haircut -- match against the event title only
  • q=event.title="Haircut with Fred" -- exact title match
  • q=(fred or smith) -cancelled -- boolean combination with a negated term
  • q=event.custom.service_type:haircut -- match a custom event field

begin / end, calendar_id and pagination (page, page_size) are applied on top of q.

If part of the query cannot be resolved -- most often an unrecognized field name -- the response includes a warnings array explaining why, and those clauses match nothing. A query that cannot be parsed at all (for example an unbalanced quote) returns a 400.

See the Appointment Search Syntax article for the full operator and field reference.

Result

Pass include_total=true to add a total to the response: the number of events matching the request across all pages, not the number in events. Use it to decide whether to request another page. It is off by default because computing it costs an extra count over the whole matched range -- on a wide date range or a large page_size that is not free.

Example Result (with include_total=true):

{
  total: 1,
  events: [ {
    id: 123,
    calendar_id: 456,
    start_time: "2016-04-15T12:00:00-07:00",
    end_time: "2016-04-15T13:00:00-07:00",
    title: "Appointment with Fred",
    location: "",
    content: "",
    is_deleted: false,
    participants: [ {
      id: 789,
      name: "Fred Smith",
      phone: "650-555-1212",
      normalized_phone: "+16505551212",
      email: "[email protected]",
      state: "initial", 
    }],
    custom_data: {
      field_1: "custom value"
    }
  }]
}

OAuth scope

Calls authenticated with an OAuth 2.0 bearer token must include the events:read scope. A token without it receives a 403 insufficient_scope response. HTTP Basic auth is not scope-gated.

Query Params
date

Only events starting at or after this date/time will be included. (ISO8601)

date

Only events starting at or before this Date/Time will be included. (ISO8601)

string

(OPTIONAL) Search-language query string. Restricts results to events that match the query. A bare term (no operator) searches the event's title, location and content plus each participant's name, email and phone. Supports field-specific terms (e.g. name:fred, event.title="Haircut with Fred", event.location:portland), custom event fields (e.g. event.custom.service_type:haircut), boolean operators (and, or, parens, ! / - for negation), comparison operators (>, >=, <, <=, =, !=), wildcards (*) and the empty keyword. Multiple bare terms are ANDed; quote a phrase to match it exactly. See https://www.apptoto.com/apptoto-manual/article/appointments-tab/appointment-search-syntax/ for the full syntax reference.

int32

(OPTIONAL) Restrict results to events on this calendar.

string

Only events who have a participant with the given phone number will be included. The phone number will be normalized based on the Apptoto user's default country setting. If the phone number you are filtering on is in a different country then include the fully normalized phone number (e.g. +66234234234).

string

Only events who have a participant with the specified email address will be incluced

int32

(OPTIONAL) Only events that include this participant will be returned. As with phone_number and email_address, each returned event lists only the matching participant.

int32
Defaults to 30

The number of events to return

int32
Defaults to 1

The page to fetch (1 based)

boolean
Defaults to false

(OPTIONAL) When true, the response includes total: the number of events matching the request across all pages. Off by default -- computing it costs an extra count over the whole matched range, so only ask for it when you need it.

boolean
Defaults to false

Include deleted events

boolean
Defaults to false

If true, then Apptoto will include any conversations sent about the event. The conversations will be an array on each participant with the key "conversations".

Language
Credentials
:
LoadingLoading…
Response
Click Try It! to start a request and see the response here!