Skip to content

Enrichment Using Curl

Upload Your Input File

$ cat emails.csv
test@test.com
test2@test2.com

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

$ curl -X POST -H "Content-Type: application/json" \
    --data 'emails_payload.json' \
    https://console.demystdata.com/api/files
{
  "id": 55555,
  "upload_url": "https://uploadurl/"
}

$ curl --upload_file 'emails.csv' \
    https://uploadurl/

Create An Enrichment

$ cat enrichment_payload.json
{
  "api_key": "XXX",
  "enrichment": {
    "name": "Test Enrichment",
    "providers": ["domain_from_email"],
    "file_id": 55555
  }
}

$ curl -X POST -H "Content-Type: application/json" \
    --data 'enrichment_payload.json' \
    https://console.demystdata.com/api/enrichments
{
  "id": 1111
}

Check Enrichment Status and Download Results

$ curl -X GET -H "Content-Type: application/json" \
    https://console.demystdata.com/api/enrichments/1111
{
  "state": "running",
  "files": []
}

$ curl -X GET -H "Content-Type: application/json" \
    https://console.demystdata.com/api/enrichments/1111
{
  "state": "completed",
  "files": [
    {
      "provider": "domain_from_email",
      "download_url": "https://downloadurl/"
    }
  ]
}

$ curl https://downloadurl/
# domain_from_email.user, domain_from_email.domain
test, test.com
test2, test.com