SocialData.Tools: API Documentation
  • Getting Started
  • Authentication
  • Pricing
  • SDKs and Code Examples
  • Twitter: Tweets
    • Retrieve tweet details
    • Retrieve thread
    • Retrieve article details
    • Retrieve all users who retweeted a tweet
    • Retrieve search results by keyword
    • Retrieve all users who liked a tweet
  • Twitter: Users
    • Retrieve user profile details
    • Retrieve profile's affiliated users
    • Retrieve tweets and replies made by a specific user
    • Retrieve likes made by a specific user
    • Retrieve user's articles
    • Retrieve user's highlighted tweets
    • Retrieve user's followers
    • Retrieve user's following
    • Retrieve user's lists
    • Check if a user is following another user
    • Check if a user retweeted a specific tweet
    • Check if a user commented on a specific tweet
    • Check if a user liked a specific tweet
    • Retrieve users search results by screenname
  • Twitter: Lists
    • Retrieve list details
    • Retrieve list members
  • Twitter: Spaces
    • Retrieve Twitter spaces stream details
  • Twitter / X: Communities
    • Retrieve community tweets timeline
    • Retrieve community members
Powered by GitBook
On this page
  • Configuring webhooks
  • Webhook Events
  • Example webhook data
  • Adding an endpoint to your app
  1. Twitter / X: Async Endpoints

Using Webhooks

Instead of manually checking job status, you can opt to receive updates through webhook notifications. Whenever there is a change in the job status, a webhook call will be made to the specified URL.

A webhook call is triggered only when job status is changed to success or error.

Configuring webhooks

To configure the webhook, please follow these steps:

  1. Sign in to your dashboard using your credentials.

  2. Navigate to the "Settings" page.

  3. Update the Webhook URL with the desired URL for receiving webhook notifications.

  4. Save the changes. Once updated - webhook notifications will be automatically enabled for all jobs

Webhook Events

At the moment there is only one event supported:

  • job_finished

Example webhook data

Webhook events are sent as JSON via POST requests to your endpoint.

The data that is available in each webhook is the same as job status response from GET /jobs/[job_id] endpoint. Each of our webhooks follows the same structure as below.

{
    "event": "job_finished",
    "data": {
        "job_id": 42,
        "status": "success",
        "result": {
            "datafile_url": "https://s3.amazonaws.com/..."    
        }
    }
}

Adding an endpoint to your app

You will need an endpoint in your app that serves as the receiver for all webhook requests. This should accept POST requests and be able to process and/or save each webhook as it is sent.

To tell SocialData API that a webhook request was received OK, return a HTTP 200 response. Any other response code will tell us that the webhook failed. At the moment we do not make repeated attempts to trigger failed webhook calls again.

We recommend that you store, at least temporarily, webhook events locally (either in your database or a cache) so that you can return the HTTP 200 response quickly and process the data outside of the webhook request. If your app ever fails to process a webhook, you will then have the data to make a bug fix and process it successfully without waiting for it to be resent.

Last updated 9 months ago