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

Messages

PreviousCollections PageNextExports

add message

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

Request Body

Name
Type
Description

parent_id

String

The parent identifier

datetime

String

Date and time

user_id

String

user ID

title

String

Massage title

data_source_message_id

String

Data source message identifier

message

String

The main message you would like to add

contact_id

Integer

The post contact identifier

data_source

String

Data source

post_id

String

post ID

notification_post_id

String

Notification post identifier

additional_data

String

Additional information

direction

String

Message direction e.g. "outgoing"

status

String

Message status

type

String

Message type e.g. "sms"

contact_type

String

Contact type

contact

String

Message contact

{
    "id": 20,
    "url": "http://localhost:8000/api/v3/messages/20",
    "user": {
        "id": 2,
        "url": "http://localhost:8000/api/v3/users/2"
    },
    "parent_id": null,
    "contact_id": 3,
    "post_id": null,
    "data_source": null,
    "data_source_message_id": null,
    "title": null,
    "message": "Another test message",
    "datetime": null,
    "type": "sms",
    "status": "pending",
    "direction": "outgoing",
    "created": "2022-11-02T15:20:45+00:00",
    "additional_data": null,
    "notification_post_id": null,
    "contact": null,
    "contact_type": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}

edit message

PUT https://ushahididocs.api.ushahidi.io/api/v3/messages/18

Request Body

Name
Type
Description

parent_id

String

The parent identifier

datetime

String

Date and time

user_id

String

user ID

title

String

Massage title

data_source_message_id

String

Data source message identifier

message

String

The main message you would like to add

contact_id

Integer

The post contact identifier

data_source

String

Data source

post_id

String

post ID

notification_post_id

String

Notification post identifier

additional_data

String

Additional information

direction

String

Message direction e.g. "outgoing"

status

String

Message status

type

String

Message type e.g. "sms"

contact_type

String

Contact type

contact

String

Message contact

{
    "id": 20,
    "url": "http://localhost:8000/api/v3/messages/20",
    "user": {
        "id": 2,
        "url": "http://localhost:8000/api/v3/users/2"
    },
    "parent_id": null,
    "contact_id": 3,
    "post_id": null,
    "data_source": null,
    "data_source_message_id": null,
    "title": null,
    "message": "Another test message",
    "datetime": null,
    "type": "sms",
    "status": "pending",
    "direction": "outgoing",
    "created": "2022-11-02T15:20:45+00:00",
    "additional_data": null,
    "notification_post_id": null,
    "contact": null,
    "contact_type": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}

get messages

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
boxstringOptional

Filter Parameter Available values : [outbox,inbox,archived]

Example: outbox
statusstringOptional

Filter Parameter Available values : [all,received,archived,pending,sent]

Example: received
contactinteger · int32Optional

Filter Parameter check the contact id

Example: 1
parentinteger · int32Optional

Filter Parameter check the parent id

Example: 2
postinteger · int32Optional

Filter Parameter check the post id

Example: 1
typestringOptional

Filter Parameter check the type Available values : [sms,twitter,email]

Example: sms
qstringOptional

Filter Parameter check the value if it likes contact, title, message

Example: test
data_sourcestringOptional

Filter Parameter check the data_source Available values : [sms,twitter,email]

Example: smssync
Responses
200
OK
application/json
401
Unauthorized
application/json
get
GET /api/v3/messages HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "count": 1,
  "results": [
    {
      "id": 1,
      "url": "text",
      "parent_id": "text",
      "contact_id": 1,
      "post_id": "text",
      "user_id": "text",
      "data_source": "text",
      "data_source_message_id": "text",
      "title": "text",
      "message": "text",
      "datetime": {
        "date": "text",
        "timezone_type": 1,
        "timezone": "text"
      },
      "type": "text",
      "status": "text",
      "direction": "text",
      "created": "text",
      "additional_data": "text",
      "notification_post_id": "text",
      "contact": "text",
      "contact_type": "text",
      "allowed_privileges": [
        "text"
      ],
      "user": {
        "id": 1,
        "url": "text"
      }
    }
  ],
  "limit": "text",
  "offset": 1,
  "order": "text",
  "orderby": "text",
  "curr": "text",
  "next": "text",
  "prev": "text",
  "total_count": 1
}

get message

get
Authorizations
Responses
200
OK
application/json
401
Unauthorized
application/json
404
Not Found
application/json
get
GET /api/v3/messages/2 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 2,
  "url": "http://localhost:8000/api/v3/messages/2",
  "contact_id": 3,
  "title": "",
  "message": "Another test message",
  "type": "sms",
  "status": "received",
  "direction": "incoming",
  "created": "1970-01-01T00:00:00+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "delete",
    "search"
  ]
}

get message posts

get
Authorizations
Responses
200
OK
application/json
401
Unauthorized
application/json
404
Not Found
application/json
get
GET /api/v3/messages/4/post HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 110,
  "url": "http://localhost:8000/api/v3/posts/110",
  "user": {
    "id": 1,
    "url": "http://localhost:8000/api/v3/users/1"
  },
  "form": {
    "id": 1,
    "url": "http://localhost:8000/api/v3/forms/1"
  },
  "message": {
    "id": 4,
    "url": "http://localhost:8000/api/v3/messages/4"
  },
  "type": "report",
  "title": "ACL test post",
  "content": "Testing oauth posts api access",
  "status": "published",
  "created": "2012-12-17T11:18:40+00:00",
  "locale": "en_us",
  "values": {
    "last_location": [
      "Trisolaris"
    ]
  },
  "post_date": "2012-12-17T03:18:40+00:00",
  "tags": [],
  "published_to": [],
  "completed_stages": [],
  "sets": [],
  "source": "sms",
  "contact": {
    "id": 3,
    "url": "http://localhost:8000/api/v3/contact/3"
  },
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search",
    "change_status",
    "read_full"
  ]
}
  • GETget messages
  • add message
  • GETget message
  • edit message
  • GETget message posts