Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

To avoid continually polling the Verity Page endpoint for classification responses, clients can create a webhook to listen for results on a Verity callback URL.

To integrate with Verity, the webhook target server must:

  • Be able to receive HTTP/HTTPS POST requests over the internet.

  • Respond to Verity with an HTTP 2XX status code.

  • Send responses to Verity within 5 seconds.

Note: No data is required in webhook responses to Verity.

These steps walk through a Verity page classification request with webhook integration. 

Step 1 – Expose web service

First, expose your web service, for example:

https://verity-webhook.domain.com/results

Step 2 – Create page classification request 

Create a Verity page classification request, for example: 

https://verity-api.gumgum.com/page/classify?pageUrl=https%3A%2F%2Ftest.iab12.com%2F1

Step 3 – Add callbackUrl parameter with webhook address 

Add a callBackUrl parameter with the webhook address to the page request. The webhook URL must be properly URL-encoded.  For example:

&callBackUrl=https%3A%2F%2Fverity-webhook.domain.com%2Fresults

Step 4 – Submit GET page classification request

Submit the GET request via curl:

curl -H 'x-api-key: <YOUR_API_KEY_HERE>’ `https://verity-api.gumgum.com/page/classify?pageUrl=https%3A%2F%2Ftest.iab12.com%2F1&callBackUrl=https%3A%2F%2Fverity-webhook.domain.com%2Fresults`

Verity issues an HTTP Status Code 202 (ACCEPTED) to indicate that the request has been initiated. The status field in the response JSON within the data payload updates to INITIATED.

Note: Verity response time SLAs are under development.

Step 5 – Verity POSTs response to webhook URL

After successfully processing the request,  Verity initiates an HTTP/HTTPS POST to the webhook URL with the response JSON data, for example:

{
  "dataAvailable": true,
  "status": "PROCESSED",
  "pageUrl": "https://aragonresearch.com/cisco-google-and-zoom-enhance-free-meetings-to-assist-with-coronavirus/",
  "uuid": "deb59fc2-b8ef-4dbe-ab64-6a1950a45a76",
  "verityData": {
    "languageCode": "en",
    "iab": {
      "v1": [
        {
          "id": "IAB19",
          "category": "Technology & Computing",
          "score": 0.52
        },
        {
          "id": "IAB7",
          "category": "Health & Fitness",
          "score": 0.13
        },
        {
          "id": "IAB19-18",
          "category": "Internet Technology",
          "score": 0.11
        },
        {
          "id": "IAB19-8",
          "category": "Computer Networking",
          "score": 0.1
        },
        {
          "id": "IAB7-37",
          "category": "Psychology/Psychiatry",
          "score": 0.09
        }
      ],
      "v2": [
        {
          "id": "596",
          "category": "Technology & Computing",
          "score": 0.54
        },
        {
          "id": "379",
          "category": "News and Politics",
          "score": 0.19
        },
        {
          "id": "600",
          "category": "Computer Networking",
          "score": 0.08,
          "parent": {
            "id": "599",
            "category": "Computing",
            "parent": {
              "id": "596",
              "category": "Technology & Computing"
            }
          }
        },
        {
          "id": "635",
          "category": "Smartphones",
          "score": 0.07,
          "parent": {
            "id": "632",
            "category": "Consumer Electronics",
            "parent": {
              "id": "596",
              "category": "Technology & Computing"
            }
          }
        },
        {
          "id": "388",
          "category": "Political Issues",
          "score": 0.07,
          "parent": {
            "id": "386",
            "category": "Politics",
            "parent": {
              "id": "379",
              "category": "News and Politics"
            }
          }
        }
      ]
    },
    "keywords": [
      "covid",
      "coronavirus",
      "covid-19",
      "pandemic",
      "cisco",
      "logmein",
      "free webex cisco",
      "zoom",
      "google hangouts",
      "google",
      "logmein offers free remote",
      "cisco makes",
      "zoom removes",
      "large coronavirus outbreak",
      "google offers premium features",
      "aragon",
      "enhance",
      "online meetings",
      "web meetings"
    ],
    "safe": false,
    "threats": [
      {
        "id": "GGT9",
        "category": "Medical",
        "confidence": "HIGH"
      }
    ],
    "sentiments": [
      {
        "sentiment": "neutral",
        "score": 0.73
      },
      {
        "sentiment": "positive",
        "score": 0.24
      },
      {
        "sentiment": "negative",
        "score": 0.03
      }
    ],
    "processedAt": "2021-02-09T22:13:52.864Z"
  }
}

 

Step 6 – Webhook target server sends a successful response status code

The webhook target server sends a successful response status code (2XX) within the HTTP connection timeout of 5 seconds.

  • No labels