curl -L \
--url 'https://ushahididocs.api.ushahidi.io/api/v5/categories/100' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
"result": {
"id": 6,
"tag": "Done",
"slug": "done",
"type": "status",
"icon": "tag",
"priority": 0,
"children": [],
"translations": {
"es": {
"tag": "Done - ES"
}
},
"enabled_languages": {
"default": "",
"available": [
"es"
]
}
}
}
OK
id,name
curl -L \
--url 'https://ushahididocs.api.ushahidi.io/api/v5/categories' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
"results": [
{
"id": 1,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": [
"text"
],
"priority": 1,
"children": [
{
"id": 1,
"parent_id": 1,
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 1,
"children": [
"text"
],
"parent": {
"id": 1,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 1,
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"translations": {
"es": {
"tag": "text"
},
"enabled_languages": {
"es": {
"tag": "text"
}
}
}
}
],
"parent": {
"id": 1,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 1,
"parent": "text",
"translations": [
"text"
],
"enabled_languages": {
"default": "text",
"available": [
"text"
]
}
},
"translations": {
"es": {
"tag": "text"
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
}
}
]
}
OK
curl -L \
--request POST \
--url 'https://ushahididocs.api.ushahidi.io/api/v5/categories' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"base_language": "22",
"type": "category",
"icon": "tag",
"color": "",
"parent_id": 5,
"translations": {},
"tag": "test243",
"slug": "test243"
}'
{
"result": {
"id": 21,
"tag": "test2",
"slug": "test2",
"type": "category",
"color": "",
"icon": "tag",
"children": [],
"translations": [],
"enabled_languages": {
"default": "en-US",
"available": []
}
}
}
Created
curl -L \
--request PUT \
--url 'https://ushahididocs.api.ushahidi.io/api/v5/categories/70' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"base_language": "22",
"type": "category",
"icon": "tag",
"color": "",
"parent_id": 5,
"translations": {},
"tag": "test2458",
"slug": "test2436"
}'
{
"result": {
"id": 7,
"parent_id": 5,
"tag": "test2458",
"slug": "role-control",
"type": "category",
"color": "",
"icon": "tag",
"role": [
"admin"
],
"priority": 0,
"children": [],
"parent": {
"id": 5,
"tag": "Todo",
"slug": "todo",
"type": "status",
"icon": "tag",
"priority": 0,
"translations": {
"es": {
"tag": "Todo - ES"
}
},
"enabled_languages": {
"default": "",
"available": [
"es"
]
}
},
"translations": {
"es": {
"tag": "Role Control - ES"
}
},
"enabled_languages": {
"default": "22",
"available": [
"es"
]
}
}
}
OK