POST
https://ushahididocs.api.ushahidi.io/api/v3/hxl/metadata
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"
]
}
OK
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v3/hxl', {
method: 'GET',
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();
{
"hxl": []
}
OK
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v3/hxl/metadata', {
method: 'GET',
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();
{
"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
}
OK
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v3/hxl/licenses', {
method: 'GET',
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();
{
"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
}
OK
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v3/hxl/tags', {
method: 'GET',
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();
{
"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": "<p>0</p>"
},
"629": {
"hxl_tag_id": 1,
"id": 2,
"attribute": "m",
"description": "<p>0</p>"
},
"630": {
"hxl_tag_id": 1,
"id": 3,
"attribute": "i",
"description": "<p>0</p>"
},
"631": {
"hxl_tag_id": 1,
"id": 4,
"attribute": "infants",
"description": "<p>0</p>"
},
"632": {
"hxl_tag_id": 1,
"id": 5,
"attribute": "children",
"description": "<p>0</p>"
},
"633": {
"hxl_tag_id": 1,
"id": 6,
"attribute": "adolescents",
"description": "<p>0</p>"
},
"634": {
"hxl_tag_id": 1,
"id": 7,
"attribute": "adults",
"description": "<p>0</p>"
},
"635": {
"hxl_tag_id": 1,
"id": 8,
"attribute": "elderly",
"description": "<p>0</p>"
},
"636": {
"hxl_tag_id": 1,
"id": 9,
"attribute": "start",
"description": "<p>0</p>"
},
"637": {
"hxl_tag_id": 1,
"id": 10,
"attribute": "end",
"description": "<p>0</p>"
},
"638": {
"hxl_tag_id": 1,
"id": 11,
"attribute": "reported",
"description": "<p>0</p>"
},
"639": {
"hxl_tag_id": 1,
"id": 12,
"attribute": "event",
"description": "<p>0</p>"
},
"640": {
"hxl_tag_id": 1,
"id": 13,
"attribute": "killed",
"description": "<p>0</p>"
},
"641": {
"hxl_tag_id": 1,
"id": 14,
"attribute": "injured",
"description": "<p>0</p>"
},
"642": {
"hxl_tag_id": 1,
"id": 15,
"attribute": "infected",
"description": "<p>0</p>"
},
"643": {
"hxl_tag_id": 1,
"id": 16,
"attribute": "displaced",
"description": "<p>0</p>"
},
"644": {
"hxl_tag_id": 1,
"id": 17,
"attribute": "idps",
"description": "<p>0</p>"
},
"645": {
"hxl_tag_id": 1,
"id": 18,
"attribute": "refugees",
"description": "<p>0</p>"
},
"646": {
"hxl_tag_id": 1,
"id": 19,
"attribute": "abducted",
"description": "<p>0</p>"
},
"647": {
"hxl_tag_id": 1,
"id": 20,
"attribute": "threatened",
"description": "<p>0</p>"
}
},
"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": "<p>0</p>"
},
"141": {
"hxl_tag_id": 2,
"id": 2,
"attribute": "m",
"description": "<p>0</p>"
},
"142": {
"hxl_tag_id": 2,
"id": 3,
"attribute": "i",
"description": "<p>0</p>"
},
"143": {
"hxl_tag_id": 2,
"id": 4,
"attribute": "infants",
"description": "<p>0</p>"
},
"144": {
"hxl_tag_id": 2,
"id": 5,
"attribute": "children",
"description": "<p>0</p>"
},
"145": {
"hxl_tag_id": 2,
"id": 6,
"attribute": "adolescents",
"description": "<p>0</p>"
},
"146": {
"hxl_tag_id": 2,
"id": 7,
"attribute": "adults",
"description": "<p>0</p>"
},
"147": {
"hxl_tag_id": 2,
"id": 8,
"attribute": "elderly",
"description": "<p>0</p>"
},
"148": {
"hxl_tag_id": 2,
"id": 9,
"attribute": "start",
"description": "<p>0</p>"
},
"149": {
"hxl_tag_id": 2,
"id": 10,
"attribute": "end",
"description": "<p>0</p>"
},
"150": {
"hxl_tag_id": 2,
"id": 11,
"attribute": "reported",
"description": "<p>0</p>"
},
"151": {
"hxl_tag_id": 2,
"id": 12,
"attribute": "event",
"description": "<p>0</p>"
},
"152": {
"hxl_tag_id": 2,
"id": 13,
"attribute": "killed",
"description": "<p>0</p>"
},
"153": {
"hxl_tag_id": 2,
"id": 14,
"attribute": "injured",
"description": "<p>0</p>"
},
"154": {
"hxl_tag_id": 2,
"id": 15,
"attribute": "infected",
"description": "<p>0</p>"
},
"155": {
"hxl_tag_id": 2,
"id": 16,
"attribute": "displaced",
"description": "<p>0</p>"
},
"156": {
"hxl_tag_id": 2,
"id": 17,
"attribute": "idps",
"description": "<p>0</p>"
},
"157": {
"hxl_tag_id": 2,
"id": 18,
"attribute": "refugees",
"description": "<p>0</p>"
},
"158": {
"hxl_tag_id": 2,
"id": 19,
"attribute": "abducted",
"description": "<p>0</p>"
},
"159": {
"hxl_tag_id": 2,
"id": 20,
"attribute": "threatened",
"description": "<p>0</p>"
}
},
"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
}
Unauthorized
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v3/hxl/organisations', {
method: 'GET',
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();
{
"errors": [
{
"status": 401,
"message": "Unauthorized."
}
]
}