Category
CRUD
| CRUD | Http Verb | Route | Description |
|---|---|---|---|
| READ | GET | /category/{id} | Retrieve a single Category from it's id |
| CREATE | POST | /category | Create a Category |
| UPDATE | POST | /category/{id} | Update a Category |
| DELETE | DELETE | /category/{id} | Delete a Category |
| SEARCH | GET | /category | Looking for Categories |
| BATCH DELETE | DELETE | /category | Delete multiple Categories |
Model
WARNING: This Model is the one retrieve using X-API-MODE="get" (see READ & SEARCH operations). So if you use the legacy one (standard), the model may differs on some fields.
| Field | Type | Readonly | Nullable | Translatable | Description |
|---|---|---|---|---|---|
| children | array | List of children Categories | |||
| children[] | array | ||||
| children[].id | Category#id | Child Category identifier | |||
| children[].position | int | Child Category position used to sort children. The sorting order is descending regarless position, in case of equals positions lower identifier will come first. | |||
| client_id | string | An arbitrary field used to store external identfier to match our own | |||
| color | string | Color in HTML form such as "#ffffff" | |||
| created_at | datetime(ISO 8601) | Create datetime | |||
| id | int | Identifier | |||
| logo | File#id | File identifier that contains the logo image. | |||
| metadata | array | An array of metadatum used to store additional arbitrary data | |||
| metadata[] | array | ||||
| metadata[].key | string | Metadatum unique key | |||
| metadata[].type | string | Metadatum value type | |||
| metadata[].value | mixed | Metadatum value | |||
| name | string | Name | |||
| parameters | array | [Depreciated] | |||
| parameters[] | string | ||||
| parents | array | List of parent Categories | |||
| parents[] | Category#id | Parent Category identifier | |||
| pois | array | List of Pois belonging on that Category | |||
| pois[] | Poi#id | Poi identifier | |||
| rank | int | Rank used to sort root Categories (The one without parent). Higher come first. | |||
| signature | string | Unique optional identifier used to reference that Site to be used in data import | |||
| site | Site#id | Site identifier | |||
| tags | array | List of Tags | |||
| tags[] | Tag#id | Tag identifier | |||
| type | string | Type used to store arbitrary role of that Category in client applications. | |||
| version | int | Revision version, it's incremented on each change | |||
| updated_at | datetime(ISO 8601) | Last updated datetime |
READ
Parameters
| Name | In | Type | Required | Default | Constraint | Description |
|---|---|---|---|---|---|---|
| id | Route | int | ||||
| X-API-LOCALE | Header | string | Site#locale | Must be one of Site#languages | ||
| X-API-MODE | Header | string | standard | "standard" or "get" | The "standard" mode is deprecated. Note that X-API-MODE will change serialization format. |
Responses
| Http Code | Description | Response type | Response Content | Note |
|---|---|---|---|---|
| 200 | Success | application/json | Category | The Category serialisation will differs depending on X-API-MODE |
| 400 | Invalid data | application/json | Error | |
| 403 | Authentication Error | application/json | Error | |
| 404 | Not Found | |||
| 500 | Internal Server Error | application/json | Error | |
| 503 | Service Unavailable |
CREATE
Parameters
| Name | In | Type | Nullable | Required | Default | Constraint |
|---|---|---|---|---|---|---|
| X-API-LOCALE | Header | string | Site#locale | Must be one of Site#languages | ||
| children | Data | array | [] | |||
| children[] | Data | array | ||||
| children[].id | Data | Category#id | Valid Category#id on same site | |||
| children[].position | Data | int | ||||
| client_id | Data | string | null | |||
| color | Data | string | null | |||
| logo | Data | File#id | null | Valid File#id on same site | ||
| metadata | Data | array | [] | |||
| metadata[].key | Data | string | ||||
| metadata[].type | Data | string | ||||
| metadata[].value | Data | mixed | ||||
| name | Data | string | Not empty string | |||
| parameters | Data | array | [] | |||
| parameters[] | Data | string | ||||
| parents | Data | array | [] | |||
| parents[] | Data | Category#id | ||||
| pois | Data | array | [] | |||
| pois[] | Data | Poi#id | Valid Poi#id on same site | |||
| rank | Data | int | 0 | |||
| signature | Data | string | null | |||
| site | Data | int | Valid Site#id | |||
| tags | Data | array | [] | |||
| tags[] | Data | Tag#id | Valid Tag#id on same site | |||
| type | Data | string | null |
Responses
| Http Code | Description | Response type | Response Content |
|---|---|---|---|
| 200 | Success | application/json | { id: Category#id } |
| 400 | Invalid data | application/json | Error |
| 403 | Authentication Error | application/json | Error |
| 404 | Not Found | ||
| 500 | Internal Server Error | application/json | Error |
| 503 | Service Unavailable |
UPDATE
Parameters
| Name | In | Type | Nullable | Required | Default | Constraint |
|---|---|---|---|---|---|---|
| id | Route | int | ||||
| X-API-LOCALE | Header | string | Site#locale | Must be one of Site#languages | ||
| children | Data | array | Preserves value | |||
| children[] | Data | array | ||||
| children[].id | Data | Category#id | Valid Category#id on same site | |||
| children[].position | Data | int | ||||
| client_id | Data | string | Preserves value | |||
| color | Data | string | Preserves value | |||
| logo | Data | File#id | Preserves value | Valid File#id on same site | ||
| metadata | Data | array | Preserves value | |||
| metadata[].key | Data | string | ||||
| metadata[].type | Data | string | ||||
| metadata[].value | Data | mixed | ||||
| name | Data | string | Preserves value | Not empty string | ||
| parameters | Data | array | Preserves value | |||
| parameters[] | Data | string | ||||
| parents | Data | array | Preserves value | |||
| parents[] | Data | Category#id | ||||
| pois | Data | array | Preserves value | |||
| pois[] | Data | Poi#id | Valid Poi#id on same site | |||
| rank | Data | int | Preserves value | |||
| signature | Data | string | Preserves value | |||
| site | Data | Site#id | Valid Site#id | |||
| tags | Data | array | Preserves value | |||
| tags[] | Data | Tag#id | Valid Tag#id on same site | |||
| type | Data | string | Preserves value |
Responses
| Http Code | Description | Response type | Response Content |
|---|---|---|---|
| 204 | Success | application/json | |
| 400 | Invalid data | application/json | Error |
| 403 | Authentication Error | application/json | Error |
| 404 | Not Found | ||
| 500 | Internal Server Error | application/json | Error |
| 503 | Service Unavailable |
DELETE
Parameters
| Name | In | Type | Required | Default | Constraint |
|---|---|---|---|---|---|
| id | Route | int |
Responses
| Http Code | Description | Response type | Response Content |
|---|---|---|---|
| 204 | Success | application/json | |
| 400 | Invalid data | application/json | Error |
| 403 | Authentication Error | application/json | Error |
| 404 | Not Found | ||
| 500 | Internal Server Error | application/json | Error |
| 503 | Service Unavailable |
SEARCH
Parameters
| Name | In | Type | Required | Default | Constraint |
|---|---|---|---|---|---|
| X-API-LOCALE | Header | string | Site#locale | Must be one of Site#languages | |
| name | Query | string | |||
| signature | Query | string | |||
| site | Query | int | |||
| type | Query | string |
Responses
| Http Code | Description | Response type | Response Content | Note |
|---|---|---|---|---|
| 200 | Success | application/json | Category[] | The Category serialisation will differs depending on X-API-MODE |
| 400 | Invalid data | application/json | Error | |
| 403 | Authentication Error | application/json | Error | |
| 404 | Not Found | |||
| 500 | Internal Server Error | application/json | Error | |
| 503 | Service Unavailable |
BATCH DELETE
Parameters
| Name | In | Type | Required | Default | Constraint |
|---|---|---|---|---|---|
| site | Query | int | |||
| id | Query | int[] |
Responses
| Http Code | Description | Response type | Response Content |
|---|---|---|---|
| 204 | Success | application/json | |
| 400 | Invalid data | application/json | Error |
| 403 | Authentication Error | application/json | Error |
| 404 | Not Found | ||
| 500 | Internal Server Error | application/json | Error |
| 503 | Service Unavailable |
