Enrich your first contact with the Dropcontact API in two steps: send the contact, then fetch the result.

This guide enriches one contact: Denis Cohen, from the company Dropcontact.

## Before you start

You need a [Dropcontact account](https://app.dropcontact.com/) and an API key.

1. [Create and copy your API key](https://app.dropcontact.com/api) in the app.
2. Set it once at the top of your script, it is reused in every request:

```python

apiKey = "YOUR_API_KEY"
```

In the Shell examples, replace `YOUR_API_KEY` with your API key.

## Step 1: send the contact

**Python**

```python
r = requests.post(
    "https://api.dropcontact.com/v1/enrich/all",
    json={
        "data": [
            {
                "first_name": "Denis",
                "last_name": "Cohen",
                "website": "dropcontact.com",
                "email": "dc@dropcontact.io",
            }
        ],
        "siren": True,
        "language": "en",
    },
    headers={
        "Content-Type": "application/json",
        "X-Access-Token": apiKey,
    },
)
print(r.json())
```

**Shell**

```shell
curl -X POST https://api.dropcontact.com/v1/enrich/all \
  -H "X-Access-Token: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": [{"first_name": "Denis", "last_name": "Cohen", "website": "dropcontact.com", "email": "dc@dropcontact.io"}], "siren": true, "language": "en"}'
```

All the fields and options you can send are listed in [Input record](https://developer.dropcontact.com/en/reference/input-record/).

The API answers:

```json
{
  "credits_left": 15277,
  "request_id": "qzmxkpvlrtdnhwa",
  "error": false,
  "success": true
}
```

Keep the `request_id`: you need it in step 2.

## Step 2: fetch the result

The enrichment takes a few seconds. Replace `REQUEST_ID` with the `request_id` from step 1, then send the request.

**Python**

```python
r = requests.get(
    "https://api.dropcontact.com/v1/enrich/all/REQUEST_ID",
    headers={"X-Access-Token": apiKey},
)
print(r.json())
```

**Shell**

```shell
curl https://api.dropcontact.com/v1/enrich/all/REQUEST_ID \
  -H "X-Access-Token: YOUR_API_KEY"
```

If the result is not ready yet, the API answers with `"success": false`. Send the same request again 30 seconds later.

```json
{
  "error": false,
  "reason": "Request not ready yet, try again in 30 seconds",
  "success": false
}
```

Once the result is ready, the API returns one object per contact, in the order you sent them:

```json
{
  "data": [
    {
      "first_name": "Denis",
      "last_name": "Cohen",
      "full_name": "Denis Cohen",
      "civility": "Mr",
      "linkedin": "www.linkedin.com/in/cohendenis",
      "location": "Paris, Île-de-France, France",
      "email": [
        {
          "email": "dc@dropcontact.io",
          "qualification": "nominative@pro"
        }
      ],
      "company": "Dropcontact",
      "website": "www.dropcontact.com",
      "siret_address": "7 Place de l'Hôtel de Ville",
      "siret_zip": "93600",
      "siret_city": "Aulnay-sous-Bois",
      "country": "France",
      "company_linkedin": "www.linkedin.com/company/dropcontact-email-finder",
      "phone": "+33 1 23 45 67 89",
      "company_turnover": "",
      "company_results": "",
      "nb_employees": "10-19",
      "siren": "823752647",
      "siret": "82375264700029",
      "naf5_code": "62.01Z",
      "naf5_des": "Programmation informatique",
      "vat": "FR11823752647",
      "industry": "Technology, Information and Internet",
      "employee_count": "15"
    }
  ],
  "credits_left": 15277,
  "error": false,
  "success": true
}
```

The `qualification` field tells you how reliable each email is. All the fields of the result are listed in [Enriched record](https://developer.dropcontact.com/en/reference/enriched-record/).

## Next steps

- [Webhooks](https://developer.dropcontact.com/en/webhooks/): get the result directly on your server, without sending the request again.
- [Errors](https://developer.dropcontact.com/en/errors/): what to do when a request fails.
- [Credits](https://developer.dropcontact.com/en/credits/): when a credit is used.
- [API Reference](https://developer.dropcontact.com/en/reference/): all the endpoints and fields.
