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

HXL

PreviousContactsNextMedia

add hxl metadata

POST https://ushahididocs.api.ushahidi.io/api/v3/hxl/metadata

Request Body

Name
Type
Description

organisation_name

String

The organisation name

organisation_id

String

The organisations identifier

license_id

Integer

Lincense identifier

dataset_title

String

The title of the dataset

private

Boolean

Set True if you want metadata to be private and false if you don't

user_id

Integer

The user identifier

source

String

Metadata source

{
    "id": 5,
    "url": "http://localhost:8000/api/v3/hxl_meta_data/5",
    "user": {
        "id": 2,
        "url": "http://localhost:8000/api/v3/users/2"
    },
    "private": true,
    "dataset_title": "ushahidi-dataset",
    "license_id": 1,
    "organisation_id": "ushahidi-org-id",
    "organisation_name": "ushahidi",
    "source": "other",
    "created": "1970-01-01T00:00:00+00:00",
    "updated": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}

get hxl

get
Authorizations
Responses
200
OK
application/json
401
Unauthorized
application/json
get
GET /api/v3/hxl HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "hxl": []
}

get hxl metadata

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
namestringOptional
codestringOptional
Responses
200
OK
application/json
401
Unauthorized
application/json
403
Forbidden
application/json
get
GET /api/v3/hxl/metadata HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "count": 4,
  "results": [
    {
      "id": 1,
      "url": "http://localhost:8000/api/v3/hxl_meta_data/1",
      "user": {
        "id": 2,
        "url": "http://localhost:8000/api/v3/users/2"
      },
      "private": true,
      "dataset_title": "ushahidi-dataset",
      "license_id": 1,
      "organisation_id": "ushahidi-org-id",
      "organisation_name": "ushahidi",
      "source": "other",
      "created": "1970-01-01T00:00:00+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    },
    {
      "id": 2,
      "url": "http://localhost:8000/api/v3/hxl_meta_data/2",
      "user": {
        "id": 2,
        "url": "http://localhost:8000/api/v3/users/2"
      },
      "private": true,
      "dataset_title": "ushahidi-dataset",
      "license_id": 1,
      "organisation_id": "ushahidi-org-id",
      "organisation_name": "ushahidi",
      "source": "other",
      "created": "1970-01-01T00:00:00+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    },
    {
      "id": 3,
      "url": "http://localhost:8000/api/v3/hxl_meta_data/3",
      "user": {
        "id": 2,
        "url": "http://localhost:8000/api/v3/users/2"
      },
      "private": true,
      "dataset_title": "ushahidi-dataset",
      "license_id": 1,
      "organisation_id": "ushahidi-org-id",
      "organisation_name": "ushahidi",
      "source": "other",
      "created": "1970-01-01T00:00:00+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    },
    {
      "id": 4,
      "url": "http://localhost:8000/api/v3/hxl_meta_data/4",
      "user": {
        "id": 2,
        "url": "http://localhost:8000/api/v3/users/2"
      },
      "private": true,
      "dataset_title": "ushahidi-dataset",
      "license_id": 1,
      "organisation_id": "ushahidi-org-id",
      "organisation_name": "ushahidi",
      "source": "other",
      "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/hxl/metadata?orderby=id&order=asc&offset=0",
  "next": "http://localhost:8000/api/v3/hxl/metadata?orderby=id&order=asc&offset=0",
  "prev": "http://localhost:8000/api/v3/hxl/metadata?orderby=id&order=asc&offset=0",
  "total_count": 4
}

get hxl licenses

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
namestringOptional

Filter Parameter check the name

Example: test name
codestringOptional

Filter Parameter check the code

Example: cc-by-igo
Responses
200
OK
application/json
401
Unauthorized
application/json
get
GET /api/v3/hxl/licenses HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "count": 2,
  "results": [
    {
      "id": 1,
      "url": "http://localhost:8000/api/v3/hxl_license/1",
      "code": "cc-by-igo",
      "name": "Creative Commons Attribution for Intergovernmental Organisations",
      "link": "http://creativecommons.org/licenses/by/3.0/igo/legalcode",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    },
    {
      "id": 2,
      "url": "http://localhost:8000/api/v3/hxl_license/2",
      "code": "cc-by",
      "name": "Creative Commons Attribution",
      "link": "http://www.opendefinition.org/licenses/cc-by",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "limit": "2",
  "offset": 0,
  "order": "asc",
  "orderby": "id",
  "curr": "http://localhost:8000/api/v3/hxl/licenses?orderby=id&order=asc&limit=2&offset=0",
  "next": "http://localhost:8000/api/v3/hxl/licenses?orderby=id&order=asc&limit=2&offset=2",
  "prev": "http://localhost:8000/api/v3/hxl/licenses?orderby=id&order=asc&limit=2&offset=0",
  "total_count": 8
}

get hxl tags

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/hxl/tags HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "count": 2,
  "results": [
    {
      "id": 1,
      "url": "http://localhost:8000/api/v3/hxl_tag/1",
      "tag_name": "population",
      "hxl_attributes": {
        "628": {
          "hxl_tag_id": 1,
          "id": 1,
          "attribute": "f",
          "description": "0"
        },
        "629": {
          "hxl_tag_id": 1,
          "id": 2,
          "attribute": "m",
          "description": "0"
        },
        "630": {
          "hxl_tag_id": 1,
          "id": 3,
          "attribute": "i",
          "description": "0"
        },
        "631": {
          "hxl_tag_id": 1,
          "id": 4,
          "attribute": "infants",
          "description": "0"
        },
        "632": {
          "hxl_tag_id": 1,
          "id": 5,
          "attribute": "children",
          "description": "0"
        },
        "633": {
          "hxl_tag_id": 1,
          "id": 6,
          "attribute": "adolescents",
          "description": "0"
        },
        "634": {
          "hxl_tag_id": 1,
          "id": 7,
          "attribute": "adults",
          "description": "0"
        },
        "635": {
          "hxl_tag_id": 1,
          "id": 8,
          "attribute": "elderly",
          "description": "0"
        },
        "636": {
          "hxl_tag_id": 1,
          "id": 9,
          "attribute": "start",
          "description": "0"
        },
        "637": {
          "hxl_tag_id": 1,
          "id": 10,
          "attribute": "end",
          "description": "0"
        },
        "638": {
          "hxl_tag_id": 1,
          "id": 11,
          "attribute": "reported",
          "description": "0"
        },
        "639": {
          "hxl_tag_id": 1,
          "id": 12,
          "attribute": "event",
          "description": "0"
        },
        "640": {
          "hxl_tag_id": 1,
          "id": 13,
          "attribute": "killed",
          "description": "0"
        },
        "641": {
          "hxl_tag_id": 1,
          "id": 14,
          "attribute": "injured",
          "description": "0"
        },
        "642": {
          "hxl_tag_id": 1,
          "id": 15,
          "attribute": "infected",
          "description": "0"
        },
        "643": {
          "hxl_tag_id": 1,
          "id": 16,
          "attribute": "displaced",
          "description": "0"
        },
        "644": {
          "hxl_tag_id": 1,
          "id": 17,
          "attribute": "idps",
          "description": "0"
        },
        "645": {
          "hxl_tag_id": 1,
          "id": 18,
          "attribute": "refugees",
          "description": "0"
        },
        "646": {
          "hxl_tag_id": 1,
          "id": 19,
          "attribute": "abducted",
          "description": "0"
        },
        "647": {
          "hxl_tag_id": 1,
          "id": 20,
          "attribute": "threatened",
          "description": "0"
        }
      },
      "form_attribute_types": [
        {
          "form_attribute_type": "decimal"
        },
        {
          "form_attribute_type": "int"
        },
        {
          "form_attribute_type": "text"
        },
        {
          "form_attribute_type": "varchar"
        },
        {
          "form_attribute_type": "title"
        },
        {
          "form_attribute_type": "description"
        }
      ],
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    },
    {
      "id": 2,
      "url": "http://localhost:8000/api/v3/hxl_tag/2",
      "tag_name": "affected",
      "hxl_attributes": {
        "140": {
          "hxl_tag_id": 2,
          "id": 1,
          "attribute": "f",
          "description": "0"
        },
        "141": {
          "hxl_tag_id": 2,
          "id": 2,
          "attribute": "m",
          "description": "0"
        },
        "142": {
          "hxl_tag_id": 2,
          "id": 3,
          "attribute": "i",
          "description": "0"
        },
        "143": {
          "hxl_tag_id": 2,
          "id": 4,
          "attribute": "infants",
          "description": "0"
        },
        "144": {
          "hxl_tag_id": 2,
          "id": 5,
          "attribute": "children",
          "description": "0"
        },
        "145": {
          "hxl_tag_id": 2,
          "id": 6,
          "attribute": "adolescents",
          "description": "0"
        },
        "146": {
          "hxl_tag_id": 2,
          "id": 7,
          "attribute": "adults",
          "description": "0"
        },
        "147": {
          "hxl_tag_id": 2,
          "id": 8,
          "attribute": "elderly",
          "description": "0"
        },
        "148": {
          "hxl_tag_id": 2,
          "id": 9,
          "attribute": "start",
          "description": "0"
        },
        "149": {
          "hxl_tag_id": 2,
          "id": 10,
          "attribute": "end",
          "description": "0"
        },
        "150": {
          "hxl_tag_id": 2,
          "id": 11,
          "attribute": "reported",
          "description": "0"
        },
        "151": {
          "hxl_tag_id": 2,
          "id": 12,
          "attribute": "event",
          "description": "0"
        },
        "152": {
          "hxl_tag_id": 2,
          "id": 13,
          "attribute": "killed",
          "description": "0"
        },
        "153": {
          "hxl_tag_id": 2,
          "id": 14,
          "attribute": "injured",
          "description": "0"
        },
        "154": {
          "hxl_tag_id": 2,
          "id": 15,
          "attribute": "infected",
          "description": "0"
        },
        "155": {
          "hxl_tag_id": 2,
          "id": 16,
          "attribute": "displaced",
          "description": "0"
        },
        "156": {
          "hxl_tag_id": 2,
          "id": 17,
          "attribute": "idps",
          "description": "0"
        },
        "157": {
          "hxl_tag_id": 2,
          "id": 18,
          "attribute": "refugees",
          "description": "0"
        },
        "158": {
          "hxl_tag_id": 2,
          "id": 19,
          "attribute": "abducted",
          "description": "0"
        },
        "159": {
          "hxl_tag_id": 2,
          "id": 20,
          "attribute": "threatened",
          "description": "0"
        }
      },
      "form_attribute_types": [
        {
          "form_attribute_type": "decimal"
        },
        {
          "form_attribute_type": "int"
        },
        {
          "form_attribute_type": "text"
        },
        {
          "form_attribute_type": "varchar"
        },
        {
          "form_attribute_type": "title"
        },
        {
          "form_attribute_type": "description"
        }
      ],
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "limit": "2",
  "offset": 0,
  "order": "asc",
  "orderby": "id",
  "curr": "http://localhost:8000/api/v3/hxl/tags?orderby=id&order=asc&limit=2&offset=0",
  "next": "http://localhost:8000/api/v3/hxl/tags?orderby=id&order=asc&limit=2&offset=2",
  "prev": "http://localhost:8000/api/v3/hxl/tags?orderby=id&order=asc&limit=2&offset=0",
  "total_count": 44
}

get hxl organisations

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
401
Unauthorized
application/json
get
GET /api/v3/hxl/organisations HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
401

Unauthorized

{
  "errors": [
    {
      "status": 401,
      "message": "Unauthorized."
    }
  ]
}
  • GETget hxl
  • GETget hxl metadata
  • add hxl metadata
  • GETget hxl licenses
  • GETget hxl tags
  • GETget hxl organisations