Back to top

Datasembly

Datasembly API specification.

Legacy Auth

Datasembly is currently migrating to a new authentication approach using Auth0, this section describes the legacy authentication method still in use by some customers. If you are a new Datasembly customer you have been set up to use Auth0 and should get your token from there.

Resource

POST/v2/user/login

Example URI

POST https://api.datasembly.com/v2/user/login
Request
HideShow
Headers
Content-Type: multipart/form-data; boundary=----------apiformboundary13ul5lX
Body
----------apiformboundary13ul5lX
Content-Disposition: form-data; name="email"

user@organization.com
----------apiformboundary13ul5lX
Content-Disposition: form-data; name="password"

P@ssw0rd123
----------apiformboundary13ul5lX
Response  200
HideShow
Headers
set-authorization: AUTH_TOKEN

Exports

View new exports, export files, and export history. Manage exports by marking exports that have been ingested as received. Each export is made up of a group of files, and each file has a url property that can be used to download the file.

Note that downloading export files requires an auth token in the authorization header. There are two formats for the authorization header depending on whether you are using legacy authentication. Each endpoint below defines a request using the current header format first followed by a request with the legacy format.

List all exports

List all exports
GET/v2/exports{?new}

Example URI

GET https://api.datasembly.com/v2/exports?new=
URI Parameters
HideShow
new
boolean (optional) 

If true, only exports that have not been received are included in the response. If false or missing, all exports are included in the response.

Request
HideShow
Headers
authorization: Bearer AUTH_TOKEN
Request  Legacy Auth
HideShow
Headers
authorization: AUTH_TOKEN
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "exports": [
    {
      "id": 4,
      "settingsId": 4,
      "revision": 0,
      "exported": "2019-01-22T01:44:35Z",
      "start": "2019-01-13T04:00:00Z",
      "end": "2019-01-20T04:00:00Z",
      "entities": [
        {
          "entity": "store",
          "files": [
            {
              "id": 13,
              "name": "20190113_stores_v0_000000000000.csv.gz",
              "recordCount": 25657,
              "url": "https://api.datasembly.com/v2/exports/4/20190113_stores_v0_000000000000.csv.gz"
            }
          ]
        }
      ],
      "received": true,
      "isReport": false
    }
  ]
}

Download export file

Download export file
GET/v2/exports/{export_id}/{file_name}

The body is the content of the export

Example URI

GET https://api.datasembly.com/v2/exports/export_id/file_name
URI Parameters
HideShow
export_id
number | string (required) 

id of the export

file_name
string (required) 

The file name

Request
HideShow
Headers
authorization: Bearer AUTH_TOKEN
Request  Legacy Auth
HideShow
Headers
authorization: AUTH_TOKEN
Response  200
HideShow
Headers
Content-Type: text/csv
transfer-encoding: chunked

Mark the export as received

Mark the export as received
POST/v2/exports/{export_id}

The request body can be left empty

Example URI

POST https://api.datasembly.com/v2/exports/export_id
URI Parameters
HideShow
export_id
number | string (required) 

id of the export

Request
HideShow
Headers
authorization: Bearer AUTH_TOKEN
Request  Legacy Auth
HideShow
Headers
authorization: AUTH_TOKEN
Response  200

Generated by aglio on 19 Oct 2023