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

Webhooks

PreviousLayerNextApi Keys

add webhooks

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

Request Body

Name
Type
Description

user_id

Integer

The user identifier

webhook_uuid

String

Webhook unique ID

shared_secret

String

The shared secrete unique ID

name

String

Webhook name

form_id

String

The form identifier

destination_field_key

String

event_type

String

The event type

url

String

Webhook URL

source_field_key

String

entity_type

String

Entity type

{
    "id": 6,
    "url": "http://services.nationalmap.gov/ArcGIS/services/NEXRAD_Weather/MapServer/WMSServer",
    "user": {
        "id": 1,
        "url": "http://localhost:8000/api/v3/users/1"
    },
    "form_id": null,
    "name": "test",
    "shared_secret": "test123estfds78#43fds",
    "webhook_uuid": "4472f128-4448-482a-b279-5a218d3ce559",
    "event_type": "create",
    "entity_type": "post",
    "source_field_key": null,
    "destination_field_key": null,
    "created": "2022-11-02T20:00:00+00:00",
    "updated": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}

edit webhooks

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

Request Body

Name
Type
Description

user_id

Integer

The user identifier

webhook_uuid

String

Webhook unique ID

shared_secret

String

The shared secrete unique ID

name

String

Webhook name

form_id

String

The form identifier

destination_field_key

String

event_type

String

The event type

url

String

Webhook URL

source_field_key

String

entity_type

String

Entity type

{
    "id": 6,
    "url": "http://services.nationalmap.gov/ArcGIS/services/NEXRAD_Weather/MapServer/WMSServer",
    "user": {
        "id": 1,
        "url": "http://localhost:8000/api/v3/users/1"
    },
    "form_id": null,
    "name": "test",
    "shared_secret": "test123estfds78#43fds",
    "webhook_uuid": "4472f128-4448-482a-b279-5a218d3ce559",
    "event_type": "create",
    "entity_type": "post",
    "source_field_key": null,
    "destination_field_key": null,
    "created": "2022-11-02T20:00:00+00:00",
    "updated": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}

edit a webhook post

PUT https://ushahididocs.api.ushahidi.io/api/v3/webhooks/posts/96

Request Body

Name
Type
Description

form_id

Integer

Form unique identifier

slug

String

Post slug

type

String

Post type

message

String

Additiong message for post

url

String

Post URL

author_email

String

Email address of source

title

String

Title of the new post

content

String

Post content

user_id

Integer

The user's unique Identifier

author_realname

String

The full name of the Post source

status

String

The status of post

locale

String

Post local language

color

String

Post color

id

String

Unique identifier of post

values

String

This is an array containing two items, one for the title and the description

published_to

Array

This contains an array of where the post was published

source

String

Source of post

sets

String

An array of set id's

tags

String

Contains an array of tag Id's

contact

String

Post contact

{
  "id": 0,
  "url": "string",
  "user_id": 0,
  "parent_id": 0,
  "form_id": 0,
  "title": "string",
  "content": "string",
  "message": "string",
  "color": "string",
  "type": "string",
  "slug": "string",
  "author_email": "string",
  "author_realname": 0,
  "status": "string",
  "created": "string",
  "updated": "string",
  "locale": "string",
  "values": [
    "string"
  ],
  "post_date": "string",
  "tags": [
    "string"
  ],
  "published_to": [
    0
  ],
  "completed_stages": [
    0
  ],
  "sets": [
    0
  ],
  "lock": "string",
  "source": "string",
  "data_source_message_id": "string",
  "allowed_privileges": [
    "string"
  ]
}

get webhooks

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
userinteger · int32Optional

Filter Parameter check the user id

  • accept "me" as special value
Example: 3
Responses
200
OK
application/json
401
Unauthorized
application/json
get
GET /api/v3/webhooks HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "count": 4,
  "results": [
    {
      "id": 2,
      "url": "http://services.nationalmap.gov/ArcGIS/services/NEXRAD_Weather/MapServer/WMSServer",
      "user": {
        "id": 1,
        "url": "http://localhost:8000/api/v3/users/1"
      },
      "name": "test",
      "shared_secret": "test123estfds78#43fds",
      "webhook_uuid": "test-test-test",
      "event_type": "create",
      "entity_type": "post",
      "created": "1970-01-01T00:00:00+00:00",
      "updated": "2022-11-02T20:02:00+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    },
    {
      "id": 4,
      "url": "https://test.test",
      "user": {
        "id": 1,
        "url": "http://localhost:8000/api/v3/users/1"
      },
      "name": "test",
      "shared_secret": "testestest",
      "webhook_uuid": "test-test-test",
      "event_type": "delete",
      "entity_type": "post",
      "created": "1970-01-01T00:00:00+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    },
    {
      "id": 5,
      "url": "https://test.test",
      "user": {
        "id": 1,
        "url": "http://localhost:8000/api/v3/users/1"
      },
      "name": "test",
      "shared_secret": "testestest",
      "webhook_uuid": "test-test-test",
      "event_type": "search",
      "entity_type": "post",
      "created": "1970-01-01T00:00:00+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    },
    {
      "id": 6,
      "url": "http://services.nationalmap.gov/ArcGIS/services/NEXRAD_Weather/MapServer/WMSServer",
      "user": {
        "id": 1,
        "url": "http://localhost:8000/api/v3/users/1"
      },
      "name": "test",
      "shared_secret": "test123estfds78#43fds",
      "webhook_uuid": "4472f128-4448-482a-b279-5a218d3ce559",
      "event_type": "create",
      "entity_type": "post",
      "created": "2022-11-02T20:00:00+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "offset": 0,
  "order": "asc",
  "orderby": "id",
  "curr": "http://localhost:8000/api/v3/webhooks?orderby=id&order=asc&offset=0",
  "next": "http://localhost:8000/api/v3/webhooks?orderby=id&order=asc&offset=0",
  "prev": "http://localhost:8000/api/v3/webhooks?orderby=id&order=asc&offset=0",
  "total_count": 4
}

get webhook

get
Authorizations
Responses
200
OK
application/json
401
Unauthorized
application/json
404
Not Found
application/json
get
GET /api/v3/webhooks/2 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 2,
  "url": "https://test.test",
  "user": {
    "id": 1,
    "url": "http://localhost:8000/api/v3/users/1"
  },
  "name": "test",
  "shared_secret": "testestest",
  "webhook_uuid": "test-test-test",
  "event_type": "create",
  "entity_type": "post",
  "created": "1970-01-01T00:00:00+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}

delete webhook

delete
Authorizations
Responses
200
OK
application/json
401
Unauthorized
application/json
404
Not Found
application/json
delete
DELETE /api/v3/webhooks/3 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 3,
  "url": "https://test.test",
  "user": {
    "id": 1,
    "url": "http://localhost:8000/api/v3/users/1"
  },
  "name": "test",
  "shared_secret": "testestest",
  "webhook_uuid": "test-test-test",
  "event_type": "update",
  "entity_type": "post",
  "created": "1970-01-01T00:00:00+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
  • GETget webhooks
  • add webhooks
  • GETget webhook
  • edit webhooks
  • DELETEdelete webhook
  • edit a webhook post