技能 编程开发 Podium消息API集成指南

Podium消息API集成指南

v20260423
podium-hello-world
本技能提供Podium平台API的完整集成示例,用于业务消息和沟通平台。它演示了核心功能,包括列出所有业务地点、获取指定地点的客户联系人,以及通过API发送测试消息。适用于自动化处理业务消息流程、管理客户互动或将消息和评论功能集成到现有业务系统。
获取技能
416 次下载
概览

Podium Hello World

Overview

Send your first Podium message, list contacts, and check location details using the Podium REST API.

Prerequisites

  • Completed podium-install-auth setup 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

ErrorCauseSolution
404 Location not foundWrong location IDList locations first to get valid IDs
422 Invalid phoneBad phone formatUse E.164 format: +15551234567
403 ForbiddenMissing scopeAdd messages.write scope to OAuth app

Resources

Next Steps

Build messaging workflow: podium-core-workflow-a

信息
分类 编程开发
名称 podium-hello-world
版本 v20260423
大小 2.22KB
更新时间 2026-04-28
语言