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

Layer

PreviousNotificationNextWebhooks

add layer

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

Request Body

Name
Type
Description

name

String

Layer name

visible_by_default

Boolean

Set True to make the layer visible by default and False to not

active

Boolean

Set True for active layer and False for Inactive layer

options

Array

Contains an array of layer options

type

String

Layer type

media

String

media

data_url

String

Data source URL

{
    "id": 4,
    "url": "http://localhost:8000/api/v3/layer/4",
    "name": "test",
    "data_url": "http://services.nationalmap.gov/ArcGIS/services/NEXRAD_Weather/MapServer/WMSServer",
    "media": null,
    "type": "geojson",
    "options": null,
    "active": true,
    "visible_by_default": true,
    "created": "2022-11-02T19:20:43+00:00",
    "updated": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}

edit layer

PUT https://ushahididocs.api.ushahidi.io/api/v3/layers/1

Request Body

Name
Type
Description

name

String

Layer name

visible_by_default

Boolean

Set True to make the layer visible by default and False to not

active

Boolean

Set True for active layer and False for Inactive layer

options

Array

Contains an array of layer options

type

String

Layer type

media

String

media

data_url

String

Data source URL

{
    "id": 4,
    "url": "http://localhost:8000/api/v3/layer/4",
    "name": "test",
    "data_url": "http://services.nationalmap.gov/ArcGIS/services/NEXRAD_Weather/MapServer/WMSServer",
    "media": null,
    "type": "geojson",
    "options": null,
    "active": true,
    "visible_by_default": true,
    "created": "2022-11-02T19:20:43+00:00",
    "updated": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}

get layers

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
activebooleanOptional

Filter Parameter check the type

Example: true
typestringOptional

Filter Parameter check the type Available values : [wms,geojson]

Example: geojson
Responses
200
OK
application/json
401
Unauthorized
application/json
get
GET /api/v3/layers HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "count": 1,
  "results": [
    {
      "id": 1,
      "url": "text",
      "name": "text",
      "data_url": "text",
      "media": "text",
      "type": "text",
      "options": {
        "layers": "text",
        "format": "text",
        "transparent": true
      },
      "active": true,
      "visible_by_default": true,
      "created": "text",
      "updated": "text",
      "allowed_privileges": [
        "text"
      ]
    }
  ],
  "limit": "text",
  "offset": 1,
  "order": "text",
  "orderby": "text",
  "curr": "text",
  "next": "text",
  "prev": "text",
  "total_count": 1
}

get layer

get
Authorizations
Responses
200
OK
application/json
401
Unauthorized
application/json
404
Not Found
application/json
get
GET /api/v3/layers/1 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 1,
  "url": "http://localhost:8000/api/v3/layer/1",
  "name": "test",
  "data_url": "/media/test.geojson",
  "type": "geojson",
  "options": [],
  "active": true,
  "visible_by_default": true,
  "created": "1970-01-01T00:00:00+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}

delete layer

delete
Authorizations
Responses
200
OK
application/json
401
Unauthorized
application/json
404
Not Found
application/json
delete
DELETE /api/v3/layers/5 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 5,
  "url": "http://localhost:8000/api/v3/layer/5",
  "name": "test",
  "data_url": "http://services.nationalmap.gov/ArcGIS/services/NEXRAD_Weather/MapServer/WMSServer",
  "type": "geojson",
  "active": true,
  "visible_by_default": true,
  "created": "2022-11-02T19:21:27+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
  • GETget layers
  • add layer
  • edit layer
  • GETget layer
  • DELETEdelete layer