POST
https://ushahididocs.api.ushahidi.io/api/v3/forms
type
String
Form type
parent_id
String
The user's parent identifier
hide_time
String
Set True to hide the time and Flase to make the time visible
color
String
Form color
hide_location
String
Set True to hide the location and Flase to make the location visible
updated
String
require_approval
String
Set True to require form approval and Flase to not
targeted_survey
String
Set True to enable targeted survey and false to disable targeted survey
disabled
Boolean
Set True to disable the form and false to enable the form
everyone_can_create
String
Set True to allow everyone to create form and False to not
description
String
Form description
name
String
Form name
hide_author
Boolean
Set True to hide the author and Flase to make the author visible
{
"id": 11,
"url": "http://localhost:8000/api/v3/forms/11",
"parent_id": null,
"name": "Test Form",
"description": "Testing form",
"color": null,
"type": "report",
"disabled": false,
"created": "2022-11-03T11:24:37+00:00",
"updated": null,
"hide_author": false,
"hide_time": false,
"hide_location": false,
"require_approval": false,
"everyone_can_create": true,
"targeted_survey": false,
"can_create": [],
"tags": [],
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
PUT
https://ushahididocs.api.ushahidi.io/api/v3/forms/9
type
String
Form type
parent_id
String
The user's parent identifier
hide_time
String
Set True to hide the time and Flase to make the time visible
color
String
Form color
hide_location
String
Set True to hide the location and Flase to make the location visible
updated
String
require_approval
String
Set True to require form approval and Flase to not
targeted_survey
String
Set True to enable targeted survey and false to disable targeted survey
disabled
Boolean
Set True to disable the form and false to enable the form
everyone_can_create
String
Set True to allow everyone to create form and False to not
description
String
Form description
name
String
Form name
hide_author
Boolean
Set True to hide the author and Flase to make the author visible
{
"id": 11,
"url": "http://localhost:8000/api/v3/forms/11",
"parent_id": null,
"name": "Test Form",
"description": "Testing form",
"color": null,
"type": "report",
"disabled": false,
"created": "2022-11-03T11:24:37+00:00",
"updated": null,
"hide_author": false,
"hide_time": false,
"hide_location": false,
"require_approval": false,
"everyone_can_create": true,
"targeted_survey": false,
"can_create": [],
"tags": [],
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Sorting parameter Available values : entity fields Default value : id
id
Sorting parameter Available values : [ASC,DESC] !! Default value : ASC "default not working"
Desc
Paging parameter Default value : null
2
Paging parameter Default value : 0
3
Filter parameter like name
test
Filter parameter check the parent id value
1
GET /api/v3/forms HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"count": 2,
"results": [
{
"id": 1,
"url": "http://localhost:8000/api/v3/forms/1",
"name": "Test Form",
"description": "Testing form",
"type": "report",
"disabled": false,
"created": "1970-01-01T00:00:00+00:00",
"hide_author": false,
"hide_time": false,
"hide_location": false,
"require_approval": false,
"everyone_can_create": true,
"targeted_survey": false,
"can_create": [],
"tags": [
{
"id": 1,
"url": "http://localhost:8000/api/v3/tags/1"
},
{
"id": 2,
"url": "http://localhost:8000/api/v3/tags/2"
},
{
"id": 3,
"url": "http://localhost:8000/api/v3/tags/3"
},
{
"id": 4,
"url": "http://localhost:8000/api/v3/tags/4"
},
{
"id": 5,
"url": "http://localhost:8000/api/v3/tags/5"
},
{
"id": 6,
"url": "http://localhost:8000/api/v3/tags/6"
},
{
"id": 7,
"url": "http://localhost:8000/api/v3/tags/7"
}
],
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 2,
"url": "http://localhost:8000/api/v3/forms/2",
"name": "Test Form",
"description": "Testing form",
"type": "report",
"disabled": false,
"created": "1970-01-01T00:00:00+00:00",
"updated": "2022-11-03T18:02:11+00:00",
"hide_author": false,
"hide_time": false,
"hide_location": false,
"require_approval": false,
"everyone_can_create": true,
"targeted_survey": false,
"can_create": [
"user"
],
"tags": [],
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"limit": "2",
"offset": 0,
"order": "asc",
"orderby": "id",
"curr": "http://localhost:8000/api/v3/forms?orderby=id&order=asc&limit=2&offset=0",
"next": "http://localhost:8000/api/v3/forms?orderby=id&order=asc&limit=2&offset=2",
"prev": "http://localhost:8000/api/v3/forms?orderby=id&order=asc&limit=2&offset=0",
"total_count": 12
}
GET /api/v3/forms/9 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": 1,
"url": "https://ushahididocs.api.ushahidi.io//api/v3/forms/1",
"name": "Basic Post",
"description": "Post with a location",
"type": "report",
"disabled": false,
"created": "2022-05-30T14:10:27+00:00",
"hide_author": false,
"hide_time": false,
"hide_location": false,
"require_approval": true,
"everyone_can_create": true,
"targeted_survey": false,
"can_create": [],
"tags": [],
"allowed_privileges": [
"read",
"search"
]
}
DELETE /api/v3/forms/1 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": 10,
"url": "http://localhost:8000/api/v3/forms/10",
"name": "Survey with a category field",
"description": "Survey with a category field to test permissions",
"type": "report",
"disabled": false,
"created": "1970-01-01T00:00:00+00:00",
"hide_author": false,
"hide_time": false,
"hide_location": false,
"require_approval": false,
"everyone_can_create": true,
"targeted_survey": false,
"can_create": [],
"tags": [
{
"id": 12,
"url": "http://localhost:8000/api/v3/tags/12"
},
{
"id": 13,
"url": "http://localhost:8000/api/v3/tags/13"
},
{
"id": 14,
"url": "http://localhost:8000/api/v3/tags/14"
},
{
"id": 15,
"url": "http://localhost:8000/api/v3/tags/15"
},
{
"id": 16,
"url": "http://localhost:8000/api/v3/tags/16"
},
{
"id": 17,
"url": "http://localhost:8000/api/v3/tags/17"
},
{
"id": 18,
"url": "http://localhost:8000/api/v3/tags/18"
}
],
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
GET /api/v3/forms/attributes HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"count": 1,
"results": [
{
"id": 1,
"url": "text",
"key": "text",
"label": "text",
"instructions": "text",
"input": "text",
"type": "text",
"required": true,
"default": "text",
"priority": 1,
"options": [
"text"
],
"cardinality": 1,
"config": [
"text"
],
"form_stage_id": 1,
"response_private": true,
"allowed_privileges": [
"text"
]
}
],
"limit": "text",
"offset": 1,
"order": "text",
"orderby": "text",
"curr": "text",
"next": "text",
"prev": "text",
"total_count": 1
}
GET /api/v3/forms/stages HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"count": 19,
"results": [
{
"id": 1,
"url": "http://localhost:8000/api/v3/form_stages/1",
"form_id": 1,
"label": "Main",
"priority": 1,
"type": "post",
"required": false,
"show_when_published": true,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 2,
"url": "http://localhost:8000/api/v3/form_stages/2",
"form_id": 1,
"label": "2nd step",
"priority": 2,
"type": "task",
"required": false,
"show_when_published": true,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 3,
"url": "http://localhost:8000/api/v3/form_stages/3",
"form_id": 1,
"label": "3rd step",
"priority": 3,
"type": "task",
"required": false,
"show_when_published": true,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 5,
"url": "http://localhost:8000/api/v3/form_stages/5",
"form_id": 3,
"label": "Post",
"priority": 1,
"type": "post",
"required": false,
"show_when_published": true,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 6,
"url": "http://localhost:8000/api/v3/form_stages/6",
"form_id": 4,
"label": "restricted",
"priority": 1,
"type": "task",
"required": false,
"show_when_published": false,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 7,
"url": "http://localhost:8000/api/v3/form_stages/7",
"form_id": 4,
"label": "Post",
"priority": 2,
"type": "post",
"required": false,
"show_when_published": true,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 8,
"url": "http://localhost:8000/api/v3/form_stages/8",
"form_id": 5,
"label": "Post",
"priority": 1,
"type": "post",
"required": false,
"show_when_published": false,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 9,
"url": "http://localhost:8000/api/v3/form_stages/9",
"form_id": 7,
"label": "Post",
"priority": 1,
"type": "post",
"required": false,
"show_when_published": false,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 10,
"url": "http://localhost:8000/api/v3/form_stages/10",
"form_id": 6,
"label": "Post",
"priority": 1,
"type": "post",
"required": false,
"show_when_published": false,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 11,
"url": "http://localhost:8000/api/v3/form_stages/11",
"form_id": 8,
"label": "Post",
"priority": 1,
"type": "post",
"required": false,
"show_when_published": false,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 12,
"url": "http://localhost:8000/api/v3/form_stages/12",
"form_id": 8,
"label": "Post",
"priority": 2,
"type": "task",
"required": false,
"show_when_published": false,
"task_is_internal_only": true,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 13,
"url": "http://localhost:8000/api/v3/form_stages/13",
"form_id": 8,
"label": "Post",
"priority": 3,
"type": "task",
"required": false,
"show_when_published": false,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 14,
"url": "http://localhost:8000/api/v3/form_stages/14",
"form_id": 8,
"label": "Public task",
"priority": 4,
"type": "post",
"required": false,
"show_when_published": true,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 15,
"url": "http://localhost:8000/api/v3/form_stages/15",
"form_id": 9,
"label": "Main - translated form - show when published",
"priority": 1,
"type": "post",
"required": false,
"show_when_published": true,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 16,
"url": "http://localhost:8000/api/v3/form_stages/16",
"form_id": 9,
"label": "2nd step - show when published",
"priority": 2,
"type": "task",
"required": false,
"show_when_published": true,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 17,
"url": "http://localhost:8000/api/v3/form_stages/17",
"form_id": 9,
"label": "3nd step - show when published, is internal only",
"priority": 3,
"type": "task",
"required": false,
"show_when_published": true,
"task_is_internal_only": true,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 19,
"url": "http://localhost:8000/api/v3/form_stages/19",
"form_id": 4,
"label": "restricted",
"priority": 1,
"type": "task",
"required": false,
"show_when_published": false,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 20,
"url": "http://localhost:8000/api/v3/form_stages/20",
"form_id": 4,
"label": "restricted",
"priority": 1,
"type": "task",
"required": false,
"show_when_published": false,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 21,
"url": "http://localhost:8000/api/v3/form_stages/21",
"form_id": 4,
"label": "restricted",
"priority": 1,
"type": "task",
"required": false,
"show_when_published": false,
"task_is_internal_only": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"offset": 0,
"order": "asc",
"orderby": "id",
"curr": "http://localhost:8000/api/v3/forms/stages?orderby=id&order=asc&offset=0",
"next": "http://localhost:8000/api/v3/forms/stages?orderby=id&order=asc&offset=0",
"prev": "http://localhost:8000/api/v3/forms/stages?orderby=id&order=asc&offset=0",
"total_count": 19
}
GET /api/v3/forms/4/stats HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"url": "http://localhost:8000/api/v3/form_stats",
"total_by_data_source": {
"sms": 0,
"email": 0,
"twitter": 0,
"web": "6",
"all": 6
},
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}