Send your first Podium message, list contacts, and check location details using the Podium REST API.
podium-install-auth setup with valid access tokenconst { data } = await podium.get('/locations');
for (const loc of data.data) {
console.log(`Location: ${loc.attributes.name} (ID: ${loc.id})`);
}
const locationId = 'loc_xxxxx';
const { data } = await podium.get(`/locations/${locationId}/contacts`);
for (const contact of data.data) {
console.log(` ${contact.attributes.name} — ${contact.attributes.phone}`);
}
// Messages are sent via the Podium platform to the customer's phone
const { data } = await podium.post(`/locations/${locationId}/messages`, {
data: {
attributes: {
body: 'Hello from our integration! How can we help?',
'contact-phone': '+15551234567',
},
},
});
console.log(`Message sent: ${data.data.id}`);
| Error | Cause | Solution |
|---|---|---|
404 Location not found |
Wrong location ID | List locations first to get valid IDs |
422 Invalid phone |
Bad phone format | Use E.164 format: +15551234567 |
403 Forbidden |
Missing scope | Add messages.write scope to OAuth app |
Build messaging workflow: podium-core-workflow-a