Microreact
Search…
Migrating to the new API

Summary of breaking changes

The new Microreact API only accepts authenticated requests. Calls without an Acccess-Token headers will fail with 401 Unauthorized error.
New API
Old API
API Endpoint
https://microreact.org/api/projects/create/
https://microreact.org/api/project/
Request body
A valid .microreact JSON file
Old API request payload as documented in https://old.microreact.org/api-docs
Access-Token header
Required (Obtain your access token from https://demo.microreact.org/my-account/settings)
Optional

Converting old API request payload

You can convert an old API request payload to a new .microreact JSON file using the schema convertor endpoint:
cURL + Bash
1
curl \
2
--header "Content-type: application/json; charset=UTF-8" \
3
--request POST \
4
--data '{ "name": "hayu110x2c0smcm", "data": "https://www.dropbox.com/s/hayu110x2c0smcm/data.csv?dl=1" }' \
5
https://demo.microreact.org/api/schema/convert
Copied!
The response is a valid .microreact JSON file
1
{
2
"datasets": {
3
"dataset-1": {
4
"file": "data-file-1",
5
"idFieldName": "id"
6
}
7
},
8
"files": {
9
"data-file-1": {
10
"id": "data-file-1",
11
"format": "text/csv",
12
"name": "data.csv",
13
"url": "https://www.dropbox.com/s/hayu110x2c0smcm/data.csv?dl=1"
14
}
15
},
16
"maps": {
17
"map-1": {
18
"title": "Map",
19
"latitudeField": "__latitude",
20
"longitudeField": "__longitude"
21
}
22
},
23
"meta": {
24
"name": "hayu110x2c0smcm"
25
},
26
"tables": {
27
"table-1": {
28
"dataset": "dataset-1",
29
"title": "Metadata",
30
"columns": [
31
{
32
"field": "id"
33
},
34
{
35
"field": "__latitude"
36
},
37
{
38
"field": "__longitude"
39
},
40
{
41
"field": "country"
42
},
43
{
44
"field": "__year"
45
},
46
{
47
"field": "__month"
48
},
49
{
50
"field": "__day"
51
}
52
]
53
}
54
},
55
"timelines": {
56
"timeline-1": {
57
"title": "Timeline",
58
"dataType": "year-month-day",
59
"yearField": "__year",
60
"monthField": "__month",
61
"dayField": "__day"
62
}
63
},
64
"schema": "https://microreact.org/schema/v1.json"
65
}
Copied!
You can also pipe the response into the create project endpoint as in the following example:
1
curl \
2
--header "Content-type: application/json; charset=UTF-8" \
3
--request POST \
4
--data '{ "name": "hayu110x2c0smcm", "data": "https://www.dropbox.com/s/hayu110x2c0smcm/data.csv?dl=1" }' \ # Old API request payload as documented in https://old.microreact.org/api-docs
5
https://demo.microreact.org/api/schema/convert \
6
| \
7
curl \
8
--header "Content-type: application/json; charset=UTF-8" \
9
--header "Access-Token: eyJhbGciOiJIUzUxMiJ9..." \ # Obtain your access token from https://demo.microreact.org/my-account/settings
10
--data @- \
11
https://demo.microreact.org/api/projects/create
Copied!
Last modified 17d ago