Send text
POSThttps://ruanginbox.com/api/v1/devices/{device_id}/messages/text
Kirim pesan teks. Response `202` artinya job masuk antrian — bukan pesan sudah sampai.
| Field | Wajib | Keterangan |
|---|
| to | ya | Nomor internasional tanpa `+` / spasi, atau JID WhatsApp |
| text | ya | Isi pesan |
curl -sS -X POST "https://ruanginbox.com/api/v1/devices/$DEVICE_ID/messages/text" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":"628123456789","text":"Halo dari RuangInbox API"}'
{
"job_id": "7c2e9f0a-….uuid",
"status": "queued",
"session_id": "ruanginbox-session-id",
"kind": "text"
}
Send text
POSThttps://ruanginbox.com/api/v1/channels/telegram/bots/{bot_id}/messages/text
Kirim teks sinkron lewat Bot API. `chat_id` adalah ID chat Telegram (string atau number). Conversation inbox di-upsert otomatis.
| Field | Wajib | Keterangan |
|---|
| chat_id | ya | Telegram chat id |
| text | ya | Isi pesan |
curl -sS -X POST "https://ruanginbox.com/api/v1/channels/telegram/bots/$BOT_ID/messages/text" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"chat_id":"123456789","text":"Halo dari RuangInbox API"}'
{
"ok": true,
"bot_id": "…",
"chat_id": "123456789",
"conversation_id": "…",
"message_id": "…",
"telegram_message_id": 42,
"status": "sent",
"kind": "text"
}
User harus pernah start bot (`/start`) atau chat terbuka; jika belum, Telegram mengembalikan error (HTTP 502).
Meta pages (shared)
Instagram dan Messenger bisa memakai Facebook Page yang sama, tetapi diaktifkan terpisah. Instagram butuh akun profesional yang tertaut dan izin instagram_manage_messages. Messenger butuh pages_messaging dan messaging_type RESPONSE.
GEThttps://ruanginbox.com/api/v1/channels/meta/pages
List Meta pages workspace.
curl -sS -X GET "https://ruanginbox.com/api/v1/channels/meta/pages" \
-H "Authorization: Bearer $API_KEY"
POSThttps://ruanginbox.com/api/v1/channels/meta/pages
Create page — `page_id` + `page_access_token` wajib; `ig_user_id` opsional.
curl -sS -X POST "https://ruanginbox.com/api/v1/channels/meta/pages" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Support","page_id":"1234567890","page_access_token":"EAAB…","ig_user_id":"1784…"}'
GEThttps://ruanginbox.com/api/v1/channels/meta/pages/{page_id}
Detail page (UUID RuangInbox).
curl -sS -X GET "https://ruanginbox.com/api/v1/channels/meta/pages/$PAGE_UUID" \
-H "Authorization: Bearer $API_KEY"
DELETEhttps://ruanginbox.com/api/v1/channels/meta/pages/{page_id}
Hapus page dari workspace.
curl -sS -X DELETE "https://ruanginbox.com/api/v1/channels/meta/pages/$PAGE_UUID" \
-H "Authorization: Bearer $API_KEY"
POSThttps://ruanginbox.com/api/v1/channels/meta/pages/{page_id}/connect
Validasi token, discover IG, subscribe apps.
curl -sS -X POST "https://ruanginbox.com/api/v1/channels/meta/pages/$PAGE_UUID/connect" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
Send text
POSThttps://ruanginbox.com/api/v1/channels/instagram/pages/{page_id}/messages/text
`page_id` = UUID RuangInbox (bukan Facebook Page ID). `recipient_id` = Instagram Scoped ID (IGSID).
| Field | Wajib | Keterangan |
|---|
| recipient_id | ya | IGSID (alias: `igsid`) |
| text | ya | Isi pesan |
curl -sS -X POST "https://ruanginbox.com/api/v1/channels/instagram/pages/$PAGE_UUID/messages/text" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"recipient_id":"IGSID…","text":"Halo dari RuangInbox"}'
Meta pages (shared)
Lihat juga section Instagram → Meta pages. Resource `/channels/meta/pages` dipakai bersama.
GEThttps://ruanginbox.com/api/v1/channels/meta/pages
List pages (sama endpoint Instagram).
curl -sS -X GET "https://ruanginbox.com/api/v1/channels/meta/pages" \
-H "Authorization: Bearer $API_KEY"
POSThttps://ruanginbox.com/api/v1/channels/meta/pages
Create page + Page Access Token.
curl -sS -X POST "https://ruanginbox.com/api/v1/channels/meta/pages" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Support","page_id":"1234567890","page_access_token":"EAAB…"}'
POSThttps://ruanginbox.com/api/v1/channels/meta/pages/{page_id}/connect
Subscribe messaging fields Meta.
curl -sS -X POST "https://ruanginbox.com/api/v1/channels/meta/pages/$PAGE_UUID/connect" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
Send text
POSThttps://ruanginbox.com/api/v1/channels/messenger/pages/{page_id}/messages/text
`recipient_id` = Page-Scoped ID (PSID).
| Field | Wajib | Keterangan |
|---|
| recipient_id | ya | PSID (alias: `psid`) |
| text | ya | Isi pesan |
curl -sS -X POST "https://ruanginbox.com/api/v1/channels/messenger/pages/$PAGE_UUID/messages/text" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"recipient_id":"PSID…","text":"Halo dari RuangInbox"}'