/categories
Retrieves a list of categories or creates a new one.
Adress: https://instance_name/api/v1.5/categories/
Methods:
- GET — list brands;
- POST — create brand.
Content-type: application/json
- GET
- POST
Request body parameters
limit
integer
Number of results to return per page.
offset
integer
The initial index from which to return the results.
Request example
curl –i –X GET
https://test.inspector-cloud.com/api/v1.5/categories/
-H ‘Authorization: Token <<your_token>>’
-F "limit=2" \
-F "offset=0"
Response example
{
"count": 2,
"next": "http://example.com",
"previous": http://example.com,
"results": [
{
"id": 3155,
"name": "GROUND COFFEE"
},
{
"id": 47,
"name": "HAIR CARE"
},
]
}
Response definitions
count
integer
next
string (uri) Nullable
Next page.
previous
string (uri) Nullable
Previous page.
results
Array of objects
Required. Array of objects with information about categories.
id
string
Category ID.
name
string
Category name.
Request body parameters
id
string
Category ID.
name
string
Category name.
Request example
curl –i –X POST
https://test.inspector-cloud.com/api/v1.5/categories/
-H ‘Authorization: Token <<your_token>>’
-F "id=1234567890" \
-F "name=Washing powder"
Response example
Response code: 201