Interacting with a chat
The most common operations that can be accomplished through API are:
Send a message:
Find complete documentation for this API at https://api-docs.omni.chat/#tag/messages
curl --location --request POST 'https://api.omni.chat/v1/messages' \
--header 'x-api-secret: API_SECRET' \
--header 'x-api-key: API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"chatId": "CHAT_OBJECT_ID",
"message": "Hi",
"type": "TEXT"
}
'
Route a chat to an User:
Find complete documentation for this API at https://api-docs.omni.chat/#tag/chats/paths/~1chats~1%7BobjectId%7D~1route/post
curl --location --request POST 'https://api.omni.chat/v1/chats/CHAT_OBJECT_ID/route' \
--header 'x-api-secret: API_SECRET' \
--header 'x-api-key: API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"userId": "USER_OBJECT_ID",
"type": "USER"
}
'
Route a chat to a Team:
Find complete documentation for this API at https://api-docs.omni.chat/#tag/chats/paths/~1chats~1%7BobjectId%7D~1route/post
curl --location --request POST 'https://api.omni.chat/v1/chats/CHAT_OBJECT_ID/route' \
--header 'x-api-secret: API_SECRET' \
--header 'x-api-key: API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"teamId": "TEAM_OBJECT_ID",
"type": "TEAM"
}
'
Finish a chat
Find complete documentation for this API at https://api-docs.omni.chat/#tag/chats/paths/~1chats~1%7BobjectId%7D~1finish/post
curl --location --request POST 'https://api.omni.chat/v1/chats/CHAT_OBJECT_ID/finish' \
--header 'x-api-secret: API_SECRET' \
--header 'x-api-key: API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"closingReason": "MY_REASON"
}
'
Updated over 1 year ago