Tags
Sorting parameter Available values : entity fields Default value : id
Sorting parameter Available values : [ASC,DESC] !! Default value : ASC "default not working"
Paging parameter Default value : null
Paging parameter Default value : 0
Filter parameter return categories have a tag field exactly same as the value
Filter parameter return categories have a this type
Filter parameter return only parent categories if it has (parent) value
filter paramter return the sub categories of parent
GET /api/v3/tags HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"count": 2,
"results": [
{
"id": 10,
"url": "https://ushahididocs.api.ushahidi.io//api/v3/tags/10",
"parent": {
"id": 9,
"url": "https://ushahididocs.api.ushahidi.io//api/v3/tags/9"
},
"tag": "Child 1",
"slug": "child-one",
"type": "category",
"icon": "tag",
"priority": 0,
"created": "1970-01-01T00:00:00.000Z",
"role": [
"admin"
],
"children": [],
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 11,
"url": "https://ushahididocs.api.ushahidi.io//api/v3/tags/11",
"parent": {
"id": 9,
"url": "https://ushahididocs.api.ushahidi.io//api/v3/tags/9"
},
"tag": "Child 2",
"slug": "child-two",
"type": "category",
"icon": "tag",
"priority": 0,
"created": "1970-01-01T00:00:00.000Z",
"role": [
"admin"
],
"children": [],
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"offset": 0,
"order": "asc",
"orderby": "id",
"curr": "https://ushahididocs.api.ushahidi.io//api/v3/tags?orderby=id&order=asc&offset=0",
"next": "https://ushahididocs.api.ushahidi.io//api/v3/tags?orderby=id&order=asc&offset=0",
"prev": "https://ushahididocs.api.ushahidi.io//api/v3/tags?orderby=id&order=asc&offset=0",
"total_count": 2
}
Add tag
POST
ushahididocs.api.ushahidi.io/api/v3/tags
Request Body
parent_id
integer
Parent identifier for Tag
icon
String
Tag icon name
description
String
Tag description
color
String
Tag color
type
String
Type of tag
tag
String
Tag name
role
Array
Tag role
priority
Integer
Tag priority value
children
Array
An array of other dependent children tag
{
"id": 0,
"url": "string",
"parent_id": "string",
"tag": "string",
"slug": "string",
"type": "string",
"color": "string",
"icon": "string",
"description": "string",
"priority": 0,
"created": "string",
"role": [
"string"
],
"children": [
"string"
],
"allowed_privileges": [
"string"
]
}
Edit tag
PUT
ushahididocs.api.ushahidi.io/api/v3/tags/2
Request Body
parent_id
Integer
Parent identifier for Tag
icon
String
Tag icon name
description
String
Tag description
color
String
Tag color
type
String
Type of tag
tag
String
Tag name
role
Array
Tag role
priority
Integer
Tag priority value
children
Array
An array of other dependent children tag
{
"id": 0,
"url": "string",
"parent_id": "string",
"tag": "string",
"slug": "string",
"type": "string",
"color": "string",
"icon": "string",
"description": "string",
"priority": 0,
"created": "string",
"role": [
"string"
],
"children": [
"string"
],
"allowed_privileges": [
"string"
]
}
GET /api/v3/tags/5 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": 1,
"url": "https://ushahididocs.api.ushahidi.io//api/v3/tags/1",
"tag": "Test tag",
"slug": "test-tag",
"type": "category",
"icon": "tag",
"priority": 0,
"created": "1970-01-01T00:00:00.000Z",
"role": [
"admin",
"user"
],
"children": [],
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
DELETE /api/v3/tags/5 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": 5,
"url": "https://ushahididocs.api.ushahidi.io//api/v3/tags/5",
"tag": "Todo",
"slug": "todo",
"type": "status",
"icon": "tag",
"priority": 0,
"created": "1970-01-01T00:00:00.000Z",
"children": [
{
"id": 7,
"url": "https://ushahididocs.api.ushahidi.io//api/v3/tags/7"
},
{
"id": 23,
"url": "https://ushahididocs.api.ushahidi.io//api/v3/tags/23"
}
],
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}