REST · ваш аккаунт
Account API
REST от имени пользователя через JWT или ключ fm_live_…. Полный доступ к чатам и сообщениям.
Профиль
Загрузка…
Эндпоинты Account API
GET /api/v1/account/me— профильGET /api/v1/account/users/search?q=— поиск пользователейGET /api/v1/account/chats— список чатовPOST /api/v1/account/chats/direct— открыть личку (user_idилиusername)GET /api/v1/account/chats/{id}— информация о чатеGET /api/v1/account/chats/{id}/messages— историяPOST /api/v1/account/chats/{id}/messages— отправить ({"text":"..."})POST /api/v1/account/chats/{id}/read— прочитано (last_read_message_id)
# Профиль
curl -sS https://forevormess.com/api/v1/account/me \
-H "Authorization: Bearer fm_live_..."
# Открыть чат с ботом
curl -sS -X POST https://forevormess.com/api/v1/account/chats/direct \
-H "Authorization: Bearer fm_live_..." \
-H "Content-Type: application/json" \
-d '{"username":"my_bot"}'
# Отправить сообщение
curl -sS -X POST https://forevormess.com/api/v1/account/chats/CHAT_ID/messages \
-H "Authorization: Bearer fm_live_..." \
-H "Content-Type: application/json" \
-d '{"text":"Привет!"}'