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

Collections

PreviousSaved SearchNextCollections Page

add collection

POST https://ushahididocs.api.ushahidi.io/api/v3/collections

Request Body

Name
Type
Description

user_id

String

The user identifier

view

String

Type of view e.g. "list"

description

String

Collection description

name

String

The name of collection

view_options

String

View Option

role

String

Role

featured

Boolean

Set True to feature collection and False for unfeatured

{
    "id": 11,
    "url": null,
    "user": {
        "id": 2,
        "url": "http://localhost:8000/api/v3/users/2"
    },
    "name": "Test collection",
    "description": "",
    "view": "list",
    "view_options": null,
    "role": null,
    "featured": false,
    "created": "2022-11-01T08:13:25+00:00",
    "updated": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}

edit collection

PUT https://ushahididocs.api.ushahidi.io/api/v3/collections/3

Request Body

Name
Type
Description

user_id

String

The user identifier

view

String

Type of view e.g. "list"

description

String

Collection description

name

String

The name of collection

view_options

String

View Option

role

String

Role

featured

Boolean

Set True to feature collection and False for unfeatured

{
    "id": 11,
    "url": null,
    "user": {
        "id": 2,
        "url": "http://localhost:8000/api/v3/users/2"
    },
    "name": "Test collection",
    "description": "",
    "view": "list",
    "view_options": null,
    "role": null,
    "featured": false,
    "created": "2022-11-01T08:13:25+00:00",
    "updated": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}

get_collections

get
Authorizations
Query parameters
orderbystringOptional

Sorting parameter Available values : entity fields Default value : featured

Example: name
orderstringOptional

Sorting parameter Available values : [ASC,DESC] !! Default value : Desc

Example: Desc
limitinteger · int32Optional

Paging parameter Default value : null

Example: 2
offsetinteger · int32Optional

Paging parameter Default value : 0

Example: 3
qstringOptional

Filter parameter return collections which his name contian the q value

Example: test
user_idinteger · int32Optional

Filter parameter return collection with the user id value

Example: 9
Responses
200
OK
application/json
get
GET /api/v3/collections HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "count": 1,
  "results": [
    {
      "id": 1,
      "url": "text",
      "user_id": "text",
      "name": "text",
      "description": "text",
      "view": "text",
      "view_options": "text",
      "role": [
        "text"
      ],
      "featured": true,
      "created": "text",
      "updated": "text",
      "allowed_privileges": [
        "text"
      ],
      "user": {
        "id": 1,
        "url": "text"
      }
    }
  ],
  "limit": "text",
  "offset": 1,
  "order": "text",
  "orderby": "text",
  "curr": "text",
  "next": "text",
  "prev": "text",
  "total_count": 1
}

get collection

get
Authorizations
Responses
200
OK
application/json
404
Not Found
application/json
get
GET /api/v3/collections/1 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 1,
  "name": "Test collection",
  "description": "",
  "view": "list",
  "featured": false,
  "created": "1970-01-01T00:00:00+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}

delete collection

delete
Authorizations
Responses
200
OK
application/json
401
Unauthorized
application/json
404
Not Found
application/json
delete
DELETE /api/v3/collections/3 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 11,
  "user": {
    "id": 2,
    "url": "http://localhost:8000/api/v3/users/2"
  },
  "name": "Test collection",
  "description": "",
  "view": "list",
  "featured": false,
  "created": "2022-11-01T08:13:25+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
  • GETget_collections
  • add collection
  • edit collection
  • GETget collection
  • DELETEdelete collection