Authentication

For authorization, B2B-Enrichment requires you to include your API key in the X-TOKEN header for each request. Below are examples demonstrating how to set this up in different programming languages.

Example in Python

Using the requests library, you can include the X-TOKEN header as shown below:

import requests

api_key = 'YOUR_API_KEY'
url = 'https://app.b2b-enrichment.com/api/b2b-enrichment/gm/profiles'

headers = {
    'X-TOKEN': api_key,
    'content-type': 'application/json'
}
payload = {}
response = requests.post(url, headers=headers, json=payload)
data = response.json()

print(data)

Example in JavaScript

Using the fetch API, you can set the header as follows:

const apiKey = 'YOUR_API_KEY';
const url = 'https://app.b2b-enrichment.com/api/b2b-enrichment/gm/profiles'
const payload = {}
fetch(url, {
    method: 'POST',
    headers: {
        'X-TOKEN': apiKey,
        'content-type': 'application/json'
    },
    body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Example in cURL

With cURL , you can specify the header in your request like this:

curl -H "X-TOKEN: YOUR_API_KEY" -d "{}" "https://app.b2b-enrichment.com/api/b2b-enrichment/gm/profiles"