OK
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v5/posts', {
method: 'GET',
headers: {},
});
const data = await response.json();
{
"status": 0,
"message": "text"
}
OK
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v5/posts/{id}', {
method: 'DELETE',
headers: {},
});
const data = await response.json();
{
"result": {
"deleted": 0
}
}
OK
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v5/posts/bulk', {
method: 'POST',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"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"
]
}
]
}),
});
const data = await response.json();
{
"results": [
{
"id": 0,
"form_id": 0,
"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": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"role": "text",
"priority": 0,
"created": "text",
"base_language": "text",
"pivot": {
"post_id": 0,
"tag_id": 0
}
}
],
"post_content": [
{
"id": 0,
"form_id": 0,
"label": "text",
"priority": 0,
"required": 0,
"type": "text",
"description": "text",
"show_when_published": false,
"task_is_internal_only": false,
"fields": [
{
"id": 0,
"key": "text",
"label": "text",
"instructions": "text",
"input": "text",
"type": "text",
"required": 0,
"default": "text",
"priority": 0,
"options": [
{
"id": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"children": [
{
"id": 0,
"parent_id": 0,
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"children": [
"text"
],
"parent": {
"id": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"translations": {
"es": {
"tag": "text"
},
"enabled_languages": {
"es": {
"tag": "text"
}
}
}
}
],
"parent": {
"id": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
}
}
}
],
"cardinality": 0,
"config": [
"text"
],
"form_stage_id": 0,
"response_private": 0,
"description": "text",
"translations": [
"text"
],
"value": {
"id": 0,
"post_id": 0,
"form_attribute_id": 0,
"value": {
"lon": "text",
"lat": "text"
},
"created": "text",
"translations": [
"text"
]
}
}
],
"translations": [
"text"
]
}
],
"completed_stages": [
{
"form_stage_id": 0,
"post_id": 0,
"completed": 0
}
],
"translations": [
"text"
],
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"locks": [
"text"
],
"allowed_privileges": [
"text"
],
"message": {
"id": 0,
"url": "text"
},
"contact": {
"id": 0,
"url": "text"
}
}
],
"count": 0,
"links": {
"first": "text",
"last": "text",
"prev": "text",
"next": "text"
},
"meta": {
"current_page": 0,
"from": 0,
"last_page": 0,
"path": "text",
"per_page": 0,
"to": 0,
"total": 0
}
}
OK
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v5/posts/{id}', {
method: 'PATCH',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"status": "draft"
}),
});
const data = await response.json();
{
"results": [
{
"id": 0,
"form_id": 0,
"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": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"role": "text",
"priority": 0,
"created": "text",
"base_language": "text",
"pivot": {
"post_id": 0,
"tag_id": 0
}
}
],
"post_content": [
{
"id": 0,
"form_id": 0,
"label": "text",
"priority": 0,
"required": 0,
"type": "text",
"description": "text",
"show_when_published": false,
"task_is_internal_only": false,
"fields": [
{
"id": 0,
"key": "text",
"label": "text",
"instructions": "text",
"input": "text",
"type": "text",
"required": 0,
"default": "text",
"priority": 0,
"options": [
{
"id": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"children": [
{
"id": 0,
"parent_id": 0,
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"children": [
"text"
],
"parent": {
"id": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"translations": {
"es": {
"tag": "text"
},
"enabled_languages": {
"es": {
"tag": "text"
}
}
}
}
],
"parent": {
"id": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
}
}
}
],
"cardinality": 0,
"config": [
"text"
],
"form_stage_id": 0,
"response_private": 0,
"description": "text",
"translations": [
"text"
],
"value": {
"id": 0,
"post_id": 0,
"form_attribute_id": 0,
"value": {
"lon": "text",
"lat": "text"
},
"created": "text",
"translations": [
"text"
]
}
}
],
"translations": [
"text"
]
}
],
"completed_stages": [
{
"form_stage_id": 0,
"post_id": 0,
"completed": 0
}
],
"translations": [
"text"
],
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"locks": [
"text"
],
"allowed_privileges": [
"text"
],
"message": {
"id": 0,
"url": "text"
},
"contact": {
"id": 0,
"url": "text"
}
}
],
"count": 0,
"links": {
"first": "text",
"last": "text",
"prev": "text",
"next": "text"
},
"meta": {
"current_page": 0,
"from": 0,
"last_page": 0,
"path": "text",
"per_page": 0,
"to": 0,
"total": 0
}
}
OK
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v5/posts/{id}', {
method: 'PUT',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"title": "test title 2",
"content": "test description",
"description": "<p>descrition</p>",
"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": "",
"__$markdownParsed": true
}),
});
const data = await response.json();
{
"results": [
{
"id": 0,
"form_id": 0,
"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": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"role": "text",
"priority": 0,
"created": "text",
"base_language": "text",
"pivot": {
"post_id": 0,
"tag_id": 0
}
}
],
"post_content": [
{
"id": 0,
"form_id": 0,
"label": "text",
"priority": 0,
"required": 0,
"type": "text",
"description": "text",
"show_when_published": false,
"task_is_internal_only": false,
"fields": [
{
"id": 0,
"key": "text",
"label": "text",
"instructions": "text",
"input": "text",
"type": "text",
"required": 0,
"default": "text",
"priority": 0,
"options": [
{
"id": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"children": [
{
"id": 0,
"parent_id": 0,
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"children": [
"text"
],
"parent": {
"id": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"translations": {
"es": {
"tag": "text"
},
"enabled_languages": {
"es": {
"tag": "text"
}
}
}
}
],
"parent": {
"id": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
}
}
}
],
"cardinality": 0,
"config": [
"text"
],
"form_stage_id": 0,
"response_private": 0,
"description": "text",
"translations": [
"text"
],
"value": {
"id": 0,
"post_id": 0,
"form_attribute_id": 0,
"value": {
"lon": "text",
"lat": "text"
},
"created": "text",
"translations": [
"text"
]
}
}
],
"translations": [
"text"
]
}
],
"completed_stages": [
{
"form_stage_id": 0,
"post_id": 0,
"completed": 0
}
],
"translations": [
"text"
],
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"locks": [
"text"
],
"allowed_privileges": [
"text"
],
"message": {
"id": 0,
"url": "text"
},
"contact": {
"id": 0,
"url": "text"
}
}
],
"count": 0,
"links": {
"first": "text",
"last": "text",
"prev": "text",
"next": "text"
},
"meta": {
"current_page": 0,
"from": 0,
"last_page": 0,
"path": "text",
"per_page": 0,
"to": 0,
"total": 0
}
}
Created
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v5/posts', {
method: 'POST',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"title": "test title",
"content": "test description",
"description": "<p>descrition</p>",
"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": "",
"__$markdownParsed": true
}),
});
const data = await response.json();
{
"results": [
{
"id": 0,
"form_id": 0,
"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": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"role": "text",
"priority": 0,
"created": "text",
"base_language": "text",
"pivot": {
"post_id": 0,
"tag_id": 0
}
}
],
"post_content": [
{
"id": 0,
"form_id": 0,
"label": "text",
"priority": 0,
"required": 0,
"type": "text",
"description": "text",
"show_when_published": false,
"task_is_internal_only": false,
"fields": [
{
"id": 0,
"key": "text",
"label": "text",
"instructions": "text",
"input": "text",
"type": "text",
"required": 0,
"default": "text",
"priority": 0,
"options": [
{
"id": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"children": [
{
"id": 0,
"parent_id": 0,
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"children": [
"text"
],
"parent": {
"id": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"translations": {
"es": {
"tag": "text"
},
"enabled_languages": {
"es": {
"tag": "text"
}
}
}
}
],
"parent": {
"id": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
}
}
}
],
"cardinality": 0,
"config": [
"text"
],
"form_stage_id": 0,
"response_private": 0,
"description": "text",
"translations": [
"text"
],
"value": {
"id": 0,
"post_id": 0,
"form_attribute_id": 0,
"value": {
"lon": "text",
"lat": "text"
},
"created": "text",
"translations": [
"text"
]
}
}
],
"translations": [
"text"
]
}
],
"completed_stages": [
{
"form_stage_id": 0,
"post_id": 0,
"completed": 0
}
],
"translations": [
"text"
],
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"locks": [
"text"
],
"allowed_privileges": [
"text"
],
"message": {
"id": 0,
"url": "text"
},
"contact": {
"id": 0,
"url": "text"
}
}
],
"count": 0,
"links": {
"first": "text",
"last": "text",
"prev": "text",
"next": "text"
},
"meta": {
"current_page": 0,
"from": 0,
"last_page": 0,
"path": "text",
"per_page": 0,
"to": 0,
"total": 0
}
}
OK
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v5/posts/{id}', {
method: 'GET',
headers: {},
});
const data = await response.json();
{
"results": [
{
"id": 0,
"form_id": 0,
"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": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"role": "text",
"priority": 0,
"created": "text",
"base_language": "text",
"pivot": {
"post_id": 0,
"tag_id": 0
}
}
],
"post_content": [
{
"id": 0,
"form_id": 0,
"label": "text",
"priority": 0,
"required": 0,
"type": "text",
"description": "text",
"show_when_published": false,
"task_is_internal_only": false,
"fields": [
{
"id": 0,
"key": "text",
"label": "text",
"instructions": "text",
"input": "text",
"type": "text",
"required": 0,
"default": "text",
"priority": 0,
"options": [
{
"id": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"children": [
{
"id": 0,
"parent_id": 0,
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"children": [
"text"
],
"parent": {
"id": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"translations": {
"es": {
"tag": "text"
},
"enabled_languages": {
"es": {
"tag": "text"
}
}
}
}
],
"parent": {
"id": 0,
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"priority": 0,
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
}
}
}
],
"cardinality": 0,
"config": [
"text"
],
"form_stage_id": 0,
"response_private": 0,
"description": "text",
"translations": [
"text"
],
"value": {
"id": 0,
"post_id": 0,
"form_attribute_id": 0,
"value": {
"lon": "text",
"lat": "text"
},
"created": "text",
"translations": [
"text"
]
}
}
],
"translations": [
"text"
]
}
],
"completed_stages": [
{
"form_stage_id": 0,
"post_id": 0,
"completed": 0
}
],
"translations": [
"text"
],
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"locks": [
"text"
],
"allowed_privileges": [
"text"
],
"message": {
"id": 0,
"url": "text"
},
"contact": {
"id": 0,
"url": "text"
}
}
],
"count": 0,
"links": {
"first": "text",
"last": "text",
"prev": "text",
"next": "text"
},
"meta": {
"current_page": 0,
"from": 0,
"last_page": 0,
"path": "text",
"per_page": 0,
"to": 0,
"total": 0
}
}