Skip to content

APIs

You can Download the example code and execute it yourself!

The example code requires the jq utility. Download jq

You may have to modify the permissions to execute the example code.

$ chmod 755 enrichment_example.sh.

Then to execute

$ ./enrichment_example.sh


A Note About Authentication / JWTs

The examples below show the use of an api_key parameter in the JSON payload.

You can include a JWT as the Authorization header instead of using an API_KEY if you prefer.

See the enrichment_example.sh download above for an example of how to acquire and use a JWT.


Files

New File

file['name'] in the payload must be unique, you cannot use the same name twice.

Method

POST https://console.demystdata.com/v1/files

Payload

{
  "api_key": "XXX",
  "file": {
    "name": "test.csv",
    "headers": ["email_address"],
    "num_rows": 1
  }
}

Response

{
  "id": 1234,
  "upload_url": "http://unique.upload.url/"
}

Enrichments

New Enrichment

enrichment['name'] in the payload must be unique, you cannot use the same name twice. enrichment['file_id'] should reference the id in the response from creating the file above.

Method

POST https://console.demystdata.com/v1/enrichments

Payload

{
  "api_key": "XXX",
  "enrichment": {
    "name": "Enrichment Name",
    "providers": ["domain_from_email"],
    "file_id": 1234
  }
}

Response

{
  "id": 54321
}

Show Enrichment Status

Use the id returned from enrichment create when polling for enrichment status

Method

GET https://console.demystdata.com/v1/enrichments/:id

Response

{
  "id": 15,
  "name": "Enrichment 32427",
  "state": "complete",
  "providers": [ "domain_from_email" ],
  "input_file": {
    "id": 16,
    "name": "my_input_file-6669.csv",
    "num_rows": 10,
    "headers": [
      "email_address"
    ]
  },
  "download_files": [
    {
      "provider": "domain_from_email",
      "download_url": "https://url/"
    }
  ]
}

state

can be uploading, running, error, complete