API Dictionary: Difference between revisions
No edit summary |
No edit summary |
||
Line 14: | Line 14: | ||
"message" will either be "Successful" or an error message. "skip" is how many records into the query we skipped, "limit" is how many objects we returned. "total" is the total amount of objects that are available. And "data" is an array of objects containing the results. | "message" will either be "Successful" or an error message. "skip" is how many records into the query we skipped, "limit" is how many objects we returned. "total" is the total amount of objects that are available. And "data" is an array of objects containing the results. | ||
==== Pagination ==== | ==== Pagination ==== | ||
Line 26: | Line 27: | ||
This will grab two records starting on the 7th record. | This will grab two records starting on the 7th record. | ||
==== Sorting ==== | |||
You can also sort the records by one of the field names by using the following format: | You can also sort the records by one of the field names by using the following format: | ||
Line 38: | Line 41: | ||
You can either use "asc" or "desc" for the direction of the sort. | You can either use "asc" or "desc" for the direction of the sort. | ||
Revision as of 16:10, 22 December 2023
This endpoint is used to list of all the dictionaries tied to your account along with their unique "Dictionary_no", which you will need as the {id} for using the Data endpoint.
curl -X GET -H "Content-Type: application/json" -H "authorization: <api_key>" "https://api.thedog.io/dictionary"
Each response from the API will be in the following JSON format:
{ "message": "Successful", "skip": 0, "limit": 10, "total": 15, "data": [] }
"message" will either be "Successful" or an error message. "skip" is how many records into the query we skipped, "limit" is how many objects we returned. "total" is the total amount of objects that are available. And "data" is an array of objects containing the results.
Pagination
By default, the results will be paginated in pages of 10 results. To change the amount of results per page (the limit) or the amount of records to skip (the skip) you would add additional URL parameters, beginning with a $ (or %24 when URL encoded)
curl -X GET -H "Content-Type: application/json" -H "authorization: <api_key>" "https://api.thedog.io/dictionary?$limit=2&$skip=6"
or
curl -X GET -H "Content-Type: application/json" -H "authorization: <api_key>" "https://api.thedog.io/dictionary?%24limit=2&%24skip=6"
This will grab two records starting on the 7th record.
Sorting
You can also sort the records by one of the field names by using the following format:
$sort[CreatedOn]=asc (or when URL encoded: %24sort%5BCreatedOn%5D=asc)
curl -X GET -H "Content-Type: application/json" -H "authorization: <api_key>" "https://api.thedog.io/dictionary?$sort[CreatedOn]=asc"
or
curl -X GET -H "Content-Type: application/json" -H "authorization: <api_key>" "https://api.thedog.io/dictionary?%24sort%5BCreatedOn%5D=asc"
You can either use "asc" or "desc" for the direction of the sort.