Posts
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
pagestringOptionalExample:
paging parameter
{{random_page}}onlystringOptionalExample:
Data parameter determine which fields of the post will be returned
id,titlehydratestringOptionalExample:
Data parameter determine which relations of the post will be returned
translationResponses
200
OK
application/json
statusintegerOptional
messagestringOptional
get/posts
GET /api/v5/posts HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200
OK
{
"status": 1,
"message": "text"
}Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
titlestringOptional
contentstringOptional
descriptionstringOptional
typestringOptional
form_idintegerOptional
localestringOptional
completed_stagesstring[]Optional
post_datestringOptional
enabled_languagesobjectOptional
base_languagestringOptional
Responses
201
Created
application/json
countinteger · int32Optional
401
Unauthorized
application/json
422
Unprocessable Entity
application/json
500
Internal Server Error
application/json
post/posts
POST /api/v5/posts HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 1547
{
"title": "test title",
"content": "test description",
"description": "descrition",
"type": "report",
"form_id": 1,
"locale": "en_US",
"post_content": [
{
"id": 1,
"form_id": 1,
"label": "Main",
"priority": 1,
"required": false,
"type": "post",
"show_when_published": true,
"task_is_internal_only": false,
"fields": [
{
"id": 7,
"key": "last_location",
"label": "Last Location",
"input": "text",
"type": "varchar",
"required": false,
"priority": 5,
"cardinality": 1,
"response_private": false,
"form_stage_id": 1,
"translations": [],
"value": {
"value": "Nairobi"
}
},
{
"id": 8,
"key": "last_location_point",
"label": "Last Location (point)",
"input": "location",
"type": "point",
"required": false,
"priority": 5,
"cardinality": 0,
"response_private": false,
"form_stage_id": 1,
"translations": [],
"value": {}
},
{
"id": 9,
"key": "geometry_test",
"label": "Geometry test",
"input": "text",
"type": "geometry",
"required": false,
"priority": 5,
"cardinality": 1,
"response_private": false,
"form_stage_id": 1,
"translations": [],
"value": {}
}
],
"translations": []
},
{
"id": 2,
"form_id": 1,
"label": "2nd step",
"priority": 2,
"required": false,
"": "task",
"show_when_published": true,
"task_is_internal_only": false,
"fields": [
{
"id": 13,
"key": "person_status",
"label": "Person Status",
"input": "select",
"type": "varchar",
"required": false,
"priority": 5,
"options": [
"information_sought",
"is_note_author",
"believed_alive",
"believed_missing",
"believed_dead"
],
"cardinality": 0,
"response_private": false,
"form_stage_id": 2,
"translations": [],
"value": {}
}
],
"translations": []
}
],
"completed_stages": [],
"published_to": [],
"post_date": "2022-08-28T11:51:13",
"enabled_languages": {},
"base_language": ""
}{
"results": [
{
"id": 1,
"form_id": 1,
"user_id": "text",
"type": "text",
"title": "text",
"slug": "text",
"content": "text",
"author_email": "text",
"author_realname": "text",
"status": "text",
"published_to": [
"text"
],
"locale": "text",
"created": "text",
"updated": "text",
"post_date": "text",
"categories": [
{
"id": 1,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"role": "text",
"priority": 1,
"created": "text",
"base_language": "text",
"pivot": {
"post_id": 1,
"tag_id": 1
}
}
],
"post_content": [
{
"id": 1,
"form_id": 1,
"label": "text",
"priority": 1,
"required": 1,
"type": "text",
"description": "text",
"show_when_published": true,
"task_is_internal_only": true,
"fields": [
{
"id": 1,
"key": "text",
"label": "text",
"instructions": "text",
"input": "text",
"type": "text",
"required": 1,
"default": "text",
"priority": 1,
"options": [
{
"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": {
"es": {
"tag": "text"
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
}
}
}
],
"cardinality": 1,
"config": [
"text"
],
"form_stage_id": 1,
"response_private": 1,
"description": "text",
"translations": [
"text"
],
"value": {
"id": 1,
"post_id": 1,
"form_attribute_id": 1,
"value": {
"lon": "text",
"lat": "text"
},
"created": "text",
"translations": [
"text"
]
}
}
],
"translations": [
"text"
]
}
],
"completed_stages": [
{
"form_stage_id": 1,
"post_id": 1,
"completed": 1
}
],
"translations": [
"text"
],
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"locks": [
"text"
],
"allowed_privileges": [
"text"
],
"message": {
"id": 1,
"url": "text"
},
"contact": {
"id": 1,
"url": "text"
}
}
],
"count": 1,
"links": {
"first": "text",
"last": "text",
"prev": "text",
"next": "text"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "text",
"per_page": 1,
"to": 1,
"total": 1
}
}Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
idstringRequired
Query parameters
onlystringOptionalExample:
Data parameter determine which fields of the post will be returned
id,titlehaydratestringOptionalExample:
Data parameter determine which relations of the post will be returned
translationsResponses
200
OK
application/json
countinteger · int32Optional
401
Unauthorized
application/json
404
Not Found
application/json
get/posts/{id}
GET /api/v5/posts/{id} HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"results": [
{
"id": 1,
"form_id": 1,
"user_id": "text",
"type": "text",
"title": "text",
"slug": "text",
"content": "text",
"author_email": "text",
"author_realname": "text",
"status": "text",
"published_to": [
"text"
],
"locale": "text",
"created": "text",
"updated": "text",
"post_date": "text",
"categories": [
{
"id": 1,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"role": "text",
"priority": 1,
"created": "text",
"base_language": "text",
"pivot": {
"post_id": 1,
"tag_id": 1
}
}
],
"post_content": [
{
"id": 1,
"form_id": 1,
"label": "text",
"priority": 1,
"required": 1,
"type": "text",
"description": "text",
"show_when_published": true,
"task_is_internal_only": true,
"fields": [
{
"id": 1,
"key": "text",
"label": "text",
"instructions": "text",
"input": "text",
"type": "text",
"required": 1,
"default": "text",
"priority": 1,
"options": [
{
"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": {
"es": {
"tag": "text"
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
}
}
}
],
"cardinality": 1,
"config": [
"text"
],
"form_stage_id": 1,
"response_private": 1,
"description": "text",
"translations": [
"text"
],
"value": {
"id": 1,
"post_id": 1,
"form_attribute_id": 1,
"value": {
"lon": "text",
"lat": "text"
},
"created": "text",
"translations": [
"text"
]
}
}
],
"translations": [
"text"
]
}
],
"completed_stages": [
{
"form_stage_id": 1,
"post_id": 1,
"completed": 1
}
],
"translations": [
"text"
],
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"locks": [
"text"
],
"allowed_privileges": [
"text"
],
"message": {
"id": 1,
"url": "text"
},
"contact": {
"id": 1,
"url": "text"
}
}
],
"count": 1,
"links": {
"first": "text",
"last": "text",
"prev": "text",
"next": "text"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "text",
"per_page": 1,
"to": 1,
"total": 1
}
}Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
idstringRequired
Body
titlestringOptional
contentstringOptional
descriptionstringOptional
typestringOptional
form_idintegerOptional
localestringOptional
completed_stagesstring[]Optional
post_datestringOptional
enabled_languagesobjectOptional
base_languagestringOptional
Responses
200
OK
application/json
countinteger · int32Optional
500
Internal Server Error
application/json
put/posts/{id}
PUT /api/v5/posts/{id} HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 1327
{
"title": "test title 2",
"content": "test description",
"description": "descrition",
"type": "report",
"form_id": 1,
"locale": "en_US",
"post_content": [
{
"id": 1,
"form_id": 1,
"label": "Main",
"priority": 1,
"required": false,
"type": "post",
"show_when_published": true,
"task_is_internal_only": false,
"fields": [
{
"id": 8,
"key": "last_location_point",
"label": "Last Location (point)",
"input": "location",
"type": "point",
"required": false,
"priority": 5,
"cardinality": 0,
"response_private": false,
"form_stage_id": 1,
"translations": [],
"value": {}
},
{
"id": 9,
"key": "geometry_test",
"label": "Geometry test",
"input": "text",
"type": "geometry",
"required": false,
"priority": 5,
"cardinality": 1,
"response_private": false,
"form_stage_id": 1,
"translations": [],
"value": {}
}
],
"translations": []
},
{
"id": 2,
"form_id": 1,
"label": "2nd step",
"priority": 2,
"required": false,
"": "task",
"show_when_published": true,
"task_is_internal_only": false,
"fields": [
{
"id": 13,
"key": "person_status",
"label": "Person Status",
"input": "select",
"type": "varchar",
"required": false,
"priority": 5,
"options": [
"information_sought",
"is_note_author",
"believed_alive",
"believed_missing",
"believed_dead"
],
"cardinality": 0,
"response_private": false,
"form_stage_id": 2,
"translations": [],
"value": {}
}
],
"translations": []
}
],
"completed_stages": [],
"published_to": [],
"post_date": "2022-12-28T11:51:13",
"enabled_languages": {},
"base_language": ""
}{
"results": [
{
"id": 1,
"form_id": 1,
"user_id": "text",
"type": "text",
"title": "text",
"slug": "text",
"content": "text",
"author_email": "text",
"author_realname": "text",
"status": "text",
"published_to": [
"text"
],
"locale": "text",
"created": "text",
"updated": "text",
"post_date": "text",
"categories": [
{
"id": 1,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"role": "text",
"priority": 1,
"created": "text",
"base_language": "text",
"pivot": {
"post_id": 1,
"tag_id": 1
}
}
],
"post_content": [
{
"id": 1,
"form_id": 1,
"label": "text",
"priority": 1,
"required": 1,
"type": "text",
"description": "text",
"show_when_published": true,
"task_is_internal_only": true,
"fields": [
{
"id": 1,
"key": "text",
"label": "text",
"instructions": "text",
"input": "text",
"type": "text",
"required": 1,
"default": "text",
"priority": 1,
"options": [
{
"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": {
"es": {
"tag": "text"
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
}
}
}
],
"cardinality": 1,
"config": [
"text"
],
"form_stage_id": 1,
"response_private": 1,
"description": "text",
"translations": [
"text"
],
"value": {
"id": 1,
"post_id": 1,
"form_attribute_id": 1,
"value": {
"lon": "text",
"lat": "text"
},
"created": "text",
"translations": [
"text"
]
}
}
],
"translations": [
"text"
]
}
],
"completed_stages": [
{
"form_stage_id": 1,
"post_id": 1,
"completed": 1
}
],
"translations": [
"text"
],
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"locks": [
"text"
],
"allowed_privileges": [
"text"
],
"message": {
"id": 1,
"url": "text"
},
"contact": {
"id": 1,
"url": "text"
}
}
],
"count": 1,
"links": {
"first": "text",
"last": "text",
"prev": "text",
"next": "text"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "text",
"per_page": 1,
"to": 1,
"total": 1
}
}Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
idstringRequired
Responses
200
OK
application/json
403
Forbidden
application/json
delete/posts/{id}
DELETE /api/v5/posts/{id} HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"result": {
"deleted": 96
}
}Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
idstringRequired
Body
titlestringOptional
contentstringOptional
descriptionstringOptional
typestringOptional
form_idintegerOptional
localestringOptional
completed_stagesstring[]Optional
post_datestringOptional
enabled_languagesobjectOptional
base_languagestringOptional
Responses
200
OK
application/json
countinteger · int32Optional
422
Unprocessable Entity
application/json
patch/posts/{id}
PATCH /api/v5/posts/{id} HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 18
{
"status": "draft"
}{
"results": [
{
"id": 1,
"form_id": 1,
"user_id": "text",
"type": "text",
"title": "text",
"slug": "text",
"content": "text",
"author_email": "text",
"author_realname": "text",
"status": "text",
"published_to": [
"text"
],
"locale": "text",
"created": "text",
"updated": "text",
"post_date": "text",
"categories": [
{
"id": 1,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"role": "text",
"priority": 1,
"created": "text",
"base_language": "text",
"pivot": {
"post_id": 1,
"tag_id": 1
}
}
],
"post_content": [
{
"id": 1,
"form_id": 1,
"label": "text",
"priority": 1,
"required": 1,
"type": "text",
"description": "text",
"show_when_published": true,
"task_is_internal_only": true,
"fields": [
{
"id": 1,
"key": "text",
"label": "text",
"instructions": "text",
"input": "text",
"type": "text",
"required": 1,
"default": "text",
"priority": 1,
"options": [
{
"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": {
"es": {
"tag": "text"
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
}
}
}
],
"cardinality": 1,
"config": [
"text"
],
"form_stage_id": 1,
"response_private": 1,
"description": "text",
"translations": [
"text"
],
"value": {
"id": 1,
"post_id": 1,
"form_attribute_id": 1,
"value": {
"lon": "text",
"lat": "text"
},
"created": "text",
"translations": [
"text"
]
}
}
],
"translations": [
"text"
]
}
],
"completed_stages": [
{
"form_stage_id": 1,
"post_id": 1,
"completed": 1
}
],
"translations": [
"text"
],
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"locks": [
"text"
],
"allowed_privileges": [
"text"
],
"message": {
"id": 1,
"url": "text"
},
"contact": {
"id": 1,
"url": "text"
}
}
],
"count": 1,
"links": {
"first": "text",
"last": "text",
"prev": "text",
"next": "text"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "text",
"per_page": 1,
"to": 1,
"total": 1
}
}Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
titlestringOptional
contentstringOptional
descriptionstringOptional
typestringOptional
form_idintegerOptional
localestringOptional
completed_stagesstring[]Optional
post_datestringOptional
enabled_languagesobjectOptional
base_languagestringOptional
Responses
200
OK
application/json
countinteger · int32Optional
422
Unprocessable Entity
application/json
post/posts/bulk
POST /api/v5/posts/bulk HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 819
{
"operation": "patch",
"items": [
{
"id": 10006,
"user_id": 2,
"form_id": 1,
"type": "report",
"author_email": "admin@ushahidi.com",
"author_realname": "Admin",
"status": "published",
"created": "2022-09-02T11:52:01+00:00",
"locale": "en_us",
"values": {
"test_point": [
{
"lon": 28.410584460421,
"lat": 7.2229816056086
}
],
"last_location": [
"Nairobi"
]
},
"post_date": "2022-09-02T11:51:13+00:00",
"tags": [],
"published_to": [],
"completed_stages": [],
"sets": [
"1"
]
},
{
"id": 10005,
"user_id": 2,
"form_id": 1,
"type": "report",
"author_email": "admin@ushahidi.com",
"author_realname": "Admin",
"status": "published",
"created": "2022-09-02T11:52:01+00:00",
"locale": "en_us",
"values": {
"test_point": [
{
"lon": 28.410584460421,
"lat": 7.2229816056086
}
],
"last_location": [
"Nairobi"
]
},
"post_date": "2022-09-02T11:51:13+00:00",
"tags": [],
"published_to": [],
"completed_stages": [],
"sets": [
"1"
]
}
]
}{
"status": "completed"
}