Podium Hello World
Overview
Send your first Podium message, list contacts, and check location details using the Podium REST API.
Prerequisites
- Completed
podium-install-authsetup with valid access token - A Podium location ID
Instructions
Step 1: List Locations
const { data } = await podium.get('/locations');
for (const loc of data.data) {
console.log(`Location: ${loc.attributes.name} (ID: ${loc.id})`);
}
Step 2: List Contacts
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}`);
}
Step 3: Send a Message
// 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}`);
Output
- Listed locations with IDs
- Retrieved contacts for a location
- Sent a test message via Podium
Error Handling
| 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 |
Resources
Next Steps
Build messaging workflow: podium-core-workflow-a