Main Content

Read Status of Image Request

Read status of image request with HTTP GET

Read the status of a recent image write or delete request, so you can determine if the request was completed.

Request

HTTP Method

GET

URL

https://data.thingspeak.com/channels/<channel_id>/recent-requests/<request_id>/status

URL Parameters

NameDescription

<channel_id>

(Required) Channel ID for the channel of interest.

<request_id>

(Required) Request ID, returned from the original request.

Example: https://data.thingspeak.com/channels/0987654321/recent-requests/cl2th2wxyuvtsr7m9e3l5blje/status

Body Parameters

None.

Headers

None.

Response

Success

HTTP Status Code

200 OK

Body

The immediate response is a JSON object with the original request ID, and its current code and status. For example:

{
    "requestID": "cl2th2wxyuvtsr7m9e3l5blje",
    "code": 1,
    "status": "OK"
}

Possible status values are PENDING, OK, and FAIL.

If the status is FAIL, there is also a message field that is populated with the reason for the request failure.

Error

For the full list, see Error Codes.

Examples

expand all

You can use your web browser to complete GET HTTP requests to the RESTful API for ThingSpeak™.

To see the format for an HTTP response, copy this link to your web browser, changing the channel ID and request ID as appropriate.

https://data.thingspeak.com/channels/<channel_id>/recent-requests/<request_id>/status

The following code operates in a Linux® shell. Change the channel ID request ID as appropriate.

curl --location --request GET 'https://data.thingspeak.com/channels/<channel_id>/recent-requests/<request_id>/status'

The raw response is something like:

{"requestID":"cl2tgo098765432193z93gpc1","code":1,"status":"OK"}

You can use Postman to send HTTP DELETE requests using the RESTful API for ThingSpeak. This example shows how to delete a set of images within a range of timestamps.

  1. In Postman, select GET from the drop-down list of HTTP verbs.

  2. In the address bar, enter https://data.thingspeak.com/channels/<channel_id>/recent-requests/<request_id>/status, replacing <channel_id> with the ID of the image channel, and <request_id> with the request ID of the request you are inquiring about.

  3. There are no keys required under the Params and Headers tabs, and the Body content is none.

This image shows the Postman setup for the status request, and its result.

Postman status request

The response is a JSON object, and a 200 OK from the server.