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

Api Keys

PreviousWebhooksNextForms

add apikey

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

{
    "id": 5,
    "url": "http://localhost:8000/api/v3/apikey/5",
    "api_key": "fff2756f-ebec-4b56-8c3c-e1051f97da39",
    "created": "1970-01-01T00:00:00+00:00",
    "updated": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}

add apikey

PUT https://ushahididocs.api.ushahidi.io/api/v3/apikeys/2

{
    "id": 5,
    "url": "http://localhost:8000/api/v3/apikey/5",
    "api_key": "fff2756f-ebec-4b56-8c3c-e1051f97da39",
    "created": "1970-01-01T00:00:00+00:00",
    "updated": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}

get apikeys

get
Authorizations
Query parameters
orderbystringOptional

Sorting parameter Available values : entity fields Default value : id

Example: id
orderstringOptional

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

Example: asc
limitinteger · int32Optional

Paging parameter Default value : null

Example: 2
offsetinteger · int32Optional

Paging parameter Default value : 0

Example: 3
Responses
200
OK
application/json
401
Unauthorized
application/json
get
GET /api/v3/apikeys HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "count": 5,
  "results": [
    {
      "id": 3,
      "url": "http://localhost:8000/api/v3/apikey/3",
      "api_key": "98ac07ce-e872-4e50-864a-89b45acab18d",
      "created": "1970-01-01T00:00:00+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    },
    {
      "id": 4,
      "url": "http://localhost:8000/api/v3/apikey/4",
      "api_key": "b874d2e6-2bf0-4bb9-aecf-903edc7a4202",
      "created": "1970-01-01T00:00:00+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    },
    {
      "id": 6,
      "url": "http://localhost:8000/api/v3/apikey/6",
      "api_key": "30c777f7-538d-4ca1-b91a-354a600c1f08",
      "created": "1970-01-01T00:00:00+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    },
    {
      "id": 7,
      "url": "http://localhost:8000/api/v3/apikey/7",
      "api_key": "02b8471a-13d0-43bc-9934-913a610330ce",
      "created": "1970-01-01T00:00:00+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    },
    {
      "id": 8,
      "url": "http://localhost:8000/api/v3/apikey/8",
      "api_key": "15dfe069-99e7-4033-8722-117664aaf3dc",
      "created": "1970-01-01T00:00:00+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "offset": 0,
  "order": "asc",
  "orderby": "id",
  "curr": "http://localhost:8000/api/v3/apikeys?orderby=id&order=asc&offset=0",
  "next": "http://localhost:8000/api/v3/apikeys?orderby=id&order=asc&offset=0",
  "prev": "http://localhost:8000/api/v3/apikeys?orderby=id&order=asc&offset=0",
  "total_count": 5
}

get apikey

get
Authorizations
Responses
200
OK
application/json
401
Unauthorized
application/json
404
Not Found
application/json
get
GET /api/v3/apikeys/2 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 2,
  "url": "http://localhost:8000/api/v3/apikey/2",
  "api_key": "thisisatestapikeystring",
  "created": "1970-01-01T00:00:00+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}

delete apikey

delete
Authorizations
Responses
200
OK
application/json
401
Unauthorized
application/json
404
Not Found
application/json
delete
DELETE /api/v3/apikeys/5 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 5,
  "url": "http://localhost:8000/api/v3/apikey/5",
  "api_key": "fff2756f-ebec-4b56-8c3c-e1051f97da39",
  "created": "1970-01-01T00:00:00+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
  • GETget apikeys
  • add apikey
  • GETget apikey
  • add apikey
  • DELETEdelete apikey