Fetch webhook events

To retrieve webhooks sent within a specific period, the API provides a search endpoint. This allows filtering webhooks by date range and a subaccount identifier provided by the authentication token.

Request example

You can make an HTTP GET request to the following endpoint, specifying the desired parameters:

curl:

curl --location 'https://sdk-mobile-api-rc.truvideo.com/api/webhook/search?from=2024-11-19T00%3A00%3A00Z&to=2024-11-21T23%3A59%3A59Z&page=0&size=1000&status=FAILED&status=SUCCESS&mediaId=22efa582-1f6f-457c-a555-3cb3bf7f2a56&subAccountId=54535d5a-551a-4716-aad1-e719c742d288' \
--header 'Accept: text/csv' \
--header 'Authorization: Bearer {{YOUR-ACCESS-TOKEN}}'

Params:

BASE-URL:


YOUR-ACCESS-TOKEN:

Access token provided by the endpoint mentioned on this documentation: [SDK Mobile] - Generate an API Token


ACCEPT HEADER:

Specifies the desired response format.

  • text/csv: The API will returns a response in format CSV.

  • application/json: The API will return a JSON response.


QUERY PARAMS:

  • from: The start of the date range for the search is format ISO 8601 (e.g., 2024-11-19T00:00:00Z). The date and time values should be URL-encoded to ensure proper parsing by the server.

  • to: The end of the date range for the search, also in ISO 8601 format (e.g., 2024-11-21T23:59:59Z). The date and time values should be URL-encoded to ensure proper parsing by the server.

  • page: The page number for the search results. It enables navigating through paginated responses.

  • size: The maximum number of records to return in the response. The maximum value allowed is 1000. The size parameter limits the number of records returned in a single response. If there are more records, pagination may be required.

  • status: The status of the webhook delivery. It can be FAILED, SUCCESS or both. (e.g., status=SUCCESS & status=FAILED).

  • mediaId: Return all webhook events associated to the given media ID value

  • subAccountId: if the subAccountId is not provided, the search will be performed across all subAccounts of the account.

Response example

The endpoint responds with the details of the webhooks sent during the specified period.

CSV response example - Accept: text/csv
TYPE,NOTIFICATION_STATUS,EVENT_ID,EVENT_DATE,MEDIA_ID,MEDIA_VIEWING_TIME,MEDIA_LENGTH,MEDIA_DURATION,PLAYER_TAGS,EVENT_TAGS,MEDIA_TAGS,MEDIA_TYPE,SOURCE_TYPE,MEDIA_CREATOR,MEDIA_CREATION_DATE,SUBACCOUNT_EXTERNAL_ID,ERROR_MESSAGE
MEDIA_DURATION,SUCCESS,bcedb369-1e2b-48da-9e89-ef039d694321,2024-11-21T20:32:53Z,96a2b49e-84cd-4331-ad7f-a9089fffb253,2024-11-21T08:32:52,15,-,APPLICATION_NAME=Media test,-,UPLOADED_BY_ID=user|APPLICATION_ENV=ENV|UPLOADED_BY_NAME=USER,VIDEO,THIRDPARTY_UPLOAD_MEDIA,-,2024-11-15T16:58:53,ACCOUNT_EXT_ID,-
MEDIA_DURATION,SUCCESS,5f354ce3-cf95-4d07-a792-e1aa7d4bc324,2024-11-21T20:32:52Z,96a2b49e-84cd-4331-ad7f-a9089fffb253,2024-11-21T08:32:50,14,-,APPLICATION_NAME=Media test,-,UPLOADED_BY_ID=user|APPLICATION_ENV=ENV|UPLOADED_BY_NAME=USER,VIDEO,THIRDPARTY_UPLOAD_MEDIA,-,2024-11-15T16:58:53,ACCOUNT_EXT_ID,-
MEDIA_DURATION,SUCCESS,bcedb369-1e2b-48da-9e89-ef039d694543,2024-11-21T20:32:52Z,96a2b49e-84cd-4331-ad7f-a9089fffb253,2024-11-21T08:32:52,15,-,APPLICATION_NAME=Media test,-,UPLOADED_BY_ID=user|APPLICATION_ENV=ENV|UPLOADED_BY_NAME=USER,VIDEO,THIRDPARTY_UPLOAD_MEDIA,-,2024-11-15T16:58:53,ACCOUNT_EXT_ID,-

In addition, the response includes the following headers with the pagination details:

X-Total-Elements X-Total-Pages X-Page X-Size

JSON response example - Accept: application/json
{
    "totalPages": 1,
    "totalElements": 75,
    "content": [
        {
            "id": "ae8ae199-9d6c-47a5-b06f-203599856442",
            "createdDate": "2024-11-21T20:32:53Z",
            "version": 1,
            "callbackUrl": "https://webhook.site/ad5f2ab7-ecd0-48a2-b764-845ad1caa54f",
            "environmentId": "9a0550e0-6160-404d-a26c-47382901hfru",
            "subAccountId": "3ab470f8-f176-45ae-9f26-f1whehiuwehf",
            "subAccountExternalId": "ACCOUNT_EXT_ID",
            "webhookMessage": {
                "eventId": "bcedb369-1e2b-48da-9e89-ef039d6942a3",
                "mediaId": "96a2b49e-84cd-4331-ad7f-a9089fff6578",
                "mediaCreator": null,
                "type": "MEDIA_DURATION",
                "mediaType": "VIDEO",
                "mediaCreationDate": "2024-11-15T16:58:53",
                "subAccountExternalId": "ACCOUNT_EXT_ID",
                "mediaTags": {
                    "UPLOADED_BY_ID": "USERNAME",
                    "APPLICATION_ENV": "ENV",
                    "UPLOADED_BY_NAME": "User"
                },
                "playerTags": {
                    "IDENTIFIER": "ID_1234",
                },
                "eventTags": {},
                "payload": [
                    {
                        "key": "mediaLength",
                        "displayName": "Media Length",
                        "value": 15,
                        "valueType": "LONG"
                    },
                    {
                        "key": "mediaDuration",
                        "displayName": "Media Duration",
                        "value": null,
                        "valueType": "LONG"
                    },
                    {
                        "key": "mediaViewingTime",
                        "displayName": "Media Viewing Time",
                        "value": "2024-11-21T08:32:52",
                        "valueType": "DATE"
                    },
                    {
                      "key": "mediaDurationPercentage", 
                      "value": 25, 
                      "valueType": "LONG", 
                      "displayName": "Percentage of duration of the media watched"
                    }
                ],
                "sourceType": "THIRDPARTY_UPLOAD_MEDIA",
                "endlinkHash": "120B491BD12EB2DCECC52FF42C1C48A467831FCBFEE1ABEC3473D7E0C7721231",
                "displayCategory": "PREROLL"
            },
            "response": "This URL has no default content configured.",
            "errorMessage": null,
            "timestamp": "2024-11-21T20:32:53",
            "status": "SUCCESS"
        }
    ],
    "size": 1000,
    "page": 0
  }

For more information regarding the response body content, check the Callback webhook documentation.

Last updated