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
  2. Collections

Collections Page

PreviousCollectionsNextMessages

add collection post

POST https://ushahididocs.api.ushahidi.io/api/v3/collections/2/posts

Request Body

Name
Type
Description

form_id

String

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 for new post

parent_id

Integer

Parent ID for new post

values

Object

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

completed_stages

Array

Contains an array of post-completed stage

published_to

Array

This contains an array of where the post was published

source

String

Source of post

sets

Array

An array of set id's

tags

Array

Contains an object of tag Id's

contact

String

Post contact

{
    "id": 1,
    "url": "http://localhost:8000/api/v3/posts/1",
    "parent_id": null,
    "form": {
        "id": 1,
        "url": "http://localhost:8000/api/v3/forms/1"
    },
    "user_id": null,
    "message": null,
    "color": null,
    "type": "report",
    "title": "Test post",
    "slug": null,
    "content": "Testing post",
    "author_email": null,
    "author_realname": null,
    "status": "published",
    "created": "2013-03-23T03:39:13+00:00",
    "updated": null,
    "locale": "en_us",
    "values": {
        "geometry_test": [
            "MULTIPOLYGON(((40 40,20 45,45 30,40 40)),((20 35,45 20,30 5,10 10,10 30,20 35),(30 20,20 25,20 15,30 20)))"
        ],
        "last_location_point": [
            {
                "lon": 12.123,
                "lat": 21.213
            },
            {
                "lon": 12.223,
                "lat": 21.313
            }
        ],
        "missing_status": [
            "believed_missing"
        ],
        "links": [
            "http://google.com",
            "http://ushahidi.com"
        ],
        "tags1": [
            "3",
            "4"
        ]
    },
    "post_date": "2013-03-22T20:39:13+00:00",
    "tags": [
        {
            "id": 3,
            "url": "http://localhost:8000/api/v3/tags/3"
        },
        {
            "id": 4,
            "url": "http://localhost:8000/api/v3/tags/4"
        }
    ],
    "published_to": [],
    "completed_stages": [],
    "sets": [
        "1"
    ],
    "lock": null,
    "source": null,
    "contact": null,
    "data_source_message_id": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search",
        "change_status",
        "read_full"
    ]
}

get collection posts

get
Authorizations
Query parameters
orderbystringOptional

Sorting parameter Available values : entity fields Default value : featured

Example: name
orderstringOptional

Sorting parameter Available values : [ASC,DESC] !! Default value : Desc

Example: Desc
limitinteger · int32Optional

Paging parameter Default value : null

Example: 2
offsetinteger · int32Optional

Paging parameter Default value : 0

Example: 3
Responses
200
OK
application/json
get
GET /api/v3/collections/1/posts HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "count": 1,
  "results": [
    {
      "id": 1,
      "url": "text",
      "parent_id": "text",
      "form": {
        "id": 1,
        "url": "text"
      }
    }
  ],
  "limit": "text",
  "offset": 1,
  "order": "text",
  "orderby": "text",
  "curr": "text",
  "next": "text",
  "prev": "text",
  "total_count": 1
}

get collection post

get
Authorizations
Responses
200
OK
application/json
404
Not Found
application/json
get
GET /api/v3/collections/1/posts/9999 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 9999,
  "url": "http://localhost:8000/api/v3/posts/9999",
  "message": {
    "id": 9,
    "url": "http://localhost:8000/api/v3/messages/9"
  },
  "type": "report",
  "title": "another report",
  "content": "Some description",
  "status": "published",
  "created": "2014-09-29T16:10:22+00:00",
  "locale": "en_us",
  "values": {
    "last_location_point": [
      {
        "lon": 10.123,
        "lat": 26.213
      }
    ]
  },
  "post_date": "2014-09-29T09:10:22+00:00",
  "tags": [],
  "published_to": [],
  "completed_stages": [],
  "sets": [
    "1"
  ],
  "source": "sms",
  "contact": {
    "id": 3,
    "url": "http://localhost:8000/api/v3/contact/3"
  },
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search",
    "change_status",
    "read_full"
  ]
}

delete collection post

delete
Authorizations
Responses
200
OK
application/json
404
Not Found
application/json
delete
DELETE /api/v3/collections/1/posts/9999 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 9999,
  "url": "http://localhost:8000/api/v3/posts/9999",
  "message": {
    "id": 9,
    "url": "http://localhost:8000/api/v3/messages/9"
  },
  "type": "report",
  "title": "another report",
  "content": "Some description",
  "status": "published",
  "created": "2014-09-29T16:10:22+00:00",
  "locale": "en_us",
  "values": {
    "last_location_point": [
      {
        "lon": 10.123,
        "lat": 26.213
      }
    ]
  },
  "post_date": "2014-09-29T09:10:22+00:00",
  "tags": [],
  "published_to": [],
  "completed_stages": [],
  "sets": [
    "1"
  ],
  "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 collection posts
  • add collection post
  • GETget collection post
  • DELETEdelete collection post