arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Upload API

How to upload new and update existing datasets

hashtag
Authorization

Authoritation is done in the header via an user-based token. The token can be generated via the Admin Interface

hashtag
Create new dataset

POST /api/v1/datasets/

hashtag
Headers

Name
Type
Description

hashtag
Request Body

Name
Type
Description

hashtag
Update existing dataset

hashtag
Parameters

hashtag
Example Response

hashtag
Example

Authorization : Token yourtoken

Authorization

string

file

string

profile

string

Name

Description

required

file

the file you want to update

True

update

not just update the dataset but also update the corresponding Indicator Data

False

overwrite

remove the previous data (including the Indicator Data) and replace with new data from dataset

False

POST /api/v1/datasets/:id/upload/
{
    "id": 78,
    "created": "2021-04-28T09:57:01+0000",
    "updated": "2021-04-28T09:57:10+0000",
    "name": "Cases",
    "groups": [
        "date"
    ],
    "permission_type": "private",
    "profile": 1,
    "geography_hierarchy": 1,
    "upload_task_id": "44ceb2d8acd04343bbcb7ca8f0468b6c",
}
curl --location --request POST 'http://api.wazimap.com/api/v1/datasets/84/upload/' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Token yourtoken' \
--form 'file=@/covid_next.csv' \
--form 'update=True' \
--form 'overwrite=True'