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.

Generating a JWT Programatically

email_address and password are the required parameters.

Method

POST https://console.demystdata.com/jwt/create

Payload
{
  "email_address": "test@example.com",
  "password": "your1SecretP@ssword!"
}

Response
eyJasdfiJ9.eyJasdfTB9.OtGasdfIcg

You can use the JWT by including it as part of the Authorization header on requests.

"Authorization: Bearer ${JWT}"

A minimal example with curl would be as follows

  JWT=$(curl -H "Content-Type: application/json" -X POST -d '{"email_address": "<your email address>","password": "<your password>"}' "https://console.demystdata.com/jwt/create")
  echo "$JWT"
  curl -vv -X POST -H "Content-Type: application/json"  -H "Authorization: Bearer $JWT" "https://console.demystdata.com/jwt/verify"

There is also an example in Go. Just download the jwt_example.go change this line
  data := []byte(`{"email_address": "< your email address >","password": "< your password >"}`)

to use your email_address and password and it should compile and run.


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/"
    }
  ]
}

!!! info “state” can be uploading, running, error, complete

Close Menu