Learn how to authenticate with the BidYard API
BidYard uses different authentication methods depending on which API endpoint you're accessing:
POST /v1/leads): Source Token or HMAC AuthenticationThe simplest way to authenticate lead submissions. Use a Source Token obtained from your BidYard dashboard.
Dashboard → Sources → Your Source → Tokens tab
POST /v1/leads HTTP/1.1 Authorization: Bearer YOUR_SOURCE_TOKEN Content-Type: application/json
curl -X POST https://api.bidyard.dev/v1/leads \
-H "Authorization: Bearer your_source_token" \
-H "Content-Type: application/json" \
-d '{
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"phone": "555-123-4567"
}'For enhanced security, sign each request with HMAC-SHA256. This ensures request integrity and prevents tampering.
Dashboard → Sources → Your Source → Settings tab (Source Key & Secret)
X-Source-Key: Your source keyX-Signature: HMAC-SHA256 signature of the request bodysignature = HMAC-SHA256(request_body, source_secret)
const crypto = require('crypto');
const requestBody = JSON.stringify({
firstName: 'John',
lastName: 'Doe',
email: '[email protected]',
phone: '555-123-4567'
});
const signature = crypto
.createHmac('sha256', sourceSecret)
.update(requestBody)
.digest('hex');
fetch('https://api.bidyard.dev/v1/leads', {
method: 'POST',
headers: {
'X-Source-Key': sourceKey,
'X-Signature': signature,
'Content-Type': 'application/json'
},
body: requestBody
});import hmac
import hashlib
import json
import requests
request_body = json.dumps({
'firstName': 'John',
'lastName': 'Doe',
'email': '[email protected]',
'phone': '555-123-4567'
})
signature = hmac.new(
source_secret.encode('utf-8'),
request_body.encode('utf-8'),
hashlib.sha256
).hexdigest()
requests.post(
'https://api.bidyard.dev/v1/leads',
headers={
'X-Source-Key': source_key,
'X-Signature': signature,
'Content-Type': 'application/json'
},
data=request_body
)REQUEST_BODY='{"firstName":"John","lastName":"Doe","email":"[email protected]","phone":"555-123-4567"}'
SIGNATURE=$(echo -n "$REQUEST_BODY" | openssl dgst -sha256 -hmac "$SOURCE_SECRET" | sed 's/^.* //')
curl -X POST https://api.bidyard.dev/v1/leads \
-H "X-Source-Key: $SOURCE_KEY" \
-H "X-Signature: $SIGNATURE" \
-H "Content-Type: application/json" \
-d "$REQUEST_BODY"For accessing other API endpoints beyond lead delivery (campaigns, buyers, etc.).
Dashboard → Organization → Settings tab → API Keys
GET /v1/campaigns HTTP/1.1 X-API-Key: YOUR_CLIENT_API_KEY