Data parameter determine which relations of the survey will be returned
translations
Data parameter determine which fields of the survey will be returned
id,name
GET /api/v5/surveys/100 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"results": [
{
"id": 1,
"name": "text",
"translations": {
"name": "text",
"description": "text",
"allOf": {
"es": {
"name": "text",
"description": "text"
}
}
}
}
]
}
Data parameter determine which fields of the survey will be returned
id,name
Data parameter determine which relations of the survey will be returned
translation
GET /api/v5/surveys HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
OK
{
"results": [
{
"id": 1,
"name": "text",
"translations": {
"name": "text",
"description": "text",
"allOf": {
"es": {
"name": "text",
"description": "text"
}
}
}
}
]
}
{"name":"test2","description":"test desc 2","base_language":"en-US","require_approval":true,"everyone_can_create":true,"translations":{},"tasks":[{"priority":0,"required":false,"type":"post","label":"Post","show_when_published":true,"task_is_internal_only":false,"translations":{},"fields":[{"cardinality":0,"input":"text","priority":1,"required":true,"label":"Title","type":"title","config":{},"form_stage_id":"interim_id_0","translations":{},"$$hashKey":"object:830"},{"cardinality":0,"input":"text","priority":2,"required":true,"label":"Description","type":"description","options":[],"config":{},"form_stage_id":"interim_id_1","translations":{},"$$hashKey":"object:831"}],"is_public":true},{"required":false,"fields":[{"required":false,"options":[],"config":{},"priority":0,"translations":{},"label":"field 2","type":"varchar","input":"text","description":"A sentence or less","$$hashKey":"object:893","instructions":"","form_stage_id":"interim_id_3"}],"type":"task","show_when_published":false,"task_is_internal_only":true,"label":"task 2","priority":1,"$$hashKey":"object:867"}],"enabled_languages":{"default":"en-US","available":[]}}
POST /api/v5/surveys HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 1139
{
"name": "test2",
"description": "test desc 2",
"base_language": "en-US",
"require_approval": true,
"everyone_can_create": true,
"translations": {},
"tasks": [
{
"priority": 0,
"required": false,
"type": "post",
"label": "Post",
"show_when_published": true,
"task_is_internal_only": false,
"translations": {},
"fields": [
{
"cardinality": 0,
"input": "text",
"priority": 1,
"required": true,
"label": "Title",
"type": "title",
"config": {},
"form_stage_id": "interim_id_0",
"translations": {},
"$$hashKey": "object:830"
},
{
"cardinality": 0,
"input": "text",
"priority": 2,
"required": true,
"label": "Description",
"type": "description",
"options": [],
"config": {},
"form_stage_id": "interim_id_1",
"translations": {},
"$$hashKey": "object:831"
}
],
"is_public": true
},
{
"required": false,
"fields": [
{
"required": false,
"options": [],
"config": {},
"priority": 0,
"translations": {},
"label": "field 2",
"type": "varchar",
"input": "text",
"description": "A sentence or less",
"$$hashKey": "object:893",
"instructions": "",
"form_stage_id": "interim_id_3"
}
],
"type": "task",
"show_when_published": false,
"task_is_internal_only": true,
"label": "task 2",
"priority": 1,
"$$hashKey": "object:867"
}
],
"enabled_languages": {
"default": "en-US",
"available": []
}
}
{
"results": [
{
"id": 1,
"name": "text",
"translations": {
"name": "text",
"description": "text",
"allOf": {
"es": {
"name": "text",
"description": "text"
}
}
}
}
]
}
{"name":"test2","description":"test desc 2","base_language":"en-US","require_approval":true,"everyone_can_create":true,"translations":{},"tasks":[{"priority":0,"required":false,"type":"post","label":"Post","show_when_published":true,"task_is_internal_only":false,"translations":{},"fields":[{"cardinality":0,"input":"text","priority":1,"required":true,"label":"Title","type":"title","config":{},"form_stage_id":"interim_id_0","translations":{},"$$hashKey":"object:830"},{"cardinality":0,"input":"text","priority":2,"required":true,"label":"Description","type":"description","options":[],"config":{},"form_stage_id":"interim_id_1","translations":{},"$$hashKey":"object:831"}],"is_public":true},{"required":false,"fields":[{"required":false,"options":[],"config":{},"priority":0,"translations":{},"label":"field 2","type":"varchar","input":"text","description":"A sentence or less","$$hashKey":"object:893","instructions":"","form_stage_id":"interim_id_3"}],"type":"task","show_when_published":false,"task_is_internal_only":true,"label":"task 2","priority":1,"$$hashKey":"object:867"}],"enabled_languages":{"default":"en-US","available":[]}}
PUT /api/v5/surveys/2 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 1139
{
"name": "test2",
"description": "test desc 2",
"base_language": "en-US",
"require_approval": true,
"everyone_can_create": true,
"translations": {},
"tasks": [
{
"priority": 0,
"required": false,
"type": "post",
"label": "Post",
"show_when_published": true,
"task_is_internal_only": false,
"translations": {},
"fields": [
{
"cardinality": 0,
"input": "text",
"priority": 1,
"required": true,
"label": "Title",
"type": "title",
"config": {},
"form_stage_id": "interim_id_0",
"translations": {},
"$$hashKey": "object:830"
},
{
"cardinality": 0,
"input": "text",
"priority": 2,
"required": true,
"label": "Description",
"type": "description",
"options": [],
"config": {},
"form_stage_id": "interim_id_1",
"translations": {},
"$$hashKey": "object:831"
}
],
"is_public": true
},
{
"required": false,
"fields": [
{
"required": false,
"options": [],
"config": {},
"priority": 0,
"translations": {},
"label": "field 2",
"type": "varchar",
"input": "text",
"description": "A sentence or less",
"$$hashKey": "object:893",
"instructions": "",
"form_stage_id": "interim_id_3"
}
],
"type": "task",
"show_when_published": false,
"task_is_internal_only": true,
"label": "task 2",
"priority": 1,
"$$hashKey": "object:867"
}
],
"enabled_languages": {
"default": "en-US",
"available": []
}
}
{
"results": [
{
"id": 1,
"name": "text",
"translations": {
"name": "text",
"description": "text",
"allOf": {
"es": {
"name": "text",
"description": "text"
}
}
}
}
]
}