Async API User Guide

Asynchronous computing is a paradigm where the user does not expect a workload to be executed immediately; instead, it gets scheduled for execution sometime in the near future without blocking the latency-critical path of the application. This page gives you guidance and the best practices to follow to retrieve the results of the async API.

Poll the Async Session ID for Results

Request

curl -G -X GET \ 
  -d 'fields=id,status,result' \ 
  -d 'access_token=<ACCESS_TOKEN>' \ 
  "https://graph.facebook.com/v19.0/<ASYNC_SESSION_ID>"
    

Response

{
  "id": "<ASYNC_SESSION_ID>",
  "status": "enum string",
  "result": "string",
}

Response Parameters

NameDescription

id

numeric string

The ID of the async request.
Also known as the ASYNC_SESSION_ID.

status

enum string

The status of the async job.
Values:

  • UNKNOWN
  • NOT_STARTED
  • IN_PROGRESS
  • COMPLETED
  • FAILED

result

string

The result as returned by the async job.
For details, look at the corresponding API call's success and failure responses.

Polling Best Practices

The polling requests also count towards the overall API rate limit for your application. Consider using exponential backoff for polling.