Implement the activities.added
webhook to know when a new activity object is added.
An activity object will be added:
- When a new account is connected, and its scanned data includes activities data
- On a continuous basis, if a new activity is retrieved during Argyle's periodic scanning of connected accounts
Two time periods are recorded and delivered in the activities.added
payload:
available_from
andavailable_to
specify the date range of all activities associated with the accountadded_from
andadded_to
specify the date range of the newly added activities
To retrieve recently added activities, list activities using the query parameters:
account
= the ID returned in theaccount
field of theactivities.added
webhook payloadfrom_start_date
= theadded_from
timestamp in theactivities.added
webhook payloadto_start_date
= theadded_to
timestamp in theactivities.added
webhook payload
Event
activities.added
Payload
Attributes | Type | Description |
---|---|---|
account | string uuid | ID of the account the activities were added to. |
user | string uuid | ID of the user associated with the account. |
added_from | string timestamp | The time of the earliest activity that was recently added. The added_from timestamp will precede the added_to timestamp. |
added_to | string timestamp | The time of the latest activity that was recently added. |
added_count | integer | The number of activities added to the account. |
available_from | string timestamp | The time of the earliest activity available for the account. The available_from timestamp will precede the available_to timestamp. |
available_to | string timestamp | The time of the latest activity available for the account. |
available_count | integer | The total number of activities associated with the account at the moment the webhook call is made. |
Examples
curl -X POST https://api.argyle.com/v1/webhooks \
-u api_key_id:api_key_secret \
-H "Content-Type: application/json" \
-d '{"events": ["activities.added"],
"secret": "<secret for signature verification>",
"name": "activities.added",
"url": "https://webhook.site/url"}'
{
"event": "activities.added",
"name": "Activities added",
"data": {
"account": "12db5af4-fd5f-4d1f-bd98-0360df770aa8",
"user": "abdb5af4-fd5f-4d1f-bd10-0360df77012c",
"added_from": "2019-08-07T20:12:09Z",
"added_to": "2019-09-23T23:57:31Z",
"added_count": 10,
"available_from": "2019-03-07T20:12:09Z",
"available_to": "2019-09-23T23:57:31Z",
"available_count": 456
}
}