This tutorial is in order to get your requests using the version 1.0 of Sandbox Botdoc API. In order to use this version, you have to put “v1” on the API’s endpoint.
To a better understanding about the versioning, please go to api.botdoc.io/documentation/#versioning
and to a better understanding about the Sandbox, please go to api.botdoc.io/documentation/#sandbox-platform
Create a step-by-step guide:
Getting your requests:
In order to get a list of your requests you have to make a request to https://api.botdoc.io/v1/module_container/container/ as GET and you can use 2 parameters:page
to return the result set based on this page number (starting from 1, not 0), and page_size
that is the number of results per page.
If you don’t pass any parameter, page
‘s default is 1 and page_size
‘s default is 10.
If you send a request like this: https://api.botdoc.io/v1/module_container/container/?page=2&page_size=5 (always remember sending token on header).
The response will look like the example below:
{ "links": { "previous": "https://api.botdoc.io/v1/module_container/container/?page_size=5", "next": "https://api.botdoc.io/v1/module_container/container/?page=3&page_size=5" }, "count": 18, "total_pages": 4, "results": [{ "id": 5457, "identifier": "820aeeb52ad0707xxxxxxxxxxxxxxxxx", ... }, ...{ "id": 5459, "identifier": "b63202468ca4cb029fxxxxxxxxxxxxxxxxxb", ... } ] } |
The links
is an array of strings, that always contains previous
and next
.
The previous
is the URL to request the previous page, returns null when it’s the first page.
The next
is the URL to request the next page, returns null when it’s the last page.
The total_pages
returns the total of pages.
The count
returns the total requests.
The results
return an array of requests.
Getting a specific request:
In order to get a specific request you have to make a request to:
https://api.botdoc.io/v1/module_container/container/{container_id}/ as GET and the response will look like the example below:
{ "id": 3144, "identifier": "0a43xxxxxxxxxxxxxxxxxx", "state": "completed", "callback_url": null, "expires_at": "2020-06-04T14:34:01.741277Z", "email_template_slug": null, "created": "2020-06-01T14:34:01.232906Z", "updated": "2020-06-01T14:34:01.762544Z", "allow_open_remote_addrs": [ "*" ], "block_open_remote_addrs": [], "page_type": "p2" } |
For more details about getting your requests you can take a look at our Botdoc API Reference on api.botdoc.io/documentation/#getting-your-requests |
The content by label feature displays related articles automatically, based on labels you choose. To edit options for this feature, select the placeholder below and tap the pencil icon.
|