Account API

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":"Привет!"}'

Проверка ключа