>  Switch To Link 5 and API v2 Documentation

Activities Webhooks

Learn about activities webhooks.

There are two types of activity webhook events:

  • Events that trigger only during the initial scan when a new account is connected: activities.fully_synced and activities.partially_synced. They trigger once per invocation for each added account.
  • Events that trigger later on, when new activities are added or removed in the future: activities.added, activities.updated, and activities.removed. These only trigger on a periodic scan for accounts that are already connected and have been fully synced, and only after the activities.fully_synced event is triggered.

A typical account can contain thousands of activities and activities.fully_synced only fires after all of the activities are scanned, which in some cases might take hours.

Use activities.partially_synced if you only need a partial range of the activities. For example, you need a history of the last 30 days instead of a complete history of activities. This reduces the sync time to minutes or, in some cases, seconds.



#Fully synced

post/v1/webhooks

Implement the activities.fully_synced webhook to know when all activities have been scanned.

  • The activities.fully_synced webhook triggers when all activities are fully scanned. Scanning starts from the most recent activities and finishes with the oldest ones.
  • This webhook only triggers when the initial scan finishes. It is not invoked during periodic scanning.
Request body
  • #
    eventsarray of strings
    required

    activities.fully_synced

  • #
    namestring
    required

    Your name for the webhook subscription.

  • #
    urlstring
    required

    Where you want to receive webhook delivery. This can be either a backend URL that you manage, or a URL provided by a webhook management service.

  • #
    secretstring
    optional

    Optional secret used to verify webhooks.

Webhook message
  • #
    eventstring

    activities.fully_synced

  • #
    namestring

    Name used for the webhook subscription.

  • #
    dataobject

  • #
    accountstring (uuid)

    ID of the account.

  • #
    userstring (uuid)

    ID of the user.

  • #
    available_fromstring (timestamp)

    The date of the oldest available activity.

    The available_from timestamp will precede the available_to timestamp.

  • #
    available_tostring (timestamp)

    The date of the most recent available activity.

  • #
    available_countinteger

    The total number of activities associated with the account at the moment the webhook call is made.

Example Subscription
1curl --request POST \
2     --url https://api.argyle.com/v1/webhooks \
3     --header 'accept: application/json' \
4     --header 'content-type: application/json' \
5     --data '{
6        "events": ["activities.fully_synced"],
7        "name": "name-for-the-webhook-subscription",
8        "url": "https://your-webhook-backend.com",
9        "secret": "optional-secret"
10     }'
Example Webhook
1{
2  "event": "activities.fully_synced",
3  "name": "All historical data synced",
4  "data": {
5    "account": "12db5af4-fd5f-4d1f-bd98-0360df770aa8",
6    "user": "abdb5af4-fd5f-4d1f-bd10-0360df77012c",
7    "available_from": "2019-03-07T20:12:09Z",
8    "available_to": "2019-09-23T23:57:31Z",
9    "available_count": 432
10  }
11}

#Partially synced

post/v1/webhooks

Implement the activities.partially_synced webhook to know when 30 days of historical activities have been scanned.

  • By default, the activities.partially_synced webhook triggers when 30 days of historical activities have been successfully scanned (starting from most recent activities).
  • The number of days scanned is a configurable parameter. This webhook can be subscribed to multiple times with different day ranges.
  • Triggers only on the initial scan, and does not trigger during a periodic scan. If an account has zero or a small number of activities, the initial scan may return all historical data and only fire the activities.fully_synced webhook.
Request body
  • #
    eventsarray of strings
    required

    activities.partially_synced

  • #
    namestring
    required

    Your name for the webhook subscription.

  • #
    urlstring
    required

    Where you want to receive webhook delivery. This can be either a backend URL that you manage, or a URL provided by a webhook management service.

  • #
    secretstring
    optional

    Optional secret used to verify webhooks.

  • #
    configobject
    optional

    "days_synced": <Integer> dictates the number of days to be scanned. The default value is 30.

Webhook message
  • #
    eventstring

    activities.partially_synced

  • #
    namestring

    Name used for the webhook subscription.

  • #
    dataobject

  • #
    accountstring (uuid)

    ID of the account.

  • #
    userstring (uuid)

    ID of the user.

  • #
    days_syncedinteger

    Number of historical days synced.

  • #
    available_fromstring (timestamp)

    The date of the oldest available activity within the time period provided in the days_synced configuration.

    The available_from timestamp will precede the available_to timestamp.

  • #
    available_tostring (timestamp)

    The date of the most recent available activity within the time period provided in the days_synced configuration.

  • #
    available_countinteger

    The total number of activities associated with the account at the moment the webhook call is made.

Example Subscription
1curl --request POST \
2     --url https://api.argyle.com/v1/webhooks \
3     --header 'accept: application/json' \
4     --header 'content-type: application/json' \
5     --data '{
6        "events": ["activities.partially_synced"],
7        "name": "name-for-the-webhook-subscription",
8        "url": "https://your-webhook-backend.com",
9        "secret": "optional-secret",
10        "config": { "days_synced": 7 }
11     }'
Example Webhook
1{
2  "event": "activities.partially_synced",
3  "name": "7 days synced",
4  "data": {
5    "account": "12db5af4-fd5f-4d1f-bd98-0360df770aa8",
6    "user": "abdb5af4-fd5f-4d1f-bd10-0360df77012c",
7    "days_synced": 7,
8    "available_from": "2019-06-07T20:12:09Z",
9    "available_to": "2019-06-14T20:12:09Z",
10    "available_count": 324
11  }
12}

#Added

post/v1/webhooks

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 and available_to specify the date range of all activities associated with the account
  • added_from and added_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 the account field of the activities.added webhook payload
  • from_start_date = the added_from timestamp in the activities.added webhook payload
  • to_start_date = the added_to timestamp in the activities.added webhook payload
Request body
  • #
    eventsarray of strings
    required

    activities.added

  • #
    namestring
    required

    Your name for the webhook subscription.

  • #
    urlstring
    required

    Where you want to receive webhook delivery. This can be either a backend URL that you manage, or a URL provided by a webhook management service.

  • #
    secretstring
    optional

    Optional secret used to verify webhooks.

Webhook message
  • #
    eventstring

    activities.added

  • #
    namestring

    Name used for the webhook subscription.

  • #
    dataobject

  • #
    accountstring (uuid)

    ID of the account.

  • #
    userstring (uuid)

    ID of the user.

  • #
    added_fromstring (timestamp)

    The time of the earliest activity that was recently added.

    The added_from timestamp will precede the added_to timestamp.

  • #
    added_tostring (timestamp)

    The time of the latest activity that was recently added.

  • #
    added_countinteger

    The number of activities added to the account.

  • #
    available_fromstring (timestamp)

    The date of the earliest activity available for the account.

    The available_from timestamp will precede the available_to timestamp.

  • #
    available_tostring (timestamp)

    The date of the most recent available activity.

  • #
    available_countinteger

    The total number of activities associated with the account at the moment the webhook call is made.

Example Subscription
1curl --request POST \
2     --url https://api.argyle.com/v1/webhooks \
3     --header 'accept: application/json' \
4     --header 'content-type: application/json' \
5     --data '{
6        "events": ["activities.added"],
7        "name": "name-for-the-webhook-subscription",
8        "url": "https://your-webhook-backend.com",
9        "secret": "optional-secret"
10     }'
Example Webhook
1{
2  "event": "activities.added",
3  "name": "Activities added",
4  "data": {
5    "account": "12db5af4-fd5f-4d1f-bd98-0360df770aa8",
6    "user": "abdb5af4-fd5f-4d1f-bd10-0360df77012c",
7    "added_from": "2019-08-07T20:12:09Z",
8    "added_to": "2019-09-23T23:57:31Z",
9    "added_count": 10,
10    "available_from": "2019-03-07T20:12:09Z",
11    "available_to": "2019-09-23T23:57:31Z",
12    "available_count": 456
13  }
14}

#Updated

post/v1/webhooks

Implement the activities.updated webhook to know when an activity object is updated.

  • Activity objects are updated through periodic scanning.
Request body
  • #
    eventsarray of strings
    required

    activities.updated

  • #
    namestring
    required

    Your name for the webhook subscription.

  • #
    urlstring
    required

    Where you want to receive webhook delivery. This can be either a backend URL that you manage, or a URL provided by a webhook management service.

  • #
    secretstring
    optional

    Optional secret used to verify webhooks.

Webhook message
  • #
    eventstring

    activities.updated

  • #
    namestring

    Name used for the webhook subscription.

  • #
    dataobject

  • #
    accountstring (uuid)

    ID of the account.

  • #
    userstring (uuid)

    ID of the user.

  • #
    updated_fromstring (timestamp)

    Represents the start of the time period the activities were updated in.

    The updated_from timestamp will precede the updated_to timestamp.

  • #
    updated_tostring (timestamp)

    Represents the end of the time period the activities were updated in.

  • #
    updated_countinteger

    The number of activities that were updated.

  • #
    updated_activitiesarray of (uuid) strings

    ID's of the updated activities.

  • #
    available_fromstring (timestamp)

    Represents the start of the time period the activities are available for.

    The available_from timestamp will precede the available_to timestamp.

  • #
    available_tostring (timestamp)

    Represents the end of the time period the activities are available for.

  • #
    available_countinteger

    The total number of activities associated with the account at the moment the webhook call is made.

Example Subscription
1curl --request POST \
2     --url https://api.argyle.com/v1/webhooks \
3     --header 'accept: application/json' \
4     --header 'content-type: application/json' \
5     --data '{
6        "events": ["activities.updated"],
7        "name": "name-for-the-webhook-subscription",
8        "url": "https://your-webhook-backend.com",
9        "secret": "optional-secret"
10     }'
Example Webhook
1{
2  "event": "activities.updated",
3  "name": "Activities updated",
4  "data": {
5    "account": "12db5af4-fd5f-4d1f-bd98-0360df770aa8",
6    "user": "abdb5af4-fd5f-4d1f-bd10-0360df77012c",
7    "updated_from": "2019-09-10T10:00:00Z",
8    "updated_to": "2019-09-12T12:00:00Z",
9    "updated_count": 2,
10    "updated_activities": [
11      "d667a477-e252-4f8a-9518-92a51b235187",
12      "27f3cde1-1ca0-4b5a-940d-337fd33f97b5"
13    ],
14    "available_from": "2019-03-07T20:12:09Z",
15    "available_to": "2019-09-23T23:57:31Z",
16    "available_count": 456
17  }
18}

#Removed

post/v1/webhooks

Implement the activities.removed webhook to know when an activity object is removed.

  • An activity object is removed when specific activities are deleted from an account by a data provider and are found to be missing during a periodic scan.
Request body
  • #
    eventsarray of strings
    required

    activities.removed

  • #
    namestring
    required

    Your name for the webhook subscription.

  • #
    urlstring
    required

    Where you want to receive webhook delivery. This can be either a backend URL that you manage, or a URL provided by a webhook management service.

  • #
    secretstring
    optional

    Optional secret used to verify webhooks.

Webhook message
  • #
    eventstring

    activities.removed

  • #
    namestring

    Name used for the webhook subscription.

  • #
    dataobject

  • #
    accountstring (uuid)

    ID of the account.

  • #
    userstring (uuid)

    ID of the user.

  • #
    removed_fromstring (timestamp)

    Represents the start of the time period the activities were removed in.

    The removed_from timestamp will precede the removed_to timestamp.

  • #
    removed_tostring (timestamp)

    Represents the end of the time period the activities were removed in.

  • #
    removed_countinteger

    The total number of activities removed from the account at the moment the webhook call is made.

  • #
    removed_activitiesarray of (uuid) strings

    ID's of the removed activities.

  • #
    available_fromstring (timestamp)

    Represents the start of the time period the activities are available for.

    The available_from timestamp will precede the available_to timestamp.

  • #
    available_tostring (timestamp)

    Represents the end of the time period the activities are available for.

  • #
    available_countinteger

    The total number of activities associated with the account at the moment the webhook call is made.

Example Subscription
1curl --request POST \
2     --url https://api.argyle.com/v1/webhooks \
3     --header 'accept: application/json' \
4     --header 'content-type: application/json' \
5     --data '{
6        "events": ["activities.removed"],
7        "name": "name-for-the-webhook-subscription",
8        "url": "https://your-webhook-backend.com",
9        "secret": "optional-secret"
10     }'
Example Webhook
1{
2  "name": "Activities Removed",
3  "event": "activities.removed",
4  "data": {
5    "account": "017d9bdc-49cb-bcf6-9a99-f3ed32ddb2c2",
6    "user": "017d8fed-b702-7675-e9be-00d6b2d24614",
7    "removed_from": "2021-09-27T00:22:54Z",
8    "removed_to": "2021-09-27T00:22:54Z",
9    "removed_count": 1,
10    "removed_activities": [
11      "017d9f62-84e1-15ad-b269-624458d343c8"
12    ],
13    "available_from": "2019-09-03T17:56:22Z",
14    "available_to": "2021-12-09T00:01:01Z",
15    "available_count": 1237
16  }
17}
Updating Argyle status...
© 2024 Argyle Systems Inc.argyle.com