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.

Replace instances of [resources] or [resource] with actual resource name.The config API endpoint is a special case. Because we're using Kohana's config classes under the hood we only really have 2 operations: get - HTTP GET - and set - HTTP PUT. You can use PUT to both create or update a config item.

Excerpt
Panel
Table of Contents
maxlevel2

Anchor
post-collection

POST

...

config

The config API does not support POST.

METHOD: POST
ENDPOINT: /api/v2/[resources]/
AUTHENTICATED: No

The request body is a JSON representation of the [resource] being created.

Example request
Panel

POST https://ushv3.dev/api/v2/[resources]

Code Block
titlePost Data
languagejavascript
{
}
Code Block
titleResponse
languagejavascript
{
}

config/

Anchor
get-collection

GET

...

config/:group

Listing all [resources]config entries

METHOD: GET
ENDPOINT: /api/v2/[resources]config/:group
AUTHENTICATED: No

Query Parameters

Name

Type

Description

qgroup

Optional

Only [Resources] containing this search string will be returned, matched against 'tag' property

type

Optional

Only [resources] of this type will be returned: report, revision, comment or alert

order

Optional

Returned [resources] will be sorted in this order: ASC or DESC. Default: DESC

order_by

Optional

Returned [resources] will be sorted by this field. Default: created

limit

Optional

Limit number of results returned. Default: 50. Max: 500

offset

Optional

[Resources] returned will be offset by this number of results

The group name to return config entries for

Example Request
Panel

GET https://ushv3.dev/api/v2/[resources]config

Code Block
titleResponse
languagejavascript
{
    "count": 24,
    "results": [{
        "group_name": "site",
        "config_key": "site_name",
        "config_value": "testing site",
        "allowed_methods": {
            "get": true,
            "post": true,
            "put": true,
            "delete": true
        }
    ]}, {
   "limit     "group_name": 50"site",
    "offset    "config_key": 0"owner_name",
    "order    "config_value": "ASCtesterbot",
    "orderby    "allowed_methods": "created"{
            "get": true,
    "curr        "post": "https://ushv3.dev/api/v2/[resources]/?limit=50&offset=0",
    "next": "https://ushv3.dev/api/v2/[resources]/?limit=50&offset=50"true,
            "put": true,
            "delete": true
        }
    }, {
        "group_name": "site",
        "config_key": "site_email",
    "prev    "config_value": "https://ushv3.dev/api/v2/[resources]/?limit=50&offset=0"
}

...

false,
        "allowed_methods": {
            "get": true,
            "post": true,
            "put": true,
            "delete": true
        }
    }, {
        "group_name": "test",
        "config_key": "testkey",
        "config_value": "testval",
        "allowed_methods": {
            "get": true,
            "post": true,
            "put": true,
            "delete": true
        }
    }]
}

Config group example

Panel

GET https://ushv3.dev/api/v2/[resources]?q=Davidconfig/test

Code Block
titleResponse
languagejavascript
{
    "count": 1,
    "results": [{
        {
"group_name": "test",
       } "config_key": "testkey",
  ],      "limitconfig_value": 50"testval",
    "offset    "allowed_methods": 0,{
    "order": "ASC",       "orderbyget": "created"true,
    "curr": "https://ushv3.dev/api/v2/[resources]/?q=David&limit=50&offset=0"        "post": true,
    "next": "https://ushv3.dev/api/v2/[resources]/?q=David&limit=50&offset=50"        "put": true,
    "prev": "https://ushv3.dev/api/v2/[resources]/?q=David&limit=50&offset=0"
}
        "delete": true
        }
    }]
}

Anchor
get-id

GET

...

config/:group/:id

Get a single [resource]single config entry

METHOD: GET
ENDPOINT: /api/v2/[resources]config/:group/:id
AUTHENTICATED: Yes

Query Parameters

Name

Type

Description

id

Required

The numerical id config key of the [resource] being updated.config entry

groupRequiredThe group name of the config entry
Example Request
Panel

GET http://ushv3.dev/api/v2/[resources]/1config/site/site_name

Code Block
titleResponse
languagejavascript
{
	
}
    "group_name": "site",
    "config_key": "site_name",
    "config_value": "testing site",
    "allowed_methods": {
        "get": true,
        "post": true,
        "put": true,
        "delete": true
    }
}

Anchor
put-id

PUT

...

config/:group/:id

Update a [resource]a config entry

METHOD: PUT
ENDPOINT: /api/v2/[resources]config/:group/:id
AUTHENTICATED: Yes

Query Parameters

Name

Type

Description

id

Required

The numerical id config key of the [resource] config entry being updated.

groupRequiredThe group name of the config entry
Example Request
Panel

PUT http://ushv3.dev/api/v2/[resources]/1config/site/site_name

Code Block
titlePost Data
languagejavascript
{
	
    "config_value": "Updated value"
}
Code Block
titleResponse
languagejavascript
{
	
}
    "group_name": "site",
    "config_key": "test",
    "config_value": "Updated value",
    "allowed_methods": {
        "get": true,
        "post": true,
        "put": true,
        "delete": true
    }
}

Anchor
delete-id

DELETE

...

config/:

...

group/:id

The config API does not support DELETE.

METHOD: DELETE
ENDPOINT: /api/v2/[resources]config/:id
AUTHENTICATED: YES

Query Parameters

Name

Type

Description

id

Required

The numerical id of the [resource] being deleted.

Example request
Panel

DELETE /api/v2/[resources]/2

Code Block
titleResponse
languagejavascript
{
	
}