FOR ARCHIVAL PURPOSES ONLY

The information in this wiki hasn't been maintained for a good while. Some of the projects described have since been deprecated.

In particular, the "Ushahidi Platform v3.x" section contains information that is often misleading. Many details about this version of Platform have changed since.

This website is an extraction of the original Ushahidi wiki into a static form. Because of that, functions like logging in, commenting or searching will not work.

For more documentation, please refer to https://docs.ushahidi.com

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status
colourGreen
titleFeature: complete
 
Status
colourYellowGreen
titleDocs: Need UPDATEUp to date
subtletrue

Excerpt
Panel
Table of Contents
maxlevel2

...

The request body is a JSON representation of the attribute being created.

The "form_group" is required when creating an attribute, since attribute creation without a group isn't very useful. However attributes can be in multiple forms/groups, and can be orphaned later when a group is removed.

Example request
Panel

POST https://ushv3.dev/api/v2/attributes

Code Block
titlePost Data
languagejavascript
{
    "form_group_id":1,
    "key":"full_name",
    "label":"Full Name",
    "type":"varchar",
    "input":"text",
    "required":true,
    "default":"",
    "unique":false,
    "priority":1
    "options":{}
}
Code Block
titleResponse
languagejavascript
{
    "urlid":"https://ushv3.dev/api/v2/forms/1/attributes/2",
    "formurl":"https://ushv3.dev/api/v2/forms/1",
    "form_group":"https://ushv3.dev/api/v2/forms/1/groups/attributes/2",
    "id":2,
    "key":"full_name",
    "label":"Full Name",
    "typeinput":"varchartext",
    "inputtype":"textvarchar",
    "required":true,
    "default":""null,
    "unique":false,
    "priority":1
    "options":{}
}

...

Panel

GET https://ushv3.dev/api/v2/attributes

Code Block
titleResponse
languagejavascript
{
    "count": 4,
    "results":[
        {
            "url":"https://ushv3.dev/api/v2/forms/1/attributes/1",
            "form":"https://ushv3.dev/api/v2/forms/1",
            "form_group":"https://ushv3.dev/api/v2/forms/1/groups/1",
            "id":"1",
            "key":"full_name",
            "label":"Full Name",
            "type":"varchar",
            "input":"text",
            "required":true,
            "default":""null,
            "unique":false,
            "priority":1
            "options":{}
        },
        {
            "url":"https://ushv3.dev/api/v2/forms/1/attributes/2",
            "form":"https://ushv3.dev/api/v2/forms/1",
            "form_group":"https://ushv3.dev/api/v2/forms/1/groups/1",
            "id":"2",
            "key":"last_name",
            "label":"Last Name",
            "type":"varchar",
            "input":"text",
            "required":false,
            "default":""null,
            "unique":false,
            "priority":2
            "options":{}
        },
        {
            "url":"https://ushv3.dev/api/v2/forms/1/attributes/3",
            "form":"https://ushv3.dev/api/v2/forms/1",
            "form_group":"https://ushv3.dev/api/v2/forms/1/groups/2",
            "id":"3",
            "key":"address",
            "label":"Address",
            "type":"varchar",
            "input":"text",
            "required":false,
            "default":"",
            "unique":false,
            "priority":3
            "options":{}
        },
        {
            "url":"https://ushv3.dev/api/v2/forms/1/attributes/4",
            "form":"https://ushv3.dev/api/v2/forms/1",
            "form_group":"https://ushv3.dev/api/v2/forms/1/groups/2",
            "id":"4",
            "key":"phone",
            "label":"Phone",
            "type":"varchar",
            "input":"text",
            "required":false,
            "default":"",
            "unique":false,
            "priority":4
            "options":{}
        }
    ]
}

...

Panel

GET http://ushv3.dev/api/v2/attributes/1

Code Block
titleResponse
languagejavascript
{
    "url":"https://ushv3.dev/api/v2/forms/1/attributes/2",
    "form":"https://ushv3.dev/api/v2/forms/1",
    "form_group":"https://ushv3.dev/api/v2/forms/1/groups/2",
    "id":2,
    "key":"full_name",
    "label":"Full Name",
    "type":"varchar",
    "input":"text",
    "required":true,
    "default":""null,
    "unique":false,
    "priority":1
    "options":{}
}

...

METHOD: PUT
ENDPOINT: /api/v2/attributes/:id
AUTHENTICATED: Yes

Note: form_group isn't required or used when updating an attribute. To add/remove attributes from groups use the Groups api resource.

Query Parameters

Name

Type

Description

id

Required

The numerical id of the attribute being updated.

...

Panel

PUT http://ushv3.dev/api/v2/attributes/1

Code Block
titlePost Data
languagejavascript
{
    "form_group_id":1,
    "key":"full_name",
    "label":"Full Name",
    "type":"varchar",
    "input":"text",
    "required":true,
    "default":"",
    "unique":false,
    "priority":1
    "options":{}
}
Code Block
titleResponse
languagejavascript
{
    "url":"https://ushv3.dev/api/v2/forms/1/attributes/2",
    "form":"https://ushv3.dev/api/v2/forms/1",
    "form_group":"https://ushv3.dev/api/v2/forms/1/groups/2",
    "id":2,
    "key":"full_name",
    "label":"Full Name",
    "type":"varchar",
    "input":"text",
    "required":true,
    "default":""null,
    "unique":false,
    "priority":1
    "options":{}
}

...

Panel

DELETE api/v2/attributes/2

Code Block
titleResponse
languagejavascript
{
    "url":"https://ushv3.dev/api/v2/forms/1/attributes/2",
    "form":"https://ushv3.dev/api/v2/forms/1",
    "form_group":"https://ushv3.dev/api/v2/forms/1/groups/2",
    "id":2,
    "key":"full_name",
    "label":"Full Name",
    "type":"varchar",
    "input":"text",
    "required":true,
    "default":""null,
    "unique":false,
    "priority":1
    "options":{}
}