OK
OK
OK
OK
OK
Created
OK
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v5/posts', {
method: 'GET',
headers: {},
});
const data = await response.json();
{
"message": "text"
}
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v5/posts/{id}', {
method: 'DELETE',
headers: {},
});
const data = await response.json();
{
"result": {}
}
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": [
{
"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": [
{
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"role": "text",
"created": "text",
"base_language": "text",
"pivot": {}
}
],
"post_content": [
{
"label": "text",
"type": "text",
"description": "text",
"show_when_published": false,
"task_is_internal_only": false,
"fields": [
{
"key": "text",
"label": "text",
"instructions": "text",
"input": "text",
"type": "text",
"default": "text",
"options": [
{
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"children": [
{
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"children": [
"text"
],
"parent": {
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"translations": {
"es": {
"tag": "text"
},
"enabled_languages": {
"es": {
"tag": "text"
}
}
}
}
],
"parent": {
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
}
}
}
],
"config": [
"text"
],
"description": "text",
"translations": [
"text"
],
"value": {
"value": {
"lon": "text",
"lat": "text"
},
"created": "text",
"translations": [
"text"
]
}
}
],
"translations": [
"text"
]
}
],
"completed_stages": [
{}
],
"translations": [
"text"
],
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"locks": [
"text"
],
"allowed_privileges": [
"text"
],
"message": {
"url": "text"
},
"contact": {
"url": "text"
}
}
],
"links": {
"first": "text",
"last": "text",
"prev": "text",
"next": "text"
},
"meta": {
"path": "text"
}
}
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": [
{
"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": [
{
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"role": "text",
"created": "text",
"base_language": "text",
"pivot": {}
}
],
"post_content": [
{
"label": "text",
"type": "text",
"description": "text",
"show_when_published": false,
"task_is_internal_only": false,
"fields": [
{
"key": "text",
"label": "text",
"instructions": "text",
"input": "text",
"type": "text",
"default": "text",
"options": [
{
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"children": [
{
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"children": [
"text"
],
"parent": {
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"translations": {
"es": {
"tag": "text"
},
"enabled_languages": {
"es": {
"tag": "text"
}
}
}
}
],
"parent": {
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
}
}
}
],
"config": [
"text"
],
"description": "text",
"translations": [
"text"
],
"value": {
"value": {
"lon": "text",
"lat": "text"
},
"created": "text",
"translations": [
"text"
]
}
}
],
"translations": [
"text"
]
}
],
"completed_stages": [
{}
],
"translations": [
"text"
],
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"locks": [
"text"
],
"allowed_privileges": [
"text"
],
"message": {
"url": "text"
},
"contact": {
"url": "text"
}
}
],
"links": {
"first": "text",
"last": "text",
"prev": "text",
"next": "text"
},
"meta": {
"path": "text"
}
}
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": [
{
"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": [
{
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"role": "text",
"created": "text",
"base_language": "text",
"pivot": {}
}
],
"post_content": [
{
"label": "text",
"type": "text",
"description": "text",
"show_when_published": false,
"task_is_internal_only": false,
"fields": [
{
"key": "text",
"label": "text",
"instructions": "text",
"input": "text",
"type": "text",
"default": "text",
"options": [
{
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"children": [
{
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"children": [
"text"
],
"parent": {
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"translations": {
"es": {
"tag": "text"
},
"enabled_languages": {
"es": {
"tag": "text"
}
}
}
}
],
"parent": {
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
}
}
}
],
"config": [
"text"
],
"description": "text",
"translations": [
"text"
],
"value": {
"value": {
"lon": "text",
"lat": "text"
},
"created": "text",
"translations": [
"text"
]
}
}
],
"translations": [
"text"
]
}
],
"completed_stages": [
{}
],
"translations": [
"text"
],
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"locks": [
"text"
],
"allowed_privileges": [
"text"
],
"message": {
"url": "text"
},
"contact": {
"url": "text"
}
}
],
"links": {
"first": "text",
"last": "text",
"prev": "text",
"next": "text"
},
"meta": {
"path": "text"
}
}
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": [
{
"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": [
{
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"role": "text",
"created": "text",
"base_language": "text",
"pivot": {}
}
],
"post_content": [
{
"label": "text",
"type": "text",
"description": "text",
"show_when_published": false,
"task_is_internal_only": false,
"fields": [
{
"key": "text",
"label": "text",
"instructions": "text",
"input": "text",
"type": "text",
"default": "text",
"options": [
{
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"children": [
{
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"children": [
"text"
],
"parent": {
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"translations": {
"es": {
"tag": "text"
},
"enabled_languages": {
"es": {
"tag": "text"
}
}
}
}
],
"parent": {
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
}
}
}
],
"config": [
"text"
],
"description": "text",
"translations": [
"text"
],
"value": {
"value": {
"lon": "text",
"lat": "text"
},
"created": "text",
"translations": [
"text"
]
}
}
],
"translations": [
"text"
]
}
],
"completed_stages": [
{}
],
"translations": [
"text"
],
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"locks": [
"text"
],
"allowed_privileges": [
"text"
],
"message": {
"url": "text"
},
"contact": {
"url": "text"
}
}
],
"links": {
"first": "text",
"last": "text",
"prev": "text",
"next": "text"
},
"meta": {
"path": "text"
}
}
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v5/posts/{id}', {
method: 'GET',
headers: {},
});
const data = await response.json();
{
"results": [
{
"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": [
{
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"role": "text",
"created": "text",
"base_language": "text",
"pivot": {}
}
],
"post_content": [
{
"label": "text",
"type": "text",
"description": "text",
"show_when_published": false,
"task_is_internal_only": false,
"fields": [
{
"key": "text",
"label": "text",
"instructions": "text",
"input": "text",
"type": "text",
"default": "text",
"options": [
{
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"children": [
{
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"children": [
"text"
],
"parent": {
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"translations": {
"es": {
"tag": "text"
},
"enabled_languages": {
"es": {
"tag": "text"
}
}
}
}
],
"parent": {
"parent_id": "text",
"tag": "text",
"slug": "text",
"type": "text",
"color": "text",
"icon": "text",
"description": "text",
"role": "text",
"parent": "text",
"translations": {
"es": {
"tag": "text"
}
},
"enabled_languages": {
"default": "text",
"available": [
"text"
]
}
}
}
],
"config": [
"text"
],
"description": "text",
"translations": [
"text"
],
"value": {
"value": {
"lon": "text",
"lat": "text"
},
"created": "text",
"translations": [
"text"
]
}
}
],
"translations": [
"text"
]
}
],
"completed_stages": [
{}
],
"translations": [
"text"
],
"enabled_languages": {
"default": "text",
"available": [
"text"
]
},
"locks": [
"text"
],
"allowed_privileges": [
"text"
],
"message": {
"url": "text"
},
"contact": {
"url": "text"
}
}
],
"links": {
"first": "text",
"last": "text",
"prev": "text",
"next": "text"
},
"meta": {
"path": "text"
}
}