Activities

Retrieving activities

To retrieve a list of activities from the developers.whispir.com API you can execute a HTTP GET using the /activities endpoint.

You need to supply one of the following headers (for retrieving JSON or XML):

  • Accept: application/vnd.whispir.activity-v1+xml
  • Accept: application/vnd.whispir.activity-v1+json

An array of activities will be returned to you in the HTTP response body. Each activity will provide the following information:

High-level response elements

action

String

Specifies the action performed during this activity.

module

String

Specifies the module to which this activity belongs to.

workspace

String

The workspace in which this activity is performed.

user

String

The username of the person who performed this activity.

status

String

Specifies the status of the activity. The status can be one of the following:

  • Successful
  • Failed
  • Rejected

description

String

The description of the activity.

time

String

The date and time of the activity in the format: dd/mm/yy hh:mm.

link

Array

Provides a list of URLs that can be used to manipulate or access the activity:

  • uri: The link to access the activity.
  • rel: The descriptor for what the link will do.
  • method: The HTTP method to use with this particular link.


Note: The API currently results in a 404 Not Found when there are no activities present in the log for a given search criteria. This should not be considered a failed response but rather as No Data Found.


Restricting activities to a single workspace

By default, GET /activities returns all activities at the company level, which covers all workspaces. If you need to limit the items to a specific workspace, you use the workspace as the endpoint, followed by activities, as shown in the table below.

Request information

Request

Description

/activities

Only returns activities that took place in My Company.

/workspaces/:id/activities

Only returns activities that took place in the specified workspace.


  • JSON
  • XML

{{codeStart}}

HTTP 1.1 GET https://api.<region>.whispir.com/activities?apikey=[your_api_key]

Authorization: Basic asdf98nf89asdvasd2r398h8sdf

x-api-key: your_api_key

Accept: application/vnd.whispir.activity-v1+json

{

"activities": [

{

"user": "james.cameron",

"time": "17/08/19 13:29",

"action": "Send",

"description": "Message sent via the Whispir's Java library",

"status": "Successful",

"module": "Message",

"workspaceName": "Whispir",

"link": [

{

"uri": "https://api.<region>.whispir.com/activities/9B26BCE6A7C1997D3E3C04D4C0B62165?apikey=[your_api_key]",

"rel": "self",

"method": "GET"

}

]

},

{

"user": "james.cameron",

"time": "17/08/19 12:56",

"action": "Create",

"status": "Successful",

"module": "Workspace",

"workspaceName": "Whispir",

"link": [

{

"uri": "https://api.<region>.whispir.com/activities/CF8F388F18FDDA7CA40F42E888EC8E67?apikey=[your_api_key]",

"rel": "self",

"method": "GET"

}

]

},

{

"user": "james.cameron",

"time": "17/08/19 12:26",

"action": "Draft",

"description": "Template for default notification messages",

"status": "Successful",

"module": "Template",

"workspaceName": "Whispir",

"link": [

{

"uri": "https://api.<region>.whispir.com/activities/19F603F21E8A7D536D577A6B4DBCFE3F?apikey=[your_api_key]",

"rel": "self",

"method": "GET"

}

]

},

{

"user": "markm",

"time": "22/12/19 11:37",

"action": "Logout",

"description": "Logged out",

"status": "Successful",

"module": "System",

"workspaceName": "ABC Operations",

"link": [

{

"uri": "https://api.<region>.whispir.com/activities/0DEB48AB3D3B6069D7DA1A808F5A5DE4?apikey=[your_api_key]",

"rel": "self",

"method": "GET"

}

]

},

{

"user": "markm",

"time": "22/12/19 11:20",

"action": "Login",

"description": "Logged in, IP:8.8.8.8, Country: USA",

"status": "Successful",

"module": "System",

"workspaceName": "ABC Operations",

"link": [

{

"uri": "https://api.<region>.whispir.com/activities/0CEC8009230B3B92F5B548A22B55C407?apikey=[your_api_key]",

"rel": "self",

"method": "GET"

}

]

}

],

"link": []

}

HTTP 1.1 GET https://api.<region>.whispir.com/activities?apikey=[your_api_key]

Authorization: Basic asdf98nf89asdvasd2r398h8sdf

x-api-key: your_api_key

HTTP 1.1 GET https://api.<region>.whispir.com/workspace/B7BFEF555F0F7F81/activities?apikey=[your_api_key]

Authorization: Basic asdf98nf89asdvasd2r398h8sdf

x-api-key: your_api_key

{{codeEnd}}