Ushahidi Platform API
Ushahidi is a tool to collect and manage citizen reports. This describes the resources that make up the Ushahidi Platform API v3. If you have any problems or requests please contact support.
Current Version
Version of the Ushahidi Platform API are designated in the url /api/v3
.
Resource Names
As resource names have changed over time some resource names in the API do not currently match the web interface.
API Name | Frontend Name | Description |
---|---|---|
Form | Survey | |
Form Stage | Task | |
Form Attribute | Field | |
Tag | Category | Tags also have type: category , but this is the only type available at this moment |
Set | Collection | Now mostly eliminated from the API, but in some places it still use |
Schema
All data is sent and received as JSON.
All timestamps are returned in ISO 8601 format:
YYYY-MM-DDTHH:MM:SS+00:00
Individual Resouce Responses
When you fetch an individual resource, the response includes all attributes for that resource. Authorization sometimes effects the amount of detail included in the response (ie. fields may be omitted if you do not have permission to access them).
Individual resources always include URL and id properties
{
"id": 1,
"url": "https://demo.api.ushahidi.io/api/v3/resources/1"
}
Collection Responses
When you a fetch a collection of resources we return some metadata as well as a results
array. The results array contains the full representation of the resource as decribed above.
{
"count": "20",
"results": [
// Resources here
],
"limit": "20",
"offset": "0",
"order": "asc",
"orderby": "created",
"curr": "https://demo.api.ushahidi.io/api/v3/resources?offset=0&limit=20",
"next": "https://demo.api.ushahidi.io/api/v3/resources?offset=20&limit=20",
"prev": "https://demo.api.ushahidi.io/api/v3/resources?offset=0&limit=20",
"total_count": 100
}
Relations
When a resource has relations we return these as both a URL and id of the relation
{
"relation": {
"id": 1,
"url": "https://demo.api.ushahidi.io/api/v3/resources/1"
}
}
If a relation is empty it may be ommitted or null
.
Parameters
Many API methods take optional parameters. For GET requests, any parameters not specified as a segment in the path can be passed as an HTTP query string parameter:
curl -i -H "Authorization: Bearer OAUTH-TOKEN" "https://demo.api.ushahidi.io/api/v3/forms/1/attributes?type=text"
In this example, the 1
value is provided for the formid
parameter in the path while type
is passed in the query string.
Multiple parameters are treated as boolean AND
ie. /posts?form=1&user=2 will return posts with form_id = 1 and user_id = 2
For POST and PUT requests, parameters not included in the URL should be encoded as JSON with a Content-Type of ‘application/json’:
curl -i -H "Authorization: Bearer OAUTH-TOKEN" -X POST -d '{"tag":"My tag"}' "https://demo.api.ushahidi.io/api/v3/tags"
Multivalue parameters
Often it is useful to pass multiple values to a query parameter ie. to return Posts owned by one of several users. In this case we usually accept comma separate values, or PHP style array parameters. For example:
posts?user=1,2,3
posts?user[]=1&user[]=2&user[]=3
Multi-value parameters will generally be evaluated as boolean OR
.
Error responses
All error responses include an errors
array. Error objects include at least status
and title
{
"errors": [{
"status": 400,
"title": "Some error"
}]
}
Client Errors
There are a few possible types of client errors on API calls:
-
Sending invalid JSON will result in a
400 Bad Request
response.HTTP/1.1 400 Bad Request { "errors": [{ "status": 400, "title": "Invalid json supplied. Error: 'Syntax error, malformed JSON'." }] }
-
Requesting unsupported response formats (with
?format=something
) will result in a400 Bad Request
response.HTTP/1.1 400 Bad Request { "errors": [{ "status": 400, "title": "Bad formatting parameters. ..." }] }
-
Sending invalid fields will result in a
422 Unprocessable Entity
response.HTTP/1.1 422 Unprocessable Entity { "errors": [{ "status": 422, "title": "Validation Error" }, { "status": 422, "title": "Username is already taken", "source": { "pointer": "/username" } }] }
Validation error objects have a source object so that your client
can tell where the problem is. pointer
is a JSONPath reference to
the invalid field.
HTTP Verbs
Where possible this API strives to use appropriate HTTP verbs for each action.
Verb | Description |
---|---|
GET |
Used for retrieving resources. |
POST |
Used for creating resources. |
PUT |
Used for replacing (updating) resources or collections. |
DELETE |
Used for deleting resources. |
OPTIONS |
Can be issued against any resource to get meta data. |
Authentication
Most resources required an OAuth2 Token for authentication. See the Authorization with OAuth 2 section below.
Pagination
Requests that return multiple items may be paginated by default. You can traverse further results with the ?offset parameter. You should also set a custom limit with the ?limit parameter.
curl 'https://demo.api.ushahidi.io/api/v3/posts?limit=50&offset=50'
Note that offset numbering is 0-based and that omitting the ?offset parameter will default to ?offset=0.
Cross Origin Resource Sharing
The API supports Cross Origin Resource Sharing (CORS) for AJAX requests from any origin.
Here is what the CORS preflight request looks like
curl -i https://demo.api.ushahidi.io/api/v3/posts -H "Origin: http://example.com" -X OPTIONS
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Authorization, Content-type
Allow: POST, GET, PUT, DELETE, OPTIONS
Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS
{
"allowed_privileges": [
"read",
"create",
"search"
]
}
Posts ¶
List All Posts ¶
List All PostsGET/api/v3/posts{?form,user,set}
List all posts matching search criteria as supplied in query parameters. Multiple parameters are treated as boolean AND ie. /posts?form=1&user=2 will return posts with form_id = 1 and user_id = 2
Example URI
- q
string
(optional)Return posts containing
q
text intitle
orcontent
properties- form
number
(optional) Example: 17,18Form ID. Accepts multiple values, ie:
?form=17,19,32
- user
number
(optional) Example: 32,33User ID. Accepts multiple values, ie:
?user=17,19,32
- parent
number
(optional) Example: 10,11Parent Post ID. Accepts multiple values.
- set
number
(optional) Example: 1,2Collection ID. (Collections are represented as Sets in the database. This naming should change to be more consistent in future)
- tags
number
(optional) Example: 1,2,3Tag ID. Return Posts matching any of these Tags (Boolean OR)
- tags[any]
number
(optional) Example: 1,6,9Return posts matching any of these Tag IDs (Boolean OR)
- tags[all]
number
(optional) Example: 1,7,10Return posts matching all of these Tag IDs (Boolean AND)
- status
string
(optional) Example: draftStatus of Posts to be returned
Choices:
archived
draft
published
- locale
string
(optional) Example: en_us- created_before
string
(optional) Example: 1970-01-01T00:00:00+00:00- created_after
string
(optional) Example: 1970-01-01T00:00:00+00:00- updated_before
string
(optional) Example: 1970-01-01T00:00:00+00:00- updated_after
string
(optional) Example: 1970-01-01T00:00:00+00:00- bbox
string
(optional)- values
string
(optional)- current_stage
number
(optional)(Experimental)
- center_point
string
(optional)- within_km
number
(optional)- published_to
array(string)
(optional)Roles this post is published to (Deprecated)
- include_types
string
(optional)- include_attributes
string
(optional)
200
Headers
Content-Type: application/json
Body
{
"count": "20",
"results": [
{
"id": 530,
"url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/posts/1"
},
"title": "Need help",
"content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"form": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
},
"user": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"message": "",
"color": "#2274B4",
"type": "report",
"slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
"author_email": "null",
"author_realname": "null",
"status": "published",
"locale": "en_us",
"published_to": [],
"completed_stages": [],
"values": {
"AttributeID1": [
"Value 1",
"Value 2"
],
"AttributeID2": [
{
"lat": "2.456",
"lon": "1.234"
}
]
},
"tags": [
{
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
}
],
"sets": [
"1",
"2"
],
"source": "SMS",
"contact": "rjmackay",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"limit": "20",
"offset": "0",
"order": "asc",
"orderby": "created",
"curr": "https://quakemap.api.ushahidi.io/api/v3/posts?offset=0&limit=20",
"next": "https://quakemap.api.ushahidi.io/api/v3/posts?offset=20&limit=20",
"prev": "https://quakemap.api.ushahidi.io/api/v3/posts?offset=0&limit=20",
"total_count": 100
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "string"
},
"results": {
"type": "array"
},
"limit": {
"type": "string"
},
"offset": {
"type": "string"
},
"order": {
"type": "string"
},
"orderby": {
"type": "string"
},
"curr": {
"type": "string"
},
"next": {
"type": "string"
},
"prev": {
"type": "string"
},
"total_count": {
"type": "number"
}
}
}
Create a New Post ¶
Create a New PostPOST/api/v3/posts
Example URI
With permission to view created post
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/posts/1"
},
"title": "Need help",
"content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"form": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
},
"user": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"message": "",
"color": "#2274B4",
"type": "report",
"slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
"author_email": "null",
"author_realname": "null",
"status": "published",
"locale": "en_us",
"published_to": [],
"completed_stages": [],
"values": {
"AttributeID1": [
"Value 1",
"Value 2"
],
"AttributeID2": [
{
"lat": "2.456",
"lon": "1.234"
}
]
},
"tags": [
{
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
}
],
"sets": [
"1",
"2"
],
"source": "SMS",
"contact": "rjmackay",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"title": {
"type": "string"
},
"content": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"form": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"user": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"message": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string"
},
"slug": {
"type": "string"
},
"author_email": {
"type": "string"
},
"author_realname": {
"type": "string"
},
"status": {
"type": "string"
},
"locale": {
"type": "string"
},
"published_to": {},
"completed_stages": {
"type": "array"
},
"values": {
"type": "object",
"properties": {
"AttributeID1": {
"type": "array"
},
"AttributeID2": {
"type": "array"
}
},
"description": "Custom field values. Object keys map to Form Attribute key field"
},
"tags": {
"type": "array"
},
"sets": {
"type": "array"
},
"source": {
"type": "string",
"description": "Original Message source ie. SMS, Twitter"
},
"contact": {
"type": "string",
"description": "Contact Identifier ie. SMS number, twitter handle"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"title",
"content"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/posts/1"
},
"title": "Need help",
"content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"form": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
},
"user": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"message": "",
"color": "#2274B4",
"type": "report",
"slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
"author_email": "null",
"author_realname": "null",
"status": "published",
"locale": "en_us",
"published_to": [],
"completed_stages": [],
"values": {
"AttributeID1": [
"Value 1",
"Value 2"
],
"AttributeID2": [
{
"lat": "2.456",
"lon": "1.234"
}
]
},
"tags": [
{
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
}
],
"sets": [
"1",
"2"
],
"source": "SMS",
"contact": "rjmackay",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"title": {
"type": "string"
},
"content": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"form": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"user": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"message": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string"
},
"slug": {
"type": "string"
},
"author_email": {
"type": "string"
},
"author_realname": {
"type": "string"
},
"status": {
"type": "string"
},
"locale": {
"type": "string"
},
"published_to": {},
"completed_stages": {
"type": "array"
},
"values": {
"type": "object",
"properties": {
"AttributeID1": {
"type": "array"
},
"AttributeID2": {
"type": "array"
}
},
"description": "Custom field values. Object keys map to Form Attribute key field"
},
"tags": {
"type": "array"
},
"sets": {
"type": "array"
},
"source": {
"type": "string",
"description": "Original Message source ie. SMS, Twitter"
},
"contact": {
"type": "string",
"description": "Contact Identifier ie. SMS number, twitter handle"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"title",
"content"
]
}
Without permission to view created post
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/posts/1"
},
"title": "Need help",
"content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"form": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
},
"user": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"message": "",
"color": "#2274B4",
"type": "report",
"slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
"author_email": "null",
"author_realname": "null",
"status": "published",
"locale": "en_us",
"published_to": [],
"completed_stages": [],
"values": {
"AttributeID1": [
"Value 1",
"Value 2"
],
"AttributeID2": [
{
"lat": "2.456",
"lon": "1.234"
}
]
},
"tags": [
{
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
}
],
"sets": [
"1",
"2"
],
"source": "SMS",
"contact": "rjmackay",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"title": {
"type": "string"
},
"content": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"form": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"user": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"message": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string"
},
"slug": {
"type": "string"
},
"author_email": {
"type": "string"
},
"author_realname": {
"type": "string"
},
"status": {
"type": "string"
},
"locale": {
"type": "string"
},
"published_to": {},
"completed_stages": {
"type": "array"
},
"values": {
"type": "object",
"properties": {
"AttributeID1": {
"type": "array"
},
"AttributeID2": {
"type": "array"
}
},
"description": "Custom field values. Object keys map to Form Attribute key field"
},
"tags": {
"type": "array"
},
"sets": {
"type": "array"
},
"source": {
"type": "string",
"description": "Original Message source ie. SMS, Twitter"
},
"contact": {
"type": "string",
"description": "Contact Identifier ie. SMS number, twitter handle"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"title",
"content"
]
}
204
With invalid post data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/posts/1"
},
"title": "Need help",
"content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"form": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
},
"user": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"message": "",
"color": "#2274B4",
"type": "report",
"slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
"author_email": "null",
"author_realname": "null",
"status": "published",
"locale": "en_us",
"published_to": [],
"completed_stages": [],
"values": {
"AttributeID1": [
"Value 1",
"Value 2"
],
"AttributeID2": [
{
"lat": "2.456",
"lon": "1.234"
}
]
},
"tags": [
{
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
}
],
"sets": [
"1",
"2"
],
"source": "SMS",
"contact": "rjmackay",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"title": {
"type": "string"
},
"content": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"form": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"user": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"message": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string"
},
"slug": {
"type": "string"
},
"author_email": {
"type": "string"
},
"author_realname": {
"type": "string"
},
"status": {
"type": "string"
},
"locale": {
"type": "string"
},
"published_to": {},
"completed_stages": {
"type": "array"
},
"values": {
"type": "object",
"properties": {
"AttributeID1": {
"type": "array"
},
"AttributeID2": {
"type": "array"
}
},
"description": "Custom field values. Object keys map to Form Attribute key field"
},
"tags": {
"type": "array"
},
"sets": {
"type": "array"
},
"source": {
"type": "string",
"description": "Original Message source ie. SMS, Twitter"
},
"contact": {
"type": "string",
"description": "Contact Identifier ie. SMS number, twitter handle"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"title",
"content"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Individual Post ¶
Get a PostGET/api/v3/posts/{id}
Example URI
- id
number
(required)ID of the Post
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/posts/1"
},
"title": "Need help",
"content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"form": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
},
"user": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"message": "",
"color": "#2274B4",
"type": "report",
"slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
"author_email": "null",
"author_realname": "null",
"status": "published",
"locale": "en_us",
"published_to": [],
"completed_stages": [],
"values": {
"AttributeID1": [
"Value 1",
"Value 2"
],
"AttributeID2": [
{
"lat": "2.456",
"lon": "1.234"
}
]
},
"tags": [
{
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
}
],
"sets": [
"1",
"2"
],
"source": "SMS",
"contact": "rjmackay",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"title": {
"type": "string"
},
"content": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"form": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"user": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"message": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string"
},
"slug": {
"type": "string"
},
"author_email": {
"type": "string"
},
"author_realname": {
"type": "string"
},
"status": {
"type": "string"
},
"locale": {
"type": "string"
},
"published_to": {},
"completed_stages": {
"type": "array"
},
"values": {
"type": "object",
"properties": {
"AttributeID1": {
"type": "array"
},
"AttributeID2": {
"type": "array"
}
},
"description": "Custom field values. Object keys map to Form Attribute key field"
},
"tags": {
"type": "array"
},
"sets": {
"type": "array"
},
"source": {
"type": "string",
"description": "Original Message source ie. SMS, Twitter"
},
"contact": {
"type": "string",
"description": "Contact Identifier ie. SMS number, twitter handle"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"title",
"content"
]
}
404
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 404,
"title": "Resource could not be found"
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Update a PostPUT/api/v3/posts/{id}
Example URI
- id
number
(required)ID of the Post
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/posts/1"
},
"title": "Need help",
"content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"form": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
},
"user": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"message": "",
"color": "#2274B4",
"type": "report",
"slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
"author_email": "null",
"author_realname": "null",
"status": "published",
"locale": "en_us",
"published_to": [],
"completed_stages": [],
"values": {
"AttributeID1": [
"Value 1",
"Value 2"
],
"AttributeID2": [
{
"lat": "2.456",
"lon": "1.234"
}
]
},
"tags": [
{
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
}
],
"sets": [
"1",
"2"
],
"source": "SMS",
"contact": "rjmackay",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"title": {
"type": "string"
},
"content": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"form": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"user": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"message": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string"
},
"slug": {
"type": "string"
},
"author_email": {
"type": "string"
},
"author_realname": {
"type": "string"
},
"status": {
"type": "string"
},
"locale": {
"type": "string"
},
"published_to": {},
"completed_stages": {
"type": "array"
},
"values": {
"type": "object",
"properties": {
"AttributeID1": {
"type": "array"
},
"AttributeID2": {
"type": "array"
}
},
"description": "Custom field values. Object keys map to Form Attribute key field"
},
"tags": {
"type": "array"
},
"sets": {
"type": "array"
},
"source": {
"type": "string",
"description": "Original Message source ie. SMS, Twitter"
},
"contact": {
"type": "string",
"description": "Contact Identifier ie. SMS number, twitter handle"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"title",
"content"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/posts/1"
},
"title": "Need help",
"content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"form": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
},
"user": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"message": "",
"color": "#2274B4",
"type": "report",
"slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
"author_email": "null",
"author_realname": "null",
"status": "published",
"locale": "en_us",
"published_to": [],
"completed_stages": [],
"values": {
"AttributeID1": [
"Value 1",
"Value 2"
],
"AttributeID2": [
{
"lat": "2.456",
"lon": "1.234"
}
]
},
"tags": [
{
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
}
],
"sets": [
"1",
"2"
],
"source": "SMS",
"contact": "rjmackay",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"title": {
"type": "string"
},
"content": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"form": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"user": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"message": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string"
},
"slug": {
"type": "string"
},
"author_email": {
"type": "string"
},
"author_realname": {
"type": "string"
},
"status": {
"type": "string"
},
"locale": {
"type": "string"
},
"published_to": {},
"completed_stages": {
"type": "array"
},
"values": {
"type": "object",
"properties": {
"AttributeID1": {
"type": "array"
},
"AttributeID2": {
"type": "array"
}
},
"description": "Custom field values. Object keys map to Form Attribute key field"
},
"tags": {
"type": "array"
},
"sets": {
"type": "array"
},
"source": {
"type": "string",
"description": "Original Message source ie. SMS, Twitter"
},
"contact": {
"type": "string",
"description": "Contact Identifier ie. SMS number, twitter handle"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"title",
"content"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
404
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 404,
"title": "Resource could not be found"
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Delete a PostDELETE/api/v3/posts/{id}
Example URI
- id
number
(required) Example: 1ID of the Post
Delete a post
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/posts/1"
},
"title": "Need help",
"content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"form": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
},
"user": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"message": "",
"color": "#2274B4",
"type": "report",
"slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
"author_email": "null",
"author_realname": "null",
"status": "published",
"locale": "en_us",
"published_to": [],
"completed_stages": [],
"values": {
"AttributeID1": [
"Value 1",
"Value 2"
],
"AttributeID2": [
{
"lat": "2.456",
"lon": "1.234"
}
]
},
"tags": [
{
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
}
],
"sets": [
"1",
"2"
],
"source": "SMS",
"contact": "rjmackay",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"title": {
"type": "string"
},
"content": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"form": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"user": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"message": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string"
},
"slug": {
"type": "string"
},
"author_email": {
"type": "string"
},
"author_realname": {
"type": "string"
},
"status": {
"type": "string"
},
"locale": {
"type": "string"
},
"published_to": {},
"completed_stages": {
"type": "array"
},
"values": {
"type": "object",
"properties": {
"AttributeID1": {
"type": "array"
},
"AttributeID2": {
"type": "array"
}
},
"description": "Custom field values. Object keys map to Form Attribute key field"
},
"tags": {
"type": "array"
},
"sets": {
"type": "array"
},
"source": {
"type": "string",
"description": "Original Message source ie. SMS, Twitter"
},
"contact": {
"type": "string",
"description": "Contact Identifier ie. SMS number, twitter handle"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"title",
"content"
]
}
Delete non existent post
404
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 404,
"title": "Resource could not be found"
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Posts Statistics ¶
Get Posts Grouped TotalsGET/api/v3/posts/stats{?group_by,group_by_attribute_key,group_by_tags}
Example URI
- group_by
string
(optional) Example: statusVariable to group by
- Members:
- status
- form
- tags - Use with
group_by_tags
- attribute - Use with
group_by_attribute_key
- Members:
- group_by_tags
number
(optional)Group by children of this Parent Tag ID
- group_by_attribute_key
string
(optional) Example: regionAttribute key. Posts will be grouped by the value of this attribute.
200
Headers
Content-Type: application/json
Get Post Totals Over TimeGET/api/v3/posts/stats?timeline=1&{?timeline,timeline_interval,timeline_attribute,group_by,group_by_tags,group_by_attribute_key}
Example URI
- timeline
boolean
(required) Example: 1Enable grouping by time
- timeline_interval
string
(optional) Example: 86400Interval of time to group by, in seconds
- timeline_attribute
string
(optional) Example: updatedProperty of the post to use as the time variable
- group_by
string
(optional) Example: statusVariable to group by
- Members:
- status
- form
- tags - Use with
group_by_tags
- attribute - Use with
group_by_attribute_key
- Members:
- group_by_tags
number
(optional)Group by children of this Parent Tag ID
- group_by_attribute_key
string
(optional) Example: regionAttribute key. Posts will be grouped by the value of this attribute.
200
Headers
Content-Type: application/json
Media ¶
Media ¶
List All MediaGET/api/v3/media{?user,orphans}
Example URI
- user
number
(required)User ID
- orphans
boolean
(required)Only return orphaned Media which are not attached to a post
200
Headers
Content-Type: application/json
Body
{
"count": "20",
"results": [
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/media/530",
"user": {
"id": 1,
"url": "https://demo.api.ushahidi.io/api/v3/users/530"
},
"caption": "A sample image",
"created": "1970-01-01T00:00:00+00:00",
"updated": "1970-01-01T00:00:00+00:00",
"mime": "image/png",
"original_file_url": "http://demo.api.ushahidi.io/media/uploads/5/7/57998f5f0bae9-sample.png",
"original_file_size": 1,
"original_width": 1,
"original_height": 1,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"limit": "20",
"offset": "0",
"order": "asc",
"orderby": "created",
"curr": "https://demo.api.ushahidi.io/api/v3/media?offset=0&limit=20",
"next": "https://demo.api.ushahidi.io/api/v3/media?offset=20&limit=20",
"prev": "https://demo.api.ushahidi.io/api/v3/media?offset=0&limit=20",
"total_count": 100
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "string"
},
"results": {
"type": "array"
},
"limit": {
"type": "string"
},
"offset": {
"type": "string"
},
"order": {
"type": "string"
},
"orderby": {
"type": "string"
},
"curr": {
"type": "string"
},
"next": {
"type": "string"
},
"prev": {
"type": "string"
},
"total_count": {
"type": "number"
}
}
}
Upload MediaPOST/api/v3/media
Media Uploads use the multipart/form-data
content type, rather than application/json
as in other API calls.
Example URI
Headers
Content-Type: multipart/form-data;boundary=----FormBoundary8M3sSU13ul5lXSJm
Content-Length: 1234
Body
----FormBoundary8M3sSU13ul5lXSJm
content-disposition: form-data; name="caption"
A sample image
----FormBoundary8M3sSU13ul5lXSJm
content-disposition: form-data; name="sample"; filename="sample.png"
Content-Type: Mime-Type
Content-Transfer-Encoding: binary
binarydata
----FormBoundary8M3sSU13ul5lXSJm--
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/media/530",
"user": {
"id": 1,
"url": "https://demo.api.ushahidi.io/api/v3/users/530"
},
"caption": "A sample image",
"created": "1970-01-01T00:00:00+00:00",
"updated": "1970-01-01T00:00:00+00:00",
"mime": "image/png",
"original_file_url": "http://demo.api.ushahidi.io/media/uploads/5/7/57998f5f0bae9-sample.png",
"original_file_size": 1,
"original_width": 1,
"original_height": 1,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"caption": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"mime": {
"type": "string"
},
"original_file_url": {
"type": "string"
},
"original_file_size": {
"type": "number"
},
"original_width": {
"type": "number"
},
"original_height": {
"type": "number"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
}
}
Individual Media Upload ¶
Get MediaGET/api/v3/media/{id}
Example URI
- id
number
(required)ID of Media resource
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/media/530",
"user": {
"id": 1,
"url": "https://demo.api.ushahidi.io/api/v3/users/530"
},
"caption": "A sample image",
"created": "1970-01-01T00:00:00+00:00",
"updated": "1970-01-01T00:00:00+00:00",
"mime": "image/png",
"original_file_url": "http://demo.api.ushahidi.io/media/uploads/5/7/57998f5f0bae9-sample.png",
"original_file_size": 1,
"original_width": 1,
"original_height": 1,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"caption": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"mime": {
"type": "string"
},
"original_file_url": {
"type": "string"
},
"original_file_size": {
"type": "number"
},
"original_width": {
"type": "number"
},
"original_height": {
"type": "number"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
}
}
Update MediaPUT/api/v3/media/{id}
Only the caption can be changed when updating Media resources. You cannot update the file upload. Instead you need to upload a new Media resource.
Example URI
- id
number
(required)ID of Media resource
Body
{
"caption": "\"A new caption\""
}
Schema
{
"type": "object",
"properties": {
"caption": {
"type": "string"
}
},
"$schema": "http://json-schema.org/draft-04/schema#"
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/media/530",
"user": {
"id": 1,
"url": "https://demo.api.ushahidi.io/api/v3/users/530"
},
"caption": "A sample image",
"created": "1970-01-01T00:00:00+00:00",
"updated": "1970-01-01T00:00:00+00:00",
"mime": "image/png",
"original_file_url": "http://demo.api.ushahidi.io/media/uploads/5/7/57998f5f0bae9-sample.png",
"original_file_size": 1,
"original_width": 1,
"original_height": 1,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"caption": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"mime": {
"type": "string"
},
"original_file_url": {
"type": "string"
},
"original_file_size": {
"type": "number"
},
"original_width": {
"type": "number"
},
"original_height": {
"type": "number"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
}
}
Delete MediaDELETE/api/v3/media/{id}
Example URI
- id
number
(required)ID of Media resource
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/media/530",
"user": {
"id": 1,
"url": "https://demo.api.ushahidi.io/api/v3/users/530"
},
"caption": "A sample image",
"created": "1970-01-01T00:00:00+00:00",
"updated": "1970-01-01T00:00:00+00:00",
"mime": "image/png",
"original_file_url": "http://demo.api.ushahidi.io/media/uploads/5/7/57998f5f0bae9-sample.png",
"original_file_size": 1,
"original_width": 1,
"original_height": 1,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"caption": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"mime": {
"type": "string"
},
"original_file_url": {
"type": "string"
},
"original_file_size": {
"type": "number"
},
"original_width": {
"type": "number"
},
"original_height": {
"type": "number"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
}
}
Collections ¶
Collections ¶
List All CollectionsGET/api/v3/collections{?q}
Example URI
- q
string
(required)
200
Headers
Content-Type: application/json
Body
{
"count": "20",
"results": [
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/collection/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"created": "2014-11-11T08:40:51+00:00",
"update": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"limit": "20",
"offset": "0",
"order": "asc",
"orderby": "created",
"curr": "https://demo.api.ushahidi.io/api/v3/collections?offset=0&limit=20",
"next": "https://demo.api.ushahidi.io/api/v3/collections?offset=20&limit=20",
"prev": "https://demo.api.ushahidi.io/api/v3/collections?offset=0&limit=20",
"total_count": 100
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "string"
},
"results": {
"type": "array"
},
"limit": {
"type": "string"
},
"offset": {
"type": "string"
},
"order": {
"type": "string"
},
"orderby": {
"type": "string"
},
"curr": {
"type": "string"
},
"next": {
"type": "string"
},
"prev": {
"type": "string"
},
"total_count": {
"type": "number"
}
}
}
Create a CollectionPOST/api/v3/collections
Example URI
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/collection/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"created": "2014-11-11T08:40:51+00:00",
"update": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
},
"description": "Owner of the collection"
},
"view": {
"type": "string",
"enum": [
"map",
"list"
]
},
"view_options": {},
"visible_to": {
"type": "array",
"description": "array of roles which can view this search"
},
"featured": {
"type": "boolean"
},
"created": {
"type": "string"
},
"update": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name",
"created"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/collection/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"created": "2014-11-11T08:40:51+00:00",
"update": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
},
"description": "Owner of the collection"
},
"view": {
"type": "string",
"enum": [
"map",
"list"
]
},
"view_options": {},
"visible_to": {
"type": "array",
"description": "array of roles which can view this search"
},
"featured": {
"type": "boolean"
},
"created": {
"type": "string"
},
"update": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name",
"created"
]
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/collection/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"created": "2014-11-11T08:40:51+00:00",
"update": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
},
"description": "Owner of the collection"
},
"view": {
"type": "string",
"enum": [
"map",
"list"
]
},
"view_options": {},
"visible_to": {
"type": "array",
"description": "array of roles which can view this search"
},
"featured": {
"type": "boolean"
},
"created": {
"type": "string"
},
"update": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name",
"created"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Individual Collection ¶
Get a CollectionGET/api/v3/collections/{id}
Example URI
- id
number
(required)ID of the Collection
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/collection/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"created": "2014-11-11T08:40:51+00:00",
"update": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
},
"description": "Owner of the collection"
},
"view": {
"type": "string",
"enum": [
"map",
"list"
]
},
"view_options": {},
"visible_to": {
"type": "array",
"description": "array of roles which can view this search"
},
"featured": {
"type": "boolean"
},
"created": {
"type": "string"
},
"update": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name",
"created"
]
}
Update a CollectionPUT/api/v3/collections/{id}
Example URI
- id
number
(required)ID of the Collection
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/collection/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"created": "2014-11-11T08:40:51+00:00",
"update": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
},
"description": "Owner of the collection"
},
"view": {
"type": "string",
"enum": [
"map",
"list"
]
},
"view_options": {},
"visible_to": {
"type": "array",
"description": "array of roles which can view this search"
},
"featured": {
"type": "boolean"
},
"created": {
"type": "string"
},
"update": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name",
"created"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/collection/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"created": "2014-11-11T08:40:51+00:00",
"update": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
},
"description": "Owner of the collection"
},
"view": {
"type": "string",
"enum": [
"map",
"list"
]
},
"view_options": {},
"visible_to": {
"type": "array",
"description": "array of roles which can view this search"
},
"featured": {
"type": "boolean"
},
"created": {
"type": "string"
},
"update": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name",
"created"
]
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/collection/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"created": "2014-11-11T08:40:51+00:00",
"update": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
},
"description": "Owner of the collection"
},
"view": {
"type": "string",
"enum": [
"map",
"list"
]
},
"view_options": {},
"visible_to": {
"type": "array",
"description": "array of roles which can view this search"
},
"featured": {
"type": "boolean"
},
"created": {
"type": "string"
},
"update": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name",
"created"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Delete a CollectionDELETE/api/v3/collections/{id}
Example URI
- id
number
(required)ID of the Collection
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/collection/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"created": "2014-11-11T08:40:51+00:00",
"update": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
},
"description": "Owner of the collection"
},
"view": {
"type": "string",
"enum": [
"map",
"list"
]
},
"view_options": {},
"visible_to": {
"type": "array",
"description": "array of roles which can view this search"
},
"featured": {
"type": "boolean"
},
"created": {
"type": "string"
},
"update": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name",
"created"
]
}
Collection Posts ¶
Get all Posts in a collectionGET/api/v3/collections/{id}/posts
Example URI
- id
number
(required)ID of the Collection
200
Headers
Content-Type: application/json
Body
{
"count": "20",
"results": [
{
"id": 530,
"url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/posts/1"
},
"title": "Need help",
"content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"form": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
},
"user": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"message": "",
"color": "#2274B4",
"type": "report",
"slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
"author_email": "null",
"author_realname": "null",
"status": "published",
"locale": "en_us",
"published_to": [],
"completed_stages": [],
"values": {
"AttributeID1": [
"Value 1",
"Value 2"
],
"AttributeID2": [
{
"lat": "2.456",
"lon": "1.234"
}
]
},
"tags": [
{
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
}
],
"sets": [
"1",
"2"
],
"source": "SMS",
"contact": "rjmackay",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"limit": "20",
"offset": "0",
"order": "asc",
"orderby": "created",
"curr": "https://demo.api.ushahidi.io/api/v3/collections/1/posts?offset=0&limit=20",
"next": "https://demo.api.ushahidi.io/api/v3/collections/1/posts?offset=20&limit=20",
"prev": "https://demo.api.ushahidi.io/api/v3/collections/1/posts?offset=0&limit=20",
"total_count": 100
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "string"
},
"results": {
"type": "array"
},
"limit": {
"type": "string"
},
"offset": {
"type": "string"
},
"order": {
"type": "string"
},
"orderby": {
"type": "string"
},
"curr": {
"type": "string"
},
"next": {
"type": "string"
},
"prev": {
"type": "string"
},
"total_count": {
"type": "number"
}
}
}
Add a Post to a collectionPOST/api/v3/collections/{id}/posts
Example URI
- id
number
(required)ID of the Collection
Headers
Content-Type: application/json
Body
{
"id": 95
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "Post ID to add to collection"
}
},
"required": [
"id"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/posts/1"
},
"title": "Need help",
"content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"form": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
},
"user": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"message": "",
"color": "#2274B4",
"type": "report",
"slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
"author_email": "null",
"author_realname": "null",
"status": "published",
"locale": "en_us",
"published_to": [],
"completed_stages": [],
"values": {
"AttributeID1": [
"Value 1",
"Value 2"
],
"AttributeID2": [
{
"lat": "2.456",
"lon": "1.234"
}
]
},
"tags": [
{
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
}
],
"sets": [
"1",
"2"
],
"source": "SMS",
"contact": "rjmackay",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"title": {
"type": "string"
},
"content": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"form": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"user": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"message": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string"
},
"slug": {
"type": "string"
},
"author_email": {
"type": "string"
},
"author_realname": {
"type": "string"
},
"status": {
"type": "string"
},
"locale": {
"type": "string"
},
"published_to": {},
"completed_stages": {
"type": "array"
},
"values": {
"type": "object",
"properties": {
"AttributeID1": {
"type": "array"
},
"AttributeID2": {
"type": "array"
}
},
"description": "Custom field values. Object keys map to Form Attribute key field"
},
"tags": {
"type": "array"
},
"sets": {
"type": "array"
},
"source": {
"type": "string",
"description": "Original Message source ie. SMS, Twitter"
},
"contact": {
"type": "string",
"description": "Contact Identifier ie. SMS number, twitter handle"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"title",
"content"
]
}
Remove a Post to from collectionDELETE/api/v3/collections/{id}/posts/{postid}
Example URI
- id
number
(required)ID of the Collection
- postid
number
(required)ID of post to remove from collection
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/posts/1"
},
"title": "Need help",
"content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"form": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
},
"user": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"message": "",
"color": "#2274B4",
"type": "report",
"slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
"author_email": "null",
"author_realname": "null",
"status": "published",
"locale": "en_us",
"published_to": [],
"completed_stages": [],
"values": {
"AttributeID1": [
"Value 1",
"Value 2"
],
"AttributeID2": [
{
"lat": "2.456",
"lon": "1.234"
}
]
},
"tags": [
{
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
}
],
"sets": [
"1",
"2"
],
"source": "SMS",
"contact": "rjmackay",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"title": {
"type": "string"
},
"content": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"form": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"user": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"message": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string"
},
"slug": {
"type": "string"
},
"author_email": {
"type": "string"
},
"author_realname": {
"type": "string"
},
"status": {
"type": "string"
},
"locale": {
"type": "string"
},
"published_to": {},
"completed_stages": {
"type": "array"
},
"values": {
"type": "object",
"properties": {
"AttributeID1": {
"type": "array"
},
"AttributeID2": {
"type": "array"
}
},
"description": "Custom field values. Object keys map to Form Attribute key field"
},
"tags": {
"type": "array"
},
"sets": {
"type": "array"
},
"source": {
"type": "string",
"description": "Original Message source ie. SMS, Twitter"
},
"contact": {
"type": "string",
"description": "Contact Identifier ie. SMS number, twitter handle"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"title",
"content"
]
}
Saved Searches ¶
List All Saved Searches ¶
List All Saved SearchesGET/api/v3/savedsearches{?q}
Example URI
- q
string
(required)
200
Headers
Content-Type: application/json
Body
{
"count": "20",
"results": [
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/savedsearches/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"filter": {
"q": "test"
},
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"limit": "20",
"offset": "0",
"order": "asc",
"orderby": "created",
"curr": "https://demo.api.ushahidi.io/api/v3/savedsearches?offset=0&limit=20",
"next": "https://demo.api.ushahidi.io/api/v3/savedsearches?offset=20&limit=20",
"prev": "https://demo.api.ushahidi.io/api/v3/savedsearches?offset=0&limit=20",
"total_count": 100
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "string"
},
"results": {
"type": "array"
},
"limit": {
"type": "string"
},
"offset": {
"type": "string"
},
"order": {
"type": "string"
},
"orderby": {
"type": "string"
},
"curr": {
"type": "string"
},
"next": {
"type": "string"
},
"prev": {
"type": "string"
},
"total_count": {
"type": "number"
}
}
}
Create a Saved Search ¶
Create a Saved SearchPOST/api/v3/savedsearches
Example URI
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/savedsearches/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"filter": {
"q": "test"
},
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
},
"description": "Owner of the saved search"
},
"view": {
"type": "string",
"enum": [
"map",
"list"
]
},
"view_options": {},
"visible_to": {
"type": "array",
"description": "array of roles which can view this search"
},
"featured": {
"type": "boolean"
},
"filter": {
"type": "object",
"properties": {
"q": {
"type": "string"
}
},
"description": "search string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/savedsearches/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"filter": {
"q": "test"
},
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
},
"description": "Owner of the saved search"
},
"view": {
"type": "string",
"enum": [
"map",
"list"
]
},
"view_options": {},
"visible_to": {
"type": "array",
"description": "array of roles which can view this search"
},
"featured": {
"type": "boolean"
},
"filter": {
"type": "object",
"properties": {
"q": {
"type": "string"
}
},
"description": "search string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name"
]
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/savedsearches/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"filter": {
"q": "test"
},
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
},
"description": "Owner of the saved search"
},
"view": {
"type": "string",
"enum": [
"map",
"list"
]
},
"view_options": {},
"visible_to": {
"type": "array",
"description": "array of roles which can view this search"
},
"featured": {
"type": "boolean"
},
"filter": {
"type": "object",
"properties": {
"q": {
"type": "string"
}
},
"description": "search string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Individual Saved Search ¶
Get a Saved SearchGET/api/v3/savedsearches/{id}
Example URI
- id
number
(required)ID of the Saved Search
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/savedsearches/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"filter": {
"q": "test"
},
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
},
"description": "Owner of the saved search"
},
"view": {
"type": "string",
"enum": [
"map",
"list"
]
},
"view_options": {},
"visible_to": {
"type": "array",
"description": "array of roles which can view this search"
},
"featured": {
"type": "boolean"
},
"filter": {
"type": "object",
"properties": {
"q": {
"type": "string"
}
},
"description": "search string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name"
]
}
Update a Saved SearchPUT/api/v3/savedsearches/{id}
Example URI
- id
number
(required)ID of the Saved Search
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/savedsearches/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"filter": {
"q": "test"
},
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
},
"description": "Owner of the saved search"
},
"view": {
"type": "string",
"enum": [
"map",
"list"
]
},
"view_options": {},
"visible_to": {
"type": "array",
"description": "array of roles which can view this search"
},
"featured": {
"type": "boolean"
},
"filter": {
"type": "object",
"properties": {
"q": {
"type": "string"
}
},
"description": "search string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/savedsearches/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"filter": {
"q": "test"
},
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
},
"description": "Owner of the saved search"
},
"view": {
"type": "string",
"enum": [
"map",
"list"
]
},
"view_options": {},
"visible_to": {
"type": "array",
"description": "array of roles which can view this search"
},
"featured": {
"type": "boolean"
},
"filter": {
"type": "object",
"properties": {
"q": {
"type": "string"
}
},
"description": "search string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name"
]
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/savedsearches/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"filter": {
"q": "test"
},
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
},
"description": "Owner of the saved search"
},
"view": {
"type": "string",
"enum": [
"map",
"list"
]
},
"view_options": {},
"visible_to": {
"type": "array",
"description": "array of roles which can view this search"
},
"featured": {
"type": "boolean"
},
"filter": {
"type": "object",
"properties": {
"q": {
"type": "string"
}
},
"description": "search string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Delete a Saved SearchDELETE/api/v3/savedsearches/{id}
Example URI
- id
number
(required)ID of the Saved Search
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/savedsearches/530",
"name": "Hello, world!",
"description": "Hello, world!",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"view": "map",
"view_options": [],
"visible_to": [
"admin"
],
"featured": false,
"filter": {
"q": "test"
},
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
},
"description": "Owner of the saved search"
},
"view": {
"type": "string",
"enum": [
"map",
"list"
]
},
"view_options": {},
"visible_to": {
"type": "array",
"description": "array of roles which can view this search"
},
"featured": {
"type": "boolean"
},
"filter": {
"type": "object",
"properties": {
"q": {
"type": "string"
}
},
"description": "search string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name"
]
}
Import ¶
CSV ¶
List AllGET/api/v3/csv
Example URI
200
Headers
Content-Type: application/json
Upload a CSVPOST/api/v3/csv
Example URI
200
Headers
Content-Type: application/json
Get CSVGET/api/v3/csv/
Example URI
200
Headers
Content-Type: application/json
Update CSVPUT/api/v3/csv/
Example URI
200
Headers
Content-Type: application/json
Delete CSVDELETE/api/v3/csv/
Example URI
200
Headers
Content-Type: application/json
Import a CSVPOST/api/v3/csv/import
Example URI
200
Headers
Content-Type: application/json
Forms ¶
Forms ¶
List All FormsGET/api/v3/forms{?q}
Example URI
- q
string
(required)
200
Headers
Content-Type: application/json
Body
{
"count": "20",
"results": [
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/530",
"parent": {
"id": "https://demo.api.ushahidi.io/api/v3/forms/1",
"url": "https://demo.api.ushahidi.io/api/v3/forms/1"
},
"name": "This is a Form",
"description": "This is a form description",
"color": "#ff00dd",
"type": "report",
"disable": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"limit": "20",
"offset": "0",
"order": "asc",
"orderby": "created",
"curr": "https://demo.api.ushahidi.io/api/v3/forms?offset=0&limit=20",
"next": "https://demo.api.ushahidi.io/api/v3/forms?offset=20&limit=20",
"prev": "https://demo.api.ushahidi.io/api/v3/forms?offset=0&limit=20",
"total_count": 100
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "string"
},
"results": {
"type": "array"
},
"limit": {
"type": "string"
},
"offset": {
"type": "string"
},
"order": {
"type": "string"
},
"orderby": {
"type": "string"
},
"curr": {
"type": "string"
},
"next": {
"type": "string"
},
"prev": {
"type": "string"
},
"total_count": {
"type": "number"
}
}
}
Create a FormPOST/api/v3/forms
Example URI
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/530",
"parent": {
"id": "https://demo.api.ushahidi.io/api/v3/forms/1",
"url": "https://demo.api.ushahidi.io/api/v3/forms/1"
},
"name": "This is a Form",
"description": "This is a form description",
"color": "#ff00dd",
"type": "report",
"disable": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
},
"description": "Parent Form **deprecated**"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"report"
]
},
"disable": {
"type": "boolean"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/530",
"parent": {
"id": "https://demo.api.ushahidi.io/api/v3/forms/1",
"url": "https://demo.api.ushahidi.io/api/v3/forms/1"
},
"name": "This is a Form",
"description": "This is a form description",
"color": "#ff00dd",
"type": "report",
"disable": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
},
"description": "Parent Form **deprecated**"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"report"
]
},
"disable": {
"type": "boolean"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name"
]
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/530",
"parent": {
"id": "https://demo.api.ushahidi.io/api/v3/forms/1",
"url": "https://demo.api.ushahidi.io/api/v3/forms/1"
},
"name": "This is a Form",
"description": "This is a form description",
"color": "#ff00dd",
"type": "report",
"disable": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
},
"description": "Parent Form **deprecated**"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"report"
]
},
"disable": {
"type": "boolean"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Get a FormGET/api/v3/forms/{id}
Example URI
- id
number
(required)ID of the Form
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/530",
"parent": {
"id": "https://demo.api.ushahidi.io/api/v3/forms/1",
"url": "https://demo.api.ushahidi.io/api/v3/forms/1"
},
"name": "This is a Form",
"description": "This is a form description",
"color": "#ff00dd",
"type": "report",
"disable": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
},
"description": "Parent Form **deprecated**"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"report"
]
},
"disable": {
"type": "boolean"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name"
]
}
Update a FormPUT/api/v3/forms/{id}
Example URI
- id
number
(required)ID of the Form
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/530",
"parent": {
"id": "https://demo.api.ushahidi.io/api/v3/forms/1",
"url": "https://demo.api.ushahidi.io/api/v3/forms/1"
},
"name": "This is a Form",
"description": "This is a form description",
"color": "#ff00dd",
"type": "report",
"disable": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
},
"description": "Parent Form **deprecated**"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"report"
]
},
"disable": {
"type": "boolean"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/530",
"parent": {
"id": "https://demo.api.ushahidi.io/api/v3/forms/1",
"url": "https://demo.api.ushahidi.io/api/v3/forms/1"
},
"name": "This is a Form",
"description": "This is a form description",
"color": "#ff00dd",
"type": "report",
"disable": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
},
"description": "Parent Form **deprecated**"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"report"
]
},
"disable": {
"type": "boolean"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name"
]
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/530",
"parent": {
"id": "https://demo.api.ushahidi.io/api/v3/forms/1",
"url": "https://demo.api.ushahidi.io/api/v3/forms/1"
},
"name": "This is a Form",
"description": "This is a form description",
"color": "#ff00dd",
"type": "report",
"disable": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
},
"description": "Parent Form **deprecated**"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"report"
]
},
"disable": {
"type": "boolean"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Delete a FormDELETE/api/v3/forms/{id}
Example URI
- id
number
(required)ID of the Form
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/530",
"parent": {
"id": "https://demo.api.ushahidi.io/api/v3/forms/1",
"url": "https://demo.api.ushahidi.io/api/v3/forms/1"
},
"name": "This is a Form",
"description": "This is a form description",
"color": "#ff00dd",
"type": "report",
"disable": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
},
"description": "Parent Form **deprecated**"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"report"
]
},
"disable": {
"type": "boolean"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"name"
]
}
Form Stages ¶
List All Stages in A FormGET/api/v3/forms/stages{?q}
Example URI
- q
string
(required)
200
Headers
Content-Type: application/json
Body
{
"count": "20",
"results": [
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
"form_id": 1,
"label": "Step 2",
"priority": 1,
"icon": "Hello, world!",
"required": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"limit": "20",
"offset": "0",
"order": "asc",
"orderby": "created",
"curr": "https://demo.api.ushahidi.io/api/v3/stages?offset=0&limit=20",
"next": "https://demo.api.ushahidi.io/api/v3/stages?offset=20&limit=20",
"prev": "https://demo.api.ushahidi.io/api/v3/stages?offset=0&limit=20",
"total_count": 100
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "string"
},
"results": {
"type": "array"
},
"limit": {
"type": "string"
},
"offset": {
"type": "string"
},
"order": {
"type": "string"
},
"orderby": {
"type": "string"
},
"curr": {
"type": "string"
},
"next": {
"type": "string"
},
"prev": {
"type": "string"
},
"total_count": {
"type": "number"
}
}
}
Create a Form StagePOST/api/v3/forms/stages
Example URI
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
"form_id": 1,
"label": "Step 2",
"priority": 1,
"icon": "Hello, world!",
"required": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"form_id": {
"type": "number"
},
"label": {
"type": "string"
},
"priority": {
"type": "number"
},
"icon": {
"type": "string",
"description": "Icon **deprecated**"
},
"required": {
"type": "boolean"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"form_id",
"label"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
"form_id": 1,
"label": "Step 2",
"priority": 1,
"icon": "Hello, world!",
"required": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"form_id": {
"type": "number"
},
"label": {
"type": "string"
},
"priority": {
"type": "number"
},
"icon": {
"type": "string",
"description": "Icon **deprecated**"
},
"required": {
"type": "boolean"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"form_id",
"label"
]
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
"form_id": 1,
"label": "Step 2",
"priority": 1,
"icon": "Hello, world!",
"required": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"form_id": {
"type": "number"
},
"label": {
"type": "string"
},
"priority": {
"type": "number"
},
"icon": {
"type": "string",
"description": "Icon **deprecated**"
},
"required": {
"type": "boolean"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"form_id",
"label"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Get a Form StageGET/api/v3/forms/stages/{id}
Example URI
- id
number
(required)ID of the Form Stage
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
"form_id": 1,
"label": "Step 2",
"priority": 1,
"icon": "Hello, world!",
"required": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"form_id": {
"type": "number"
},
"label": {
"type": "string"
},
"priority": {
"type": "number"
},
"icon": {
"type": "string",
"description": "Icon **deprecated**"
},
"required": {
"type": "boolean"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"form_id",
"label"
]
}
Update a Form StagePUT/api/v3/forms/stages/{id}
Example URI
- id
number
(required)ID of the Form Stage
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
"form_id": 1,
"label": "Step 2",
"priority": 1,
"icon": "Hello, world!",
"required": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"form_id": {
"type": "number"
},
"label": {
"type": "string"
},
"priority": {
"type": "number"
},
"icon": {
"type": "string",
"description": "Icon **deprecated**"
},
"required": {
"type": "boolean"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"form_id",
"label"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
"form_id": 1,
"label": "Step 2",
"priority": 1,
"icon": "Hello, world!",
"required": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"form_id": {
"type": "number"
},
"label": {
"type": "string"
},
"priority": {
"type": "number"
},
"icon": {
"type": "string",
"description": "Icon **deprecated**"
},
"required": {
"type": "boolean"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"form_id",
"label"
]
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
"form_id": 1,
"label": "Step 2",
"priority": 1,
"icon": "Hello, world!",
"required": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"form_id": {
"type": "number"
},
"label": {
"type": "string"
},
"priority": {
"type": "number"
},
"icon": {
"type": "string",
"description": "Icon **deprecated**"
},
"required": {
"type": "boolean"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"form_id",
"label"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Delete a Form StageDELETE/api/v3/forms/stages/{id}
Example URI
- id
number
(required)ID of the Form Stage
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/stages/12",
"form_id": 1,
"label": "Step 2",
"priority": 1,
"icon": "Hello, world!",
"required": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"form_id": {
"type": "number"
},
"label": {
"type": "string"
},
"priority": {
"type": "number"
},
"icon": {
"type": "string",
"description": "Icon **deprecated**"
},
"required": {
"type": "boolean"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"form_id",
"label"
]
}
Form Attributes ¶
List All Attributes In FormGET/api/v3/forms/attributes{?q}
Example URI
- q
string
(required)
200
Headers
Content-Type: application/json
Body
{
"count": "20",
"results": [
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
"label": "Some field",
"instructions": "Fill in the field",
"input": "text",
"type": "varchar",
"required": true,
"default": "Hello, world!",
"priority": 1,
"options": [],
"cardinality": 1,
"config": [],
"form_stage_id": 1,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"limit": "20",
"offset": "0",
"order": "asc",
"orderby": "created",
"curr": "https://demo.api.ushahidi.io/api/v3/attributes?offset=0&limit=20",
"next": "https://demo.api.ushahidi.io/api/v3/attributes?offset=20&limit=20",
"prev": "https://demo.api.ushahidi.io/api/v3/attributes?offset=0&limit=20",
"total_count": 100
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "string"
},
"results": {
"type": "array"
},
"limit": {
"type": "string"
},
"offset": {
"type": "string"
},
"order": {
"type": "string"
},
"orderby": {
"type": "string"
},
"curr": {
"type": "string"
},
"next": {
"type": "string"
},
"prev": {
"type": "string"
},
"total_count": {
"type": "number"
}
}
}
Create a Form AttributePOST/api/v3/forms/attributes
Example URI
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
"label": "Some field",
"instructions": "Fill in the field",
"input": "text",
"type": "varchar",
"required": true,
"default": "Hello, world!",
"priority": 1,
"options": [],
"cardinality": 1,
"config": [],
"form_stage_id": 1,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"label": {
"type": "string"
},
"instructions": {
"type": "string"
},
"input": {
"type": "string"
},
"type": {
"type": "string"
},
"required": {
"type": "boolean"
},
"default": {
"type": "string"
},
"priority": {
"type": "number"
},
"options": {},
"cardinality": {
"type": "number"
},
"config": {},
"form_stage_id": {
"type": "number"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"label",
"input",
"type",
"cardinality",
"form_stage_id"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
"label": "Some field",
"instructions": "Fill in the field",
"input": "text",
"type": "varchar",
"required": true,
"default": "Hello, world!",
"priority": 1,
"options": [],
"cardinality": 1,
"config": [],
"form_stage_id": 1,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"label": {
"type": "string"
},
"instructions": {
"type": "string"
},
"input": {
"type": "string"
},
"type": {
"type": "string"
},
"required": {
"type": "boolean"
},
"default": {
"type": "string"
},
"priority": {
"type": "number"
},
"options": {},
"cardinality": {
"type": "number"
},
"config": {},
"form_stage_id": {
"type": "number"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"label",
"input",
"type",
"cardinality",
"form_stage_id"
]
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
"label": "Some field",
"instructions": "Fill in the field",
"input": "text",
"type": "varchar",
"required": true,
"default": "Hello, world!",
"priority": 1,
"options": [],
"cardinality": 1,
"config": [],
"form_stage_id": 1,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"label": {
"type": "string"
},
"instructions": {
"type": "string"
},
"input": {
"type": "string"
},
"type": {
"type": "string"
},
"required": {
"type": "boolean"
},
"default": {
"type": "string"
},
"priority": {
"type": "number"
},
"options": {},
"cardinality": {
"type": "number"
},
"config": {},
"form_stage_id": {
"type": "number"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"label",
"input",
"type",
"cardinality",
"form_stage_id"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Get a Form AttributeGET/api/v3/forms/attributes/{id}
Example URI
- id
number
(required)ID of the Form Attribute
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
"label": "Some field",
"instructions": "Fill in the field",
"input": "text",
"type": "varchar",
"required": true,
"default": "Hello, world!",
"priority": 1,
"options": [],
"cardinality": 1,
"config": [],
"form_stage_id": 1,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"label": {
"type": "string"
},
"instructions": {
"type": "string"
},
"input": {
"type": "string"
},
"type": {
"type": "string"
},
"required": {
"type": "boolean"
},
"default": {
"type": "string"
},
"priority": {
"type": "number"
},
"options": {},
"cardinality": {
"type": "number"
},
"config": {},
"form_stage_id": {
"type": "number"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"label",
"input",
"type",
"cardinality",
"form_stage_id"
]
}
Update a Form AttributePUT/api/v3/forms/attributes/{id}
Example URI
- id
number
(required)ID of the Form Attribute
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
"label": "Some field",
"instructions": "Fill in the field",
"input": "text",
"type": "varchar",
"required": true,
"default": "Hello, world!",
"priority": 1,
"options": [],
"cardinality": 1,
"config": [],
"form_stage_id": 1,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"label": {
"type": "string"
},
"instructions": {
"type": "string"
},
"input": {
"type": "string"
},
"type": {
"type": "string"
},
"required": {
"type": "boolean"
},
"default": {
"type": "string"
},
"priority": {
"type": "number"
},
"options": {},
"cardinality": {
"type": "number"
},
"config": {},
"form_stage_id": {
"type": "number"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"label",
"input",
"type",
"cardinality",
"form_stage_id"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
"label": "Some field",
"instructions": "Fill in the field",
"input": "text",
"type": "varchar",
"required": true,
"default": "Hello, world!",
"priority": 1,
"options": [],
"cardinality": 1,
"config": [],
"form_stage_id": 1,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"label": {
"type": "string"
},
"instructions": {
"type": "string"
},
"input": {
"type": "string"
},
"type": {
"type": "string"
},
"required": {
"type": "boolean"
},
"default": {
"type": "string"
},
"priority": {
"type": "number"
},
"options": {},
"cardinality": {
"type": "number"
},
"config": {},
"form_stage_id": {
"type": "number"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"label",
"input",
"type",
"cardinality",
"form_stage_id"
]
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
"label": "Some field",
"instructions": "Fill in the field",
"input": "text",
"type": "varchar",
"required": true,
"default": "Hello, world!",
"priority": 1,
"options": [],
"cardinality": 1,
"config": [],
"form_stage_id": 1,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"label": {
"type": "string"
},
"instructions": {
"type": "string"
},
"input": {
"type": "string"
},
"type": {
"type": "string"
},
"required": {
"type": "boolean"
},
"default": {
"type": "string"
},
"priority": {
"type": "number"
},
"options": {},
"cardinality": {
"type": "number"
},
"config": {},
"form_stage_id": {
"type": "number"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"label",
"input",
"type",
"cardinality",
"form_stage_id"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Delete a Form AttributeDELETE/api/v3/forms/attributes/{id}
Example URI
- id
number
(required)ID of the Form Attribute
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/forms/1/attributes/15",
"label": "Some field",
"instructions": "Fill in the field",
"input": "text",
"type": "varchar",
"required": true,
"default": "Hello, world!",
"priority": 1,
"options": [],
"cardinality": 1,
"config": [],
"form_stage_id": 1,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"label": {
"type": "string"
},
"instructions": {
"type": "string"
},
"input": {
"type": "string"
},
"type": {
"type": "string"
},
"required": {
"type": "boolean"
},
"default": {
"type": "string"
},
"priority": {
"type": "number"
},
"options": {},
"cardinality": {
"type": "number"
},
"config": {},
"form_stage_id": {
"type": "number"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"label",
"input",
"type",
"cardinality",
"form_stage_id"
]
}
Messages & Contacts ¶
Messages ¶
List All MessagesGET/api/v3/messages{?q}
Example URI
- q
string
(required)
200
Headers
Content-Type: application/json
Body
{
"count": "20",
"results": [
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/messages/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/messages/1"
},
"contact_id": 1,
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"post_id": 13,
"data_provider": "smssync",
"data_provider_message_id": null,
"title": "",
"message": "",
"type": "sms",
"status": "pending",
"direction": "outgoing",
"additional_data": null,
"notification_post_id": null,
"created": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"limit": "20",
"offset": "0",
"order": "asc",
"orderby": "created",
"curr": "https://demo.api.ushahidi.io/api/v3/messages?offset=0&limit=20",
"next": "https://demo.api.ushahidi.io/api/v3/messages?offset=20&limit=20",
"prev": "https://demo.api.ushahidi.io/api/v3/messages?offset=0&limit=20",
"total_count": 100
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "string"
},
"results": {
"type": "array"
},
"limit": {
"type": "string"
},
"offset": {
"type": "string"
},
"order": {
"type": "string"
},
"orderby": {
"type": "string"
},
"curr": {
"type": "string"
},
"next": {
"type": "string"
},
"prev": {
"type": "string"
},
"total_count": {
"type": "number"
}
}
}
Create a MessagePOST/api/v3/messages
Example URI
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/messages/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/messages/1"
},
"contact_id": 1,
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"post_id": 13,
"data_provider": "smssync",
"data_provider_message_id": null,
"title": "",
"message": "",
"type": "sms",
"status": "pending",
"direction": "outgoing",
"additional_data": null,
"notification_post_id": null,
"created": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"contact_id": {
"type": "number"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"post_id": {
"type": [
"number",
"null"
]
},
"data_provider": {
"type": "string"
},
"data_provider_message_id": {
"type": [
"string",
"null"
]
},
"title": {
"type": "string"
},
"message": {
"type": "string",
"description": "<!-- + datetime -- unused -->\n"
},
"type": {
"type": "string",
"enum": [
"sms",
"email",
"twitter",
"phone"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"received",
"sent",
"pending_poll",
"unknown"
]
},
"direction": {
"type": "string",
"enum": [
"outgoing",
"incoming"
]
},
"additional_data": {
"type": [
"object",
"null"
],
"properties": {},
"description": "Additional data from source"
},
"notification_post_id": {
"type": [
"number",
"null"
],
"description": "When message is a notification, contains post_id we're notifying users about"
},
"created": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"message"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/messages/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/messages/1"
},
"contact_id": 1,
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"post_id": 13,
"data_provider": "smssync",
"data_provider_message_id": null,
"title": "",
"message": "",
"type": "sms",
"status": "pending",
"direction": "outgoing",
"additional_data": null,
"notification_post_id": null,
"created": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"contact_id": {
"type": "number"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"post_id": {
"type": [
"number",
"null"
]
},
"data_provider": {
"type": "string"
},
"data_provider_message_id": {
"type": [
"string",
"null"
]
},
"title": {
"type": "string"
},
"message": {
"type": "string",
"description": "<!-- + datetime -- unused -->\n"
},
"type": {
"type": "string",
"enum": [
"sms",
"email",
"twitter",
"phone"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"received",
"sent",
"pending_poll",
"unknown"
]
},
"direction": {
"type": "string",
"enum": [
"outgoing",
"incoming"
]
},
"additional_data": {
"type": [
"object",
"null"
],
"properties": {},
"description": "Additional data from source"
},
"notification_post_id": {
"type": [
"number",
"null"
],
"description": "When message is a notification, contains post_id we're notifying users about"
},
"created": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"message"
]
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/messages/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/messages/1"
},
"contact_id": 1,
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"post_id": 13,
"data_provider": "smssync",
"data_provider_message_id": null,
"title": "",
"message": "",
"type": "sms",
"status": "pending",
"direction": "outgoing",
"additional_data": null,
"notification_post_id": null,
"created": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"contact_id": {
"type": "number"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"post_id": {
"type": [
"number",
"null"
]
},
"data_provider": {
"type": "string"
},
"data_provider_message_id": {
"type": [
"string",
"null"
]
},
"title": {
"type": "string"
},
"message": {
"type": "string",
"description": "<!-- + datetime -- unused -->\n"
},
"type": {
"type": "string",
"enum": [
"sms",
"email",
"twitter",
"phone"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"received",
"sent",
"pending_poll",
"unknown"
]
},
"direction": {
"type": "string",
"enum": [
"outgoing",
"incoming"
]
},
"additional_data": {
"type": [
"object",
"null"
],
"properties": {},
"description": "Additional data from source"
},
"notification_post_id": {
"type": [
"number",
"null"
],
"description": "When message is a notification, contains post_id we're notifying users about"
},
"created": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"message"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Individual Message ¶
Get a MessageGET/api/v3/messages/{id}
Example URI
- id
number
(required)ID of the Message
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/messages/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/messages/1"
},
"contact_id": 1,
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"post_id": 13,
"data_provider": "smssync",
"data_provider_message_id": null,
"title": "",
"message": "",
"type": "sms",
"status": "pending",
"direction": "outgoing",
"additional_data": null,
"notification_post_id": null,
"created": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"contact_id": {
"type": "number"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"post_id": {
"type": [
"number",
"null"
]
},
"data_provider": {
"type": "string"
},
"data_provider_message_id": {
"type": [
"string",
"null"
]
},
"title": {
"type": "string"
},
"message": {
"type": "string",
"description": "<!-- + datetime -- unused -->\n"
},
"type": {
"type": "string",
"enum": [
"sms",
"email",
"twitter",
"phone"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"received",
"sent",
"pending_poll",
"unknown"
]
},
"direction": {
"type": "string",
"enum": [
"outgoing",
"incoming"
]
},
"additional_data": {
"type": [
"object",
"null"
],
"properties": {},
"description": "Additional data from source"
},
"notification_post_id": {
"type": [
"number",
"null"
],
"description": "When message is a notification, contains post_id we're notifying users about"
},
"created": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"message"
]
}
Get a Post for MessageGET/api/v3/messages/{id}/post
Example URI
- id
number
(required)ID of the Contact
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://quakemap.api.ushahidi.io/api/v3/posts/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/posts/1"
},
"title": "Need help",
"content": "Asrang VDC of Gorkha hasn't received any help yet. Need relief efforts",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"form": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/forms/1"
},
"user": {
"id": "1",
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"message": "",
"color": "#2274B4",
"type": "report",
"slug": "chhokang-paro-village-upper-tsum-medical-ampamp-food-assistance-urgently-required-560b50a52fe02",
"author_email": "null",
"author_realname": "null",
"status": "published",
"locale": "en_us",
"published_to": [],
"completed_stages": [],
"values": {
"AttributeID1": [
"Value 1",
"Value 2"
],
"AttributeID2": [
{
"lat": "2.456",
"lon": "1.234"
}
]
},
"tags": [
{
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/tags/1"
}
],
"sets": [
"1",
"2"
],
"source": "SMS",
"contact": "rjmackay",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"title": {
"type": "string"
},
"content": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": "string"
},
"form": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"user": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"message": {
"type": "string"
},
"color": {
"type": "string"
},
"type": {
"type": "string"
},
"slug": {
"type": "string"
},
"author_email": {
"type": "string"
},
"author_realname": {
"type": "string"
},
"status": {
"type": "string"
},
"locale": {
"type": "string"
},
"published_to": {},
"completed_stages": {
"type": "array"
},
"values": {
"type": "object",
"properties": {
"AttributeID1": {
"type": "array"
},
"AttributeID2": {
"type": "array"
}
},
"description": "Custom field values. Object keys map to Form Attribute key field"
},
"tags": {
"type": "array"
},
"sets": {
"type": "array"
},
"source": {
"type": "string",
"description": "Original Message source ie. SMS, Twitter"
},
"contact": {
"type": "string",
"description": "Contact Identifier ie. SMS number, twitter handle"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"title",
"content"
]
}
Update a MessagePUT/api/v3/messages/{id}
Example URI
- id
number
(required)ID of the Message
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/messages/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/messages/1"
},
"contact_id": 1,
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"post_id": 13,
"data_provider": "smssync",
"data_provider_message_id": null,
"title": "",
"message": "",
"type": "sms",
"status": "pending",
"direction": "outgoing",
"additional_data": null,
"notification_post_id": null,
"created": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"contact_id": {
"type": "number"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"post_id": {
"type": [
"number",
"null"
]
},
"data_provider": {
"type": "string"
},
"data_provider_message_id": {
"type": [
"string",
"null"
]
},
"title": {
"type": "string"
},
"message": {
"type": "string",
"description": "<!-- + datetime -- unused -->\n"
},
"type": {
"type": "string",
"enum": [
"sms",
"email",
"twitter",
"phone"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"received",
"sent",
"pending_poll",
"unknown"
]
},
"direction": {
"type": "string",
"enum": [
"outgoing",
"incoming"
]
},
"additional_data": {
"type": [
"object",
"null"
],
"properties": {},
"description": "Additional data from source"
},
"notification_post_id": {
"type": [
"number",
"null"
],
"description": "When message is a notification, contains post_id we're notifying users about"
},
"created": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"message"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/messages/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/messages/1"
},
"contact_id": 1,
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"post_id": 13,
"data_provider": "smssync",
"data_provider_message_id": null,
"title": "",
"message": "",
"type": "sms",
"status": "pending",
"direction": "outgoing",
"additional_data": null,
"notification_post_id": null,
"created": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"contact_id": {
"type": "number"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"post_id": {
"type": [
"number",
"null"
]
},
"data_provider": {
"type": "string"
},
"data_provider_message_id": {
"type": [
"string",
"null"
]
},
"title": {
"type": "string"
},
"message": {
"type": "string",
"description": "<!-- + datetime -- unused -->\n"
},
"type": {
"type": "string",
"enum": [
"sms",
"email",
"twitter",
"phone"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"received",
"sent",
"pending_poll",
"unknown"
]
},
"direction": {
"type": "string",
"enum": [
"outgoing",
"incoming"
]
},
"additional_data": {
"type": [
"object",
"null"
],
"properties": {},
"description": "Additional data from source"
},
"notification_post_id": {
"type": [
"number",
"null"
],
"description": "When message is a notification, contains post_id we're notifying users about"
},
"created": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"message"
]
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/messages/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/messages/1"
},
"contact_id": 1,
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"post_id": 13,
"data_provider": "smssync",
"data_provider_message_id": null,
"title": "",
"message": "",
"type": "sms",
"status": "pending",
"direction": "outgoing",
"additional_data": null,
"notification_post_id": null,
"created": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"contact_id": {
"type": "number"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"post_id": {
"type": [
"number",
"null"
]
},
"data_provider": {
"type": "string"
},
"data_provider_message_id": {
"type": [
"string",
"null"
]
},
"title": {
"type": "string"
},
"message": {
"type": "string",
"description": "<!-- + datetime -- unused -->\n"
},
"type": {
"type": "string",
"enum": [
"sms",
"email",
"twitter",
"phone"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"received",
"sent",
"pending_poll",
"unknown"
]
},
"direction": {
"type": "string",
"enum": [
"outgoing",
"incoming"
]
},
"additional_data": {
"type": [
"object",
"null"
],
"properties": {},
"description": "Additional data from source"
},
"notification_post_id": {
"type": [
"number",
"null"
],
"description": "When message is a notification, contains post_id we're notifying users about"
},
"created": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"message"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Delete a MessageDELETE/api/v3/messages/{id}
Example URI
- id
number
(required)ID of the Message
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/messages/530",
"parent": {
"id": "1",
"url": "https://demo.api.ushahidi.io/api/v3/messages/1"
},
"contact_id": 1,
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"post_id": 13,
"data_provider": "smssync",
"data_provider_message_id": null,
"title": "",
"message": "",
"type": "sms",
"status": "pending",
"direction": "outgoing",
"additional_data": null,
"notification_post_id": null,
"created": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"parent": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"contact_id": {
"type": "number"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"post_id": {
"type": [
"number",
"null"
]
},
"data_provider": {
"type": "string"
},
"data_provider_message_id": {
"type": [
"string",
"null"
]
},
"title": {
"type": "string"
},
"message": {
"type": "string",
"description": "<!-- + datetime -- unused -->\n"
},
"type": {
"type": "string",
"enum": [
"sms",
"email",
"twitter",
"phone"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"received",
"sent",
"pending_poll",
"unknown"
]
},
"direction": {
"type": "string",
"enum": [
"outgoing",
"incoming"
]
},
"additional_data": {
"type": [
"object",
"null"
],
"properties": {},
"description": "Additional data from source"
},
"notification_post_id": {
"type": [
"number",
"null"
],
"description": "When message is a notification, contains post_id we're notifying users about"
},
"created": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"message"
]
}
Contacts ¶
List All ContactsGET/api/v3/contacts{?q}
Example URI
- q
string
(required)
200
Headers
Content-Type: application/json
Body
{
"count": "20",
"results": [
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/contact/530",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"data_provider": "Hello, world!",
"type": "email",
"contact": "987654321",
"can_notify": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"limit": "20",
"offset": "0",
"order": "asc",
"orderby": "created",
"curr": "https://demo.api.ushahidi.io/api/v3/contacts?offset=0&limit=20",
"next": "https://demo.api.ushahidi.io/api/v3/contacts?offset=20&limit=20",
"prev": "https://demo.api.ushahidi.io/api/v3/contacts?offset=0&limit=20",
"total_count": 100
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "string"
},
"results": {
"type": "array"
},
"limit": {
"type": "string"
},
"offset": {
"type": "string"
},
"order": {
"type": "string"
},
"orderby": {
"type": "string"
},
"curr": {
"type": "string"
},
"next": {
"type": "string"
},
"prev": {
"type": "string"
},
"total_count": {
"type": "number"
}
}
}
Create a ContactPOST/api/v3/contacts
Example URI
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/contact/530",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"data_provider": "Hello, world!",
"type": "email",
"contact": "987654321",
"can_notify": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"data_provider": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string",
"enum": [
"email",
"twitter",
"phone"
]
},
"contact": {
"type": "string"
},
"can_notify": {
"type": "boolean"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"contact"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/contact/530",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"data_provider": "Hello, world!",
"type": "email",
"contact": "987654321",
"can_notify": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"data_provider": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string",
"enum": [
"email",
"twitter",
"phone"
]
},
"contact": {
"type": "string"
},
"can_notify": {
"type": "boolean"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"contact"
]
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/contact/530",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"data_provider": "Hello, world!",
"type": "email",
"contact": "987654321",
"can_notify": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"data_provider": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string",
"enum": [
"email",
"twitter",
"phone"
]
},
"contact": {
"type": "string"
},
"can_notify": {
"type": "boolean"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"contact"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Individual Contact ¶
Get a ContactGET/api/v3/contacts/{id}
Example URI
- id
number
(required)ID of the Contact
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/contact/530",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"data_provider": "Hello, world!",
"type": "email",
"contact": "987654321",
"can_notify": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"data_provider": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string",
"enum": [
"email",
"twitter",
"phone"
]
},
"contact": {
"type": "string"
},
"can_notify": {
"type": "boolean"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"contact"
]
}
Update a ContactPUT/api/v3/contacts/{id}
Example URI
- id
number
(required)ID of the Contact
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/contact/530",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"data_provider": "Hello, world!",
"type": "email",
"contact": "987654321",
"can_notify": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"data_provider": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string",
"enum": [
"email",
"twitter",
"phone"
]
},
"contact": {
"type": "string"
},
"can_notify": {
"type": "boolean"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"contact"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/contact/530",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"data_provider": "Hello, world!",
"type": "email",
"contact": "987654321",
"can_notify": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"data_provider": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string",
"enum": [
"email",
"twitter",
"phone"
]
},
"contact": {
"type": "string"
},
"can_notify": {
"type": "boolean"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"contact"
]
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/contact/530",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"data_provider": "Hello, world!",
"type": "email",
"contact": "987654321",
"can_notify": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"data_provider": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string",
"enum": [
"email",
"twitter",
"phone"
]
},
"contact": {
"type": "string"
},
"can_notify": {
"type": "boolean"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"contact"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Delete a ContactDELETE/api/v3/contacts/{id}
Example URI
- id
number
(required)ID of the Contact
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/contact/530",
"user": {
"id": 1,
"url": "https://quakemap.api.ushahidi.io/api/v3/users/1"
},
"data_provider": "Hello, world!",
"type": "email",
"contact": "987654321",
"can_notify": false,
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"user": {
"type": [
"object",
"null"
],
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
}
}
},
"data_provider": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string",
"enum": [
"email",
"twitter",
"phone"
]
},
"contact": {
"type": "string"
},
"can_notify": {
"type": "boolean"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"contact"
]
}
Users & Roles ¶
Users ¶
List All UsersGET/api/v3/users{?q}
Example URI
- q
string
(required)
200
Headers
Content-Type: application/json
Body
{
"count": "20",
"results": [
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/users/530",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"email": "test@ushahidi.com",
"realname": "Test User",
"logins": 2,
"failed_attempts": 3,
"last_login": "2014-11-11T08:40:51+00:00",
"last_attempt": "2014-11-11T08:40:51+00:00",
"role": "Hello, world!",
"gravatar": "982d5f5e2b53f4843ca1fe521025b342",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"limit": "20",
"offset": "0",
"order": "asc",
"orderby": "created",
"curr": "https://demo.api.ushahidi.io/api/v3/users?offset=0&limit=20",
"next": "https://demo.api.ushahidi.io/api/v3/users?offset=20&limit=20",
"prev": "https://demo.api.ushahidi.io/api/v3/users?offset=0&limit=20",
"total_count": 100
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "string"
},
"results": {
"type": "array"
},
"limit": {
"type": "string"
},
"offset": {
"type": "string"
},
"order": {
"type": "string"
},
"orderby": {
"type": "string"
},
"curr": {
"type": "string"
},
"next": {
"type": "string"
},
"prev": {
"type": "string"
},
"total_count": {
"type": "number"
}
}
}
Create a UserPOST/api/v3/users
Example URI
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/users/530",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"email": "test@ushahidi.com",
"realname": "Test User",
"logins": 2,
"failed_attempts": 3,
"last_login": "2014-11-11T08:40:51+00:00",
"last_attempt": "2014-11-11T08:40:51+00:00",
"role": "Hello, world!",
"gravatar": "982d5f5e2b53f4843ca1fe521025b342",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"email": {
"type": "string"
},
"realname": {
"type": "string"
},
"logins": {
"type": "number"
},
"failed_attempts": {
"type": "number"
},
"last_login": {
"type": [
"string",
"null"
]
},
"last_attempt": {
"type": [
"string",
"null"
]
},
"role": {
"type": "string"
},
"gravatar": {
"type": "string",
"description": "Gravatar Hash"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
}
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/users/530",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"email": "test@ushahidi.com",
"realname": "Test User",
"logins": 2,
"failed_attempts": 3,
"last_login": "2014-11-11T08:40:51+00:00",
"last_attempt": "2014-11-11T08:40:51+00:00",
"role": "Hello, world!",
"gravatar": "982d5f5e2b53f4843ca1fe521025b342",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"email": {
"type": "string"
},
"realname": {
"type": "string"
},
"logins": {
"type": "number"
},
"failed_attempts": {
"type": "number"
},
"last_login": {
"type": [
"string",
"null"
]
},
"last_attempt": {
"type": [
"string",
"null"
]
},
"role": {
"type": "string"
},
"gravatar": {
"type": "string",
"description": "Gravatar Hash"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
}
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/users/530",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"email": "test@ushahidi.com",
"realname": "Test User",
"logins": 2,
"failed_attempts": 3,
"last_login": "2014-11-11T08:40:51+00:00",
"last_attempt": "2014-11-11T08:40:51+00:00",
"role": "Hello, world!",
"gravatar": "982d5f5e2b53f4843ca1fe521025b342",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"email": {
"type": "string"
},
"realname": {
"type": "string"
},
"logins": {
"type": "number"
},
"failed_attempts": {
"type": "number"
},
"last_login": {
"type": [
"string",
"null"
]
},
"last_attempt": {
"type": [
"string",
"null"
]
},
"role": {
"type": "string"
},
"gravatar": {
"type": "string",
"description": "Gravatar Hash"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
}
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Individual User ¶
Get a UserGET/api/v3/users/{id}
Example URI
- id
number
(required)ID of the User
with access to full user
Headers
Authorization: Bearer someAdminToken
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/users/530",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"email": "test@ushahidi.com",
"realname": "Test User",
"logins": 2,
"failed_attempts": 3,
"last_login": "2014-11-11T08:40:51+00:00",
"last_attempt": "2014-11-11T08:40:51+00:00",
"role": "Hello, world!",
"gravatar": "982d5f5e2b53f4843ca1fe521025b342",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"email": {
"type": "string"
},
"realname": {
"type": "string"
},
"logins": {
"type": "number"
},
"failed_attempts": {
"type": "number"
},
"last_login": {
"type": [
"string",
"null"
]
},
"last_attempt": {
"type": [
"string",
"null"
]
},
"role": {
"type": "string"
},
"gravatar": {
"type": "string",
"description": "Gravatar Hash"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
}
}
with access to partial user
Headers
Authorization: Bearer someClientOnlyToken
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/users/530",
"realname": "Test User",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"realname": {
"type": "string"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
}
}
Get Current UserGET/api/v3/users/me
This is a special case of /api/v3/users/{id}
. With id=me
we load
the user associated with the current oauth token.
Example URI
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/users/530",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"email": "test@ushahidi.com",
"realname": "Test User",
"logins": 2,
"failed_attempts": 3,
"last_login": "2014-11-11T08:40:51+00:00",
"last_attempt": "2014-11-11T08:40:51+00:00",
"role": "Hello, world!",
"gravatar": "982d5f5e2b53f4843ca1fe521025b342",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"email": {
"type": "string"
},
"realname": {
"type": "string"
},
"logins": {
"type": "number"
},
"failed_attempts": {
"type": "number"
},
"last_login": {
"type": [
"string",
"null"
]
},
"last_attempt": {
"type": [
"string",
"null"
]
},
"role": {
"type": "string"
},
"gravatar": {
"type": "string",
"description": "Gravatar Hash"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
}
}
Update a UserPUT/api/v3/users/{id}
Example URI
- id
number
(required)ID of the User
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/users/530",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"email": "test@ushahidi.com",
"realname": "Test User",
"logins": 2,
"failed_attempts": 3,
"last_login": "2014-11-11T08:40:51+00:00",
"last_attempt": "2014-11-11T08:40:51+00:00",
"role": "Hello, world!",
"gravatar": "982d5f5e2b53f4843ca1fe521025b342",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"email": {
"type": "string"
},
"realname": {
"type": "string"
},
"logins": {
"type": "number"
},
"failed_attempts": {
"type": "number"
},
"last_login": {
"type": [
"string",
"null"
]
},
"last_attempt": {
"type": [
"string",
"null"
]
},
"role": {
"type": "string"
},
"gravatar": {
"type": "string",
"description": "Gravatar Hash"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
}
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/users/530",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"email": "test@ushahidi.com",
"realname": "Test User",
"logins": 2,
"failed_attempts": 3,
"last_login": "2014-11-11T08:40:51+00:00",
"last_attempt": "2014-11-11T08:40:51+00:00",
"role": "Hello, world!",
"gravatar": "982d5f5e2b53f4843ca1fe521025b342",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"email": {
"type": "string"
},
"realname": {
"type": "string"
},
"logins": {
"type": "number"
},
"failed_attempts": {
"type": "number"
},
"last_login": {
"type": [
"string",
"null"
]
},
"last_attempt": {
"type": [
"string",
"null"
]
},
"role": {
"type": "string"
},
"gravatar": {
"type": "string",
"description": "Gravatar Hash"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
}
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/users/530",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"email": "test@ushahidi.com",
"realname": "Test User",
"logins": 2,
"failed_attempts": 3,
"last_login": "2014-11-11T08:40:51+00:00",
"last_attempt": "2014-11-11T08:40:51+00:00",
"role": "Hello, world!",
"gravatar": "982d5f5e2b53f4843ca1fe521025b342",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"email": {
"type": "string"
},
"realname": {
"type": "string"
},
"logins": {
"type": "number"
},
"failed_attempts": {
"type": "number"
},
"last_login": {
"type": [
"string",
"null"
]
},
"last_attempt": {
"type": [
"string",
"null"
]
},
"role": {
"type": "string"
},
"gravatar": {
"type": "string",
"description": "Gravatar Hash"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
}
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Delete a UserDELETE/api/v3/users/{id}
Example URI
- id
number
(required)ID of the User
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/users/530",
"created": "2014-11-11T08:40:51+00:00",
"updated": "2014-11-11T08:40:51+00:00",
"email": "test@ushahidi.com",
"realname": "Test User",
"logins": 2,
"failed_attempts": 3,
"last_login": "2014-11-11T08:40:51+00:00",
"last_attempt": "2014-11-11T08:40:51+00:00",
"role": "Hello, world!",
"gravatar": "982d5f5e2b53f4843ca1fe521025b342",
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"created": {
"type": "string"
},
"updated": {
"type": [
"string",
"null"
]
},
"email": {
"type": "string"
},
"realname": {
"type": "string"
},
"logins": {
"type": "number"
},
"failed_attempts": {
"type": "number"
},
"last_login": {
"type": [
"string",
"null"
]
},
"last_attempt": {
"type": [
"string",
"null"
]
},
"role": {
"type": "string"
},
"gravatar": {
"type": "string",
"description": "Gravatar Hash"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
}
}
Roles ¶
List All RolesGET/api/v3/roles{?q}
Example URI
- q
string
(required)
200
Headers
Content-Type: application/json
Body
{
"count": "20",
"results": [
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/roles/530",
"name": "Hello, world!",
"display_name": "Hello, world!",
"description": "Hello, world!",
"permissions": [
"Manage Users",
"Manage Posts",
"Manage Settings",
"Bulk Data Import"
],
"protected": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"limit": "20",
"offset": "0",
"order": "asc",
"orderby": "created",
"curr": "https://demo.api.ushahidi.io/api/v3/roles?offset=0&limit=20",
"next": "https://demo.api.ushahidi.io/api/v3/roles?offset=20&limit=20",
"prev": "https://demo.api.ushahidi.io/api/v3/roles?offset=0&limit=20",
"total_count": 100
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "string"
},
"results": {
"type": "array"
},
"limit": {
"type": "string"
},
"offset": {
"type": "string"
},
"order": {
"type": "string"
},
"orderby": {
"type": "string"
},
"curr": {
"type": "string"
},
"next": {
"type": "string"
},
"prev": {
"type": "string"
},
"total_count": {
"type": "number"
}
}
}
Create a RolePOST/api/v3/roles
Example URI
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/roles/530",
"name": "Hello, world!",
"display_name": "Hello, world!",
"description": "Hello, world!",
"permissions": [
"Manage Users",
"Manage Posts",
"Manage Settings",
"Bulk Data Import"
],
"protected": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"display_name": {
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
},
"permissions": {
"type": "array"
},
"protected": {
"type": "boolean",
"description": "Can this role be modified/deleted?"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"protected"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/roles/530",
"name": "Hello, world!",
"display_name": "Hello, world!",
"description": "Hello, world!",
"permissions": [
"Manage Users",
"Manage Posts",
"Manage Settings",
"Bulk Data Import"
],
"protected": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"display_name": {
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
},
"permissions": {
"type": "array"
},
"protected": {
"type": "boolean",
"description": "Can this role be modified/deleted?"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"protected"
]
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/roles/530",
"name": "Hello, world!",
"display_name": "Hello, world!",
"description": "Hello, world!",
"permissions": [
"Manage Users",
"Manage Posts",
"Manage Settings",
"Bulk Data Import"
],
"protected": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"display_name": {
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
},
"permissions": {
"type": "array"
},
"protected": {
"type": "boolean",
"description": "Can this role be modified/deleted?"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"protected"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Individual Role ¶
Get a RoleGET/api/v3/roles/{id}
Example URI
- id
number
(required)ID of the Role
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/roles/530",
"name": "Hello, world!",
"display_name": "Hello, world!",
"description": "Hello, world!",
"permissions": [
"Manage Users",
"Manage Posts",
"Manage Settings",
"Bulk Data Import"
],
"protected": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"display_name": {
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
},
"permissions": {
"type": "array"
},
"protected": {
"type": "boolean",
"description": "Can this role be modified/deleted?"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"protected"
]
}
Update a RolePUT/api/v3/roles/{id}
Example URI
- id
number
(required)ID of the Role
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/roles/530",
"name": "Hello, world!",
"display_name": "Hello, world!",
"description": "Hello, world!",
"permissions": [
"Manage Users",
"Manage Posts",
"Manage Settings",
"Bulk Data Import"
],
"protected": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"display_name": {
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
},
"permissions": {
"type": "array"
},
"protected": {
"type": "boolean",
"description": "Can this role be modified/deleted?"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"protected"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/roles/530",
"name": "Hello, world!",
"display_name": "Hello, world!",
"description": "Hello, world!",
"permissions": [
"Manage Users",
"Manage Posts",
"Manage Settings",
"Bulk Data Import"
],
"protected": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"display_name": {
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
},
"permissions": {
"type": "array"
},
"protected": {
"type": "boolean",
"description": "Can this role be modified/deleted?"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"protected"
]
}
With invalid data
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/roles/530",
"name": "Hello, world!",
"display_name": "Hello, world!",
"description": "Hello, world!",
"permissions": [
"Manage Users",
"Manage Posts",
"Manage Settings",
"Bulk Data Import"
],
"protected": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"display_name": {
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
},
"permissions": {
"type": "array"
},
"protected": {
"type": "boolean",
"description": "Can this role be modified/deleted?"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"protected"
]
}
422
Headers
Content-Type: application/json
Body
{
"errors": [
{
"status": 422,
"title": "Validation Error"
},
{
"status": 422,
"title": "Field is required",
"source": {
"pointer": "/field"
}
}
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"type": "array"
}
},
"required": [
"errors"
]
}
Delete a RoleDELETE/api/v3/roles/{id}
Example URI
- id
number
(required)ID of the Role
200
Headers
Content-Type: application/json
Body
{
"id": 530,
"url": "https://demo.api.ushahidi.io/api/v3/roles/530",
"name": "Hello, world!",
"display_name": "Hello, world!",
"description": "Hello, world!",
"permissions": [
"Manage Users",
"Manage Posts",
"Manage Settings",
"Bulk Data Import"
],
"protected": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "number"
},
"url": {
"type": "string"
},
"name": {
"type": "string"
},
"display_name": {
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
},
"permissions": {
"type": "array"
},
"protected": {
"type": "boolean",
"description": "Can this role be modified/deleted?"
},
"allowed_privileges": {
"type": "array",
"description": "Allowed privileges on this resource"
}
},
"required": [
"protected"
]
}
Config ¶
Config ¶
List All Config GroupsGET/api/v3/config
Example URI
200
Get a Config GroupGET/api/v3/config/
Example URI
200
Update a Config GroupPUT/api/v3/config/
Example URI
200
Data Providers ¶
Migrations ¶
Migrations ¶
Get Migration StatusGET/api/v3/migration
Example URI
200
Headers
Content-Type: application/json
MigratePOST/api/v3/migration/migrate
Example URI
200
Headers
Content-Type: application/json
RollbackPOST/api/v3/migration/rollback
Example URI
200
Headers
Content-Type: application/json
Get Migration StatusGET/api/v3/migration/status
Example URI
200
Headers
Content-Type: application/json
Run migrations unauthenticated ¶
Run migrationsGET/migrate
This endpoint exists to help bootstrap Ushahidi before the tables are created and without command line access. It can be run without authentication
Example URI
200
Headers
Content-Type: application/json