v3 Ushahidi Platform REST API Documentation
  • V3
    • Overview
    • Login & Register
    • Posts
      • Sub Posts & Translation
    • Tags
    • Configuration
    • Data provider
    • Country Code
    • Tos
    • Permissons
    • Roles
    • Users
      • User Settings
    • Saved Search
    • Collections
      • Collections Page
    • Messages
    • Exports
    • Contacts
    • HXL
    • Media
    • Verifier
    • Migration
    • Notification
    • Layer
    • Webhooks
    • Api Keys
    • Forms
      • Form Attribute
      • Form Contacts
      • Form Role
      • Form Stages
    • CSV
    • Test
  • V5
    • Overview
    • Posts
    • Surveys
    • Categories
Powered by GitBook
On this page
  1. V3
  2. Forms

Form Attribute

PreviousFormsNextForm Contacts

add form attribute

POST https://ushahididocs.api.ushahidi.io/api/v3/forms/4/attributes

Request Body

Name
Type
Description

label

String

Form atributes label

required

String

Set True make a form required and False for optional

type

String

Attribute type

input

String

form input type

cardinality

Integer

priority

Integer

Set priority value

config

String

response_private

String

Set True to make the response private and False to not

key

String

Form attributes key

form_stage_id

Integer

Form stager ID

default

String

instructions

String

Form instructions

{
    "id": 53,
    "url": "http://localhost:8000/api/v3/form_attributes/53",
    "key": "557d9375-fe6d-4b21-9f7e-95528342bbe4",
    "label": "Test Field Level Locking 1",
    "instructions": null,
    "input": "text",
    "type": "text",
    "required": false,
    "default": null,
    "priority": 0,
    "options": [],
    "cardinality": 1,
    "config": null,
    "form_stage_id": 7,
    "response_private": true,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}

edit form attribute

PUT https://ushahididocs.api.ushahidi.io/api/v3/forms/4/attributes/18

Request Body

Name
Type
Description

label

String

Form atributes label

required

String

Set True make a form required and False for optional

type

String

Attribute type

input

String

form input type

cardinality

Integer

priority

Integer

Set priority value

config

String

response_private

String

Set True to make the response private and False to not

key

String

Form attributes key

form_stage_id

Integer

Form stager ID

default

String

instructions

String

Form instructions

{
    "id": 53,
    "url": "http://localhost:8000/api/v3/form_attributes/53",
    "key": "557d9375-fe6d-4b21-9f7e-95528342bbe4",
    "label": "Test Field Level Locking 1",
    "instructions": null,
    "input": "text",
    "type": "text",
    "required": false,
    "default": null,
    "priority": 0,
    "options": [],
    "cardinality": 1,
    "config": null,
    "form_stage_id": 7,
    "response_private": true,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}

get form attributes

get
Authorizations
Responses
200
OK
application/json
get
GET /api/v3/forms/5/attributes HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "count": 1,
  "results": [
    {
      "id": 30,
      "url": "http://localhost:8000/api/v3/form_attributes/30",
      "key": "test_varchar_targeted_survey_1",
      "label": "Test varchar Targeted Survey",
      "input": "text",
      "type": "varchar",
      "required": true,
      "priority": 1,
      "options": [
        ""
      ],
      "cardinality": 1,
      "form_stage_id": 8,
      "response_private": true,
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "offset": 0,
  "order": "asc",
  "orderby": "id",
  "curr": "http://localhost:8000/api/v3/forms/5/attributes?orderby=id&order=asc&offset=0",
  "next": "http://localhost:8000/api/v3/forms/5/attributes?orderby=id&order=asc&offset=0",
  "prev": "http://localhost:8000/api/v3/forms/5/attributes?orderby=id&order=asc&offset=0",
  "total_count": 1
}

get form attribute

get
Authorizations
Responses
200
OK
application/json
404
Not Found
application/json
get
GET /api/v3/forms/4/attributes/18 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 27,
  "url": "http://localhost:8000/api/v3/form_attributes/27",
  "key": "tags2",
  "label": "Categories",
  "input": "tags",
  "type": "tags",
  "required": false,
  "priority": 3,
  "options": [
    "1",
    "2",
    "3",
    "5"
  ],
  "cardinality": 0,
  "form_stage_id": 4,
  "response_private": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}

delete form attribute

delete
Authorizations
Responses
200
OK
application/json
401
Unauthorized
application/json
404
Not Found
application/json
delete
DELETE /api/v3/forms/4/attributes/18 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 19,
  "url": "http://localhost:8000/api/v3/form_attributes/19",
  "key": "test_field_locking_visible_1",
  "label": "Test Field Level Locking 2",
  "input": "text",
  "type": "varchar",
  "required": false,
  "priority": 0,
  "options": [
    ""
  ],
  "cardinality": 1,
  "form_stage_id": 6,
  "response_private": false,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
  • GETget form attributes
  • GETget form attribute
  • add form attribute
  • edit form attribute
  • DELETEdelete form attribute