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

Media

PreviousHXLNextVerifier

edit media

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

Request Body

Name
Type
Description

user_id

String

The user identifier

o_size

String

File Size

o_filename

String

File name

mime

String

Media import location e.g. "image/jpeg"

caption

String

The media caption

original_width

String

Width dimension

original_file_size

String

The media file size

original_file_url

String

The media file URL

original_height

String

Height dimension

{
    "id": 1,
    "url": "http://localhost:8000/api/v3/media/1",
    "user": {
        "id": 1,
        "url": "http://localhost:8000/api/v3/users/1"
    },
    "caption": "ihub",
    "created": "2013-10-15T05:43:41+00:00",
    "updated": "2013-10-15T05:43:39+00:00",
    "mime": "image/jpeg",
    "original_file_url": "http://localhost:8000/storage/9ze_1381815819_o.jpg",
    "original_file_size": 1024,
    "original_width": 400,
    "original_height": 500,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}

get media

get
Authorizations
Responses
200
OK
application/json
404
Not Found
application/json
get
GET /api/v3/media/1 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 1,
  "url": "http://localhost:8000/api/v3/media/1",
  "user": {
    "id": 1,
    "url": "http://localhost:8000/api/v3/users/1"
  },
  "caption": "ihub",
  "created": "2013-10-15T05:43:41+00:00",
  "updated": "2013-10-15T05:43:39+00:00",
  "mime": "image/jpeg",
  "original_file_url": "http://localhost:8000/storage/9ze_1381815819_o.jpg",
  "original_file_size": 1024,
  "original_width": 400,
  "original_height": 500,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}

delete media

delete
Authorizations
Responses
200
OK
application/json
401
Unauthorized
application/json
404
Not Found
application/json
delete
DELETE /api/v3/media/3 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 3,
  "url": "http://localhost:8000/api/v3/media/3",
  "user": {
    "id": 2,
    "url": "http://localhost:8000/api/v3/users/2"
  },
  "caption": "ihub",
  "created": "2013-10-15T05:43:41+00:00",
  "updated": "2013-10-15T05:43:39+00:00",
  "mime": "image/jpeg",
  "original_file_url": "http://localhost:8000/storage/9ze_1381815819_o.jpg",
  "original_file_size": 1024,
  "original_width": 600,
  "original_height": 700,
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}
  • GETget media
  • edit media
  • DELETEdelete media