Conventions

Retrieving objects

Application clients can retrieve lists of resources of a single type through a simple URL.

For example, to retrieve a list of workspaces from within the company, the URL is:

GET https://api.<region>.whispir.com/workspaces?apikey=bneov3023nfo023rssdf3

Retrieving a single object

Application clients also have access to a single resource by specifying the relevant ID of the resource. This information would have been returned when retrieving the list of resources, as specified above.

To retrieve a single workspace when you know the ID, the URL is:

GET https://api.<region>.whispir.com/workspaces/12345?apikey=bneov3023nfo023rssdf3

Or to retrieve a single contact when you know the ID, the URL is:

GET https://api.<region>.whispir.com/contacts/78910?apikey=bneov3023nfo023rssdf3

Nested objects

Within Whispir’s resource model some resources are nested within one another. For example:

  • The company resource contains many workspaces.
  • The workspace resource contains many messages.
  • Each message resource contains a MessageStatus.

Requests can be nested in order to provide application clients with the ability to access specific resources when they are nested.

For example, if you wanted to retrieve a contact from within a workspace, the URL would look like this:

GET https://api.<region>.whispir.com/workspaces/12345/contacts/67890?apikey=bneov3023nfo023rssdf3

  • JSON
  • XML

Retrieving objects

Retrieve all workspaces within your company:

{{codeStart}}

HTTP/1.1 GET https://api.<region>.whispir.com/workspaces?apikey=bneov3023nfo023rssdf3

{{codeEnd}}

Retrieve all messages from within the company:

{{codeStart}}

HTTP/1.1 GET https://api.<region>.whispir.com/messages?apikey=bneov3023nfo023rssdf3

{{codeEnd}}

Retrieving a single object

Retrieve a workspace with ID 12345:

{{codeStart}}

HTTP/1.1 GET https://api.<region>.whispir.com/workspaces/12345?apikey=bneov3023nfo023rssdf3

{{codeEnd}}

Retrieve a contact with ID 78910:

{{codeStart}}

HTTP/1.1 GET https://api.<region>.whispir.com/contacts/78910?apikey=bneov3023nfo023rssdf3

{{codeEnd}}

Nested objects

Retrieve a contact with ID 67890 from a workspace with ID 12345:

{{codeStart}}

HTTP/1.1 GET https://api.<region>.whispir.com/workspaces/12345/contacts/67890?apikey=bneov3023nfo023rssdf3

{{codeEnd}}