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

CSV

PreviousForm StagesNextTest

add csv

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

Request Body

Name
Type
Description

file

String

CSV file

size

String

CSV file size

{
    "id": 1,
    "url": "http://localhost:8000/api/v3/csv/1",
    "columns": [
        "col1,col2"
    ],
    "maps_to": null,
    "fixed": null,
    "filename": "file.csv",
    "mime": "csv",
    "size": 22,
    "created": "1970-01-01T00:00:00+00:00",
    "updated": "2022-11-03T23:14:31+00:00",
    "completed": null,
    "status": null,
    "errors": null,
    "processed": null,
    "collection_id": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}

add csv

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

Request Body

Name
Type
Description

file

String

CSV file

size

String

CSV file size

{
    "id": 1,
    "url": "http://localhost:8000/api/v3/csv/1",
    "columns": [
        "col1,col2"
    ],
    "maps_to": null,
    "fixed": null,
    "filename": "file.csv",
    "mime": "csv",
    "size": 22,
    "created": "1970-01-01T00:00:00+00:00",
    "updated": "2022-11-03T23:14:31+00:00",
    "completed": null,
    "status": null,
    "errors": null,
    "processed": null,
    "collection_id": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}

get all csv

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: Desc
limitinteger · int32Optional

Paging parameter Default value : null

Example: 2
offsetinteger · int32Optional

Paging parameter Default value : 0

Example: 3
columnsstringOptional

Filter parameter check the columns value

Example: col1,col2
maps_tointeger · int32Optional

Filter parameter check the maps_to value

Example: 2
fixedinteger · int32Optional

Filter parameter check the fixed value

Example: 1
filenamestringOptional

Filter parameter check the filename value

Example: file.csv
Responses
200
OK
application/json
401
Unauthorized
application/json
get
GET /api/v3/csv HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "count": 1,
  "results": [
    {
      "id": 1,
      "url": "http://localhost:8000/api/v3/csv/1",
      "columns": [
        "col1,col2"
      ],
      "filename": "file.csv",
      "mime": "csv",
      "size": 200,
      "created": "1970-01-01T00:00:00+00:00",
      "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
      ]
    }
  ],
  "offset": 0,
  "order": "asc",
  "orderby": "id",
  "curr": "http://localhost:8000/api/v3/csv?orderby=id&order=asc&offset=0",
  "next": "http://localhost:8000/api/v3/csv?orderby=id&order=asc&offset=0",
  "prev": "http://localhost:8000/api/v3/csv?orderby=id&order=asc&offset=0",
  "total_count": 1
}

get csv

get
Authorizations
Responses
200
OK
application/json
401
Unauthorized
application/json
404
Not Found
application/json
get
GET /api/v3/csv/20 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 2,
  "url": "http://localhost:8000/api/v3/csv/2",
  "columns": [
    "col3,col4"
  ],
  "filename": "file.csv",
  "mime": "csv",
  "size": 100,
  "created": "1970-01-01T00:00:00+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}

deletecsv

delete
Authorizations
Responses
200
OK
application/json
401
Unauthorized
application/json
404
Not Found
application/json
delete
DELETE /api/v3/csv/1 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 2,
  "url": "http://localhost:8000/api/v3/csv/2",
  "columns": [
    "col3,col4"
  ],
  "filename": "file.csv",
  "mime": "csv",
  "size": 100,
  "created": "1970-01-01T00:00:00+00:00",
  "allowed_privileges": [
    "read",
    "create",
    "update",
    "delete",
    "search"
  ]
}

import csv

post
Authorizations
Responses
200Success
post
POST /api/v3/csv/2/import HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200Success

No content

  • GETget all csv
  • add csv
  • add csv
  • GETget csv
  • DELETEdeletecsv
  • POSTimport csv