Projects
Syncing data with your Projects
Note: this API is in beta currently and is subject to change in the future.

Datasource

Sync Datasource

This endpoint is used to pass a payload of key/values to the datasource. The fields passed within payload are based on your Datasource configuration.
1
POST /api/v2/projects/datasources/12345/sync/
Copied!

Data payload example

1
{
2
"payload": {
3
"Site Title": "New Site",
4
"URL": "www.example.com"
5
}
6
}
Copied!

Response

If the sync is successful, you will receive a 202 status response that will contain information about the objects that were created or modified.
1
{
2
"objects": [
3
{
4
"obj_type": "Business",
5
"method": "update",
6
"data": {
7
...The full Business detail will be returned here
8
},
9
"resource_uri": "/api/v2/businesses/12345"
10
},
11
{
12
"obj_type": "Site",
13
"method": "create".,
14
"data": {
15
...The full Site detail will be returned here
16
},
17
"resource_uri": "/api/v2/sites/123456"
18
}
19
]
20
}
Copied!
If there are errors with the sync, you will receive a 400 status response.
If the error is general (configuration errors, or bad payload data) you will receive a ErrorLog type.
1
{
2
"__all__": [
3
{
4
"type": "ErrorLog",
5
"error": "KeyError: u'Site Title'"
6
}
7
]
8
}
Copied!
If the error is related to validation issues with a particular object API, you will receive a APIErrorLog type with more structured information.
1
{
2
"__all__": [
3
{
4
"type": "APIErrorLog",
5
"error": {
6
"formatted_domain": ["Invalid domain: notvalid"]
7
}
8
}
9
]
10
}
Copied!

Last modified 1yr ago