Examples
Add zedgad to your backend.
Call zedgad from your server, not from the browser, so your project API key stays private.
Python
Django
import requests
def send_to_zedgad(job):
response = requests.post(
"https://api.zedgad.com/api/webhooks/content/",
headers={
"Authorization": f"Bearer {ZEDGAD_API_KEY}",
"Content-Type": "application/json",
},
json={
"external_id": str(job.id),
"type": "job",
"title": job.title,
"summary": job.description[:240],
"url": job.public_url,
"metadata": {
"company": job.company_name,
"location": job.location,
},
},
timeout=20,
)
response.raise_for_status()
return response.json()JavaScript
Node.js
export async function sendToZedgad(job) {
const response = await fetch("https://api.zedgad.com/api/webhooks/content/", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ZEDGAD_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
external_id: String(job.id),
type: "job",
title: job.title,
summary: job.summary,
url: job.url,
metadata: {
company: job.company,
location: job.location,
},
}),
});
if (!response.ok) {
throw new Error(`zedgad failed: ${response.status}`);
}
return response.json();
}