Skip to main content

Getting Started

Result handling

All endpoints in Account API support 3 different result-handling options, which allow flexibility in how you receive the output of your requests, depending on your integration needs and the nature of the requests.

Long polling (default)

With long polling, the API does not respond until the requested result is ready. This option is suitable for requests involving small amounts of data or when a quick response is expected.

How to use

  • Specify the result-handling header and set it to long.
  • If the result-handling header is not included, long is used by default.

Response options

  1. Successful completion:

{
  "status": "complete",
  "completion": { ... }
}
  1. Global error:

{
  "status": "error",
  "error": {
    "errorType": "invalidRequestBody",
    "message": "The request body is invalid: {validation_details}."
  }
}

With the result link option, the API accepts your request and immediately returns a link you can use to periodically check for the result.

This option is more robust and recommended for requests that may take significant time to process, such as retrieving large amounts of data or executing many operations within array requests.

How to use

  • Set the result-handling header to reslink.

Response options

  1. Accepted:

{
  "status": "processing",
  "process": {
    "message": "Your request is being processed. Please check the resultLink periodically.",
    "resultLink": "https://api.linkedapi.io/account/results/{someShortHash}"
  }
}
  1. Global error:

{
  "status": "error",
  "error": {
    "errorType": "invalidRequestBody",
    "message": "The request body is invalid: {validation_details}."
  }
}

Pulling the result

Use the resultLink provided to make a GET request:

GET https://api.linkedapi.io/account/results/{someShortHash}
  1. Processing:

{
  "status": "processing",
  "process": {
    "message": "Your request is being processed. Please check the resultLink later.",
    "resultLink": "https://api.linkedapi.io/account/results/{someShortHash}"
  }
}
  1. Successful completion:

{
  "status": "complete",
  "completion": { ... }
}
  1. Global error:

{
  "status": "error",
  "error": {
    "errorType": "linkedinAccountSignedOut",
    "message": "This LinkedIn account has been signed out in our cloud browser."
  }
}

Webhook

With the webhook option, the API accepts your request and sends the result to a specified webhook URL as soon as it is ready. This method is ideal for real-time notifications and eliminates the need for periodic polling.

How to use

  • Set the result-handling header to hook.
  • Include a webhook header with the URL to which the result should be sent.

Response options

  1. Accepted:

{
  "status": "processing",
  "process": {
    "message": "Your request is being processed. The result will be sent to the webhook.",
    "webhook": "https://webhookexample.com/"
  }
}
  1. Global error:

{
  "status": "error",
  "error": {
    "errorType": "invalidRequestBody",
    "message": "The request body is invalid: {validation_details}."
  }
}

Webhook receives

  1. Successful completion:

{
  "status": "complete",
  "completion": { ... }
}
  1. Global error:

{
  "status": "error",
  "error": {
    "errorType": "linkedinAccountSignedOut",
    "message": "This LinkedIn account has been signed out in our cloud browser."
  }
}

Throughout the documentation, for simplicity, only the request body and final response (when status is complete) are shown. The actual request handling process always stays within the options described above.