Conversation
Overview
VoIPBIN Conversations empowers developers to build engaging and cross-channel messaging experiences with ease, using just a few API calls. Users can initiate a conversation through SMS/MMS and seamlessly continue it over other channels such as Chat or SNS (Social Networking Service). The Conversations API enables developers to create conversations, add participants, and set up webhooks to monitor and intercept any relevant events occurring within a conversation.
Unified conversation
VoIPBIN Conversations provides support for various types of methods, allowing for a unified and cohesive communication experience for users.
With unified conversation capabilities, users can switch between different channels seamlessly without any disruption. For instance, a conversation may begin with an SMS, and the user can effortlessly continue the same conversation using a chat platform or a social networking service. This unified approach simplifies communication for users and ensures that they can engage in meaningful interactions across different channels without any friction.
By leveraging VoIPBIN Conversations, developers can create versatile messaging solutions that deliver a seamless and consistent experience for users, regardless of the communication channels they choose to utilize. This flexibility enables businesses to engage with their customers efficiently and effectively, providing a cohesive and engaging messaging experience across a diverse range of platforms and channels.
Seperated conversation room
VoIPbin’s conversation feature ensures a well-organized messaging experience by creating distinct conversation rooms. When a new message is sent or received, VoIPbin examines the communication method and participants. If the properties (method/participants) match an existing conversation room, the message is added to that room. In cases where there are no matching properties, a new conversation room is created.
With VoIPbin’s conversation capability, users are liberated from worrying about the communication method. Simply send the message to the conversation room using the Conversation API, and VoIPbin seamlessly translates the message to the appropriate method, streamlining the entire communication process
Conversation
Conversation
{
"id": "<string>",
"name": "<string>",
"detail": "<string>",
"reference_type": "<string>",
"reference_id": "<string>",
"source": {
...
},
"participants": [
...
],
"tm_create": "<string>",
"tm_update": "<string>",
"tm_delete": "<string>"
}
id: Conversation’s ID.
name: Conversation’s name.
detail: Conversation’s detail.
reference_type: Conversation’s reference type. See detail here.
reference_id: Conversation’s reference id.
source: Conversation’s source address. See detail here.
participants: List of participants. See detail here.
Example
{
"id": "bdc9d9f5-706c-4e2d-9be7-7dc1e5fd45a0",
"name": "conversation",
"detail": "conversation detail",
"reference_type": "message",
"reference_id": "+673802",
"source": {
"type": "tel",
"target": "+14703298699",
"target_name": "",
"name": "",
"detail": ""
},
"participants": [
{
"type": "tel",
"target": "+14703298699",
"target_name": "",
"name": "",
"detail": ""
},
{
"type": "tel",
"target": "+673802",
"target_name": "",
"name": "",
"detail": ""
}
],
"tm_create": "2022-06-23 05:05:40.950834",
"tm_update": "2022-06-23 05:05:40.950842",
"tm_delete": "9999-01-01 00:00:00.000000"
}
Reference type
Conversation’s reference type.
Reference type |
Description |
---|---|
message |
Message(SMS/MMS). |
line |
Line. |
Message
Message
{
"id": "<string>",
"conversation_id": "<string>",
"direction": "<string>",
"status": "<string>",
"reference_type": "<string>",
"reference_id": "<string>",
"source": {
...
},
"text": "<string>",
"medias": [],
"tm_create": "<string>",
"tm_update": "<string>",
"tm_delete": "<string>"
}
id: Message’s ID.
conversation_id: Conversation’s ID.
direction: Message’s direction. See detail here.
status: Message’s status.
reference_type: Conversation’s reference type. See detail here.
reference_id: Conversation’s reference id.
source: Conversation’s source address. See detail here.
text: Message’s text.
medias: Message’s medias.
Example
{
"id": "cc46341b-f00a-452f-b527-19c85d030eaf",
"conversation_id": "64558b45-40a8-43db-b814-9c0dbf6d47b5",
"direction": "incoming",
"status": "received",
"reference_type": "line",
"reference_id": "Ud871bcaf7c3ad13d2a0b0d78a42a287f",
"source": {
"type": "line",
"target": "Ud871bcaf7c3ad13d2a0b0d78a42a287f",
"target_name": "",
"name": "",
"detail": ""
},
"text": "안녕",
"medias": [],
"tm_create": "2022-06-24 04:28:51.558082",
"tm_update": "2022-06-24 04:28:51.558090",
"tm_delete": "9999-01-01 00:00:00.000000"
}
Direction
Message’s direction.
Direction type |
Description |
---|---|
incoming |
Incoming message(Towards voipbin). |
outgoing |
Outgoing message(From voipbin). |
Tutorial
Setup the conversation
$ curl --location --request POST 'https://api.voipbin.net/v1.0/conversations/setup?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lciI6IntcImlkXCI6XCI1ZTRhMDY4MC04MDRlLTExZWMtODQ3Ny0yZmVhNTk2OGQ4NWJcIixcInVzZXJuYW1lXCI6XCJhZG1pblwiLFwibmFtZVwiOlwiYWRtaW5cIixcImRldGFpbFwiOlwiYWRtaW4gYWNjb3VudFwiLFwid2ViaG9va19tZXRob2RcIjpcIlBPU1RcIixcIndlYmhvb2tfdXJpXCI6XCJodHRwczovL2VuN2V2YWp3aG1xYnQueC5waXBlZHJlYW0ubmV0XCIsXCJwZXJtaXNzaW9uX2lkc1wiOltcIjAzNzk2ZTE0LTdjYjQtMTFlYy05ZGJhLWU3MjAyM2VmZDFjNlwiXSxcInRtX2NyZWF0ZVwiOlwiMjAyMi0wMi0wMSAwMDowMDowMC4wMDAwMDBcIixcInRtX3VwZGF0ZVwiOlwiMjAyMi0wNS0xMSAxMzoxNzo1MC42ODkyMzNcIixcInRtX2RlbGV0ZVwiOlwiOTk5OS0wMS0wMSAwMDowMDowMC4wMDAwMDBcIn0iLCJleHAiOjE2NTU3Nzc3NDZ9.9oso_dm-i8U9QMeaCgop87T7PRosYD7gPKyN_xpVBrM' \
--header 'Content-Type: application/json' \
--data-raw '{
"reference_type": "line"
}'
Get list of conversations
Example
$ curl -k --location --request GET 'https://api.voipbin.net/v1.0/conversations?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lciI6IntcImlkXCI6XCI1ZTRhMDY4MC04MDRlLTExZWMtODQ3Ny0yZmVhNTk2OGQ4NWJcIixcInVzZXJuYW1lXCI6XCJhZG1pblwiLFwibmFtZVwiOlwiYWRtaW5cIixcImRldGFpbFwiOlwiYWRtaW4gYWNjb3VudFwiLFwid2ViaG9va19tZXRob2RcIjpcIlBPU1RcIixcIndlYmhvb2tfdXJpXCI6XCJodHRwczovL2VuN2V2YWp3aG1xYnQueC5waXBlZHJlYW0ubmV0XCIsXCJwZXJtaXNzaW9uX2lkc1wiOltcIjAzNzk2ZTE0LTdjYjQtMTFlYy05ZGJhLWU3MjAyM2VmZDFjNlwiXSxcInRtX2NyZWF0ZVwiOlwiMjAyMi0wMi0wMSAwMDowMDowMC4wMDAwMDBcIixcInRtX3VwZGF0ZVwiOlwiMjAyMi0wNS0xMSAxMzoxNzo1MC42ODkyMzNcIixcInRtX2RlbGV0ZVwiOlwiOTk5OS0wMS0wMSAwMDowMDowMC4wMDAwMDBcIn0iLCJleHAiOjE2NTU3Nzc3NDZ9.9oso_dm-i8U9QMeaCgop87T7PRosYD7gPKyN_xpVBrM'
{
"result": [
{
"id": "a7bc12b7-f95c-43e6-82a1-38f4b7ff9b3f",
"name": "conversation",
"detail": "conversation detail",
"reference_type": "line",
"reference_id": "Ud871bcaf7c3ad13d2a0b0d78a42a287f",
"participants": [
{
"type": "line",
"target": "",
"target_name": "me",
"name": "",
"detail": ""
},
{
"type": "line",
"target": "Ud871bcaf7c3ad13d2a0b0d78a42a287f",
"target_name": "Unknown",
"name": "",
"detail": ""
}
],
"tm_create": "2022-06-17 06:06:14.446158",
"tm_update": "2022-06-17 06:06:14.446167",
"tm_delete": "9999-01-01 00:00:00.000000"
}
],
"next_page_token": "2022-06-17 06:06:14.446158"
}
Get detail of conversation
Example
$ curl --location --request GET 'https://api.voipbin.net/v1.0/conversations/a7bc12b7-f95c-43e6-82a1-38f4b7ff9b3f?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lciI6IntcImlkXCI6XCI1ZTRhMDY4MC04MDRlLTExZWMtODQ3Ny0yZmVhNTk2OGQ4NWJcIixcInVzZXJuYW1lXCI6XCJhZG1pblwiLFwibmFtZVwiOlwiYWRtaW5cIixcImRldGFpbFwiOlwiYWRtaW4gYWNjb3VudFwiLFwid2ViaG9va19tZXRob2RcIjpcIlBPU1RcIixcIndlYmhvb2tfdXJpXCI6XCJodHRwczovL2VuN2V2YWp3aG1xYnQueC5waXBlZHJlYW0ubmV0XCIsXCJwZXJtaXNzaW9uX2lkc1wiOltcIjAzNzk2ZTE0LTdjYjQtMTFlYy05ZGJhLWU3MjAyM2VmZDFjNlwiXSxcInRtX2NyZWF0ZVwiOlwiMjAyMi0wMi0wMSAwMDowMDowMC4wMDAwMDBcIixcInRtX3VwZGF0ZVwiOlwiMjAyMi0wNS0xMSAxMzoxNzo1MC42ODkyMzNcIixcInRtX2RlbGV0ZVwiOlwiOTk5OS0wMS0wMSAwMDowMDowMC4wMDAwMDBcIn0iLCJleHAiOjE2NTU3Nzc3NDZ9.9oso_dm-i8U9QMeaCgop87T7PRosYD7gPKyN_xpVBrM'
{
"id": "a7bc12b7-f95c-43e6-82a1-38f4b7ff9b3f",
"name": "conversation",
"detail": "conversation detail",
"reference_type": "line",
"reference_id": "Ud871bcaf7c3ad13d2a0b0d78a42a287f",
"participants": [
{
"type": "line",
"target": "",
"target_name": "me",
"name": "",
"detail": ""
},
{
"type": "line",
"target": "Ud871bcaf7c3ad13d2a0b0d78a42a287f",
"target_name": "Unknown",
"name": "",
"detail": ""
}
],
"tm_create": "2022-06-17 06:06:14.446158",
"tm_update": "2022-06-17 06:06:14.446167",
"tm_delete": "9999-01-01 00:00:00.000000"
}
Send a message to the conversation
Example
$ curl --location --request POST 'https://api.voipbin.net/v1.0/conversations/a7bc12b7-f95c-43e6-82a1-38f4b7ff9b3f/messages?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lciI6IntcImlkXCI6XCI1ZTRhMDY4MC04MDRlLTExZWMtODQ3Ny0yZmVhNTk2OGQ4NWJcIixcInVzZXJuYW1lXCI6XCJhZG1pblwiLFwibmFtZVwiOlwiYWRtaW5cIixcImRldGFpbFwiOlwiYWRtaW4gYWNjb3VudFwiLFwid2ViaG9va19tZXRob2RcIjpcIlBPU1RcIixcIndlYmhvb2tfdXJpXCI6XCJodHRwczovL2VuN2V2YWp3aG1xYnQueC5waXBlZHJlYW0ubmV0XCIsXCJwZXJtaXNzaW9uX2lkc1wiOltcIjAzNzk2ZTE0LTdjYjQtMTFlYy05ZGJhLWU3MjAyM2VmZDFjNlwiXSxcInRtX2NyZWF0ZVwiOlwiMjAyMi0wMi0wMSAwMDowMDowMC4wMDAwMDBcIixcInRtX3VwZGF0ZVwiOlwiMjAyMi0wNS0xMSAxMzoxNzo1MC42ODkyMzNcIixcInRtX2RlbGV0ZVwiOlwiOTk5OS0wMS0wMSAwMDowMDowMC4wMDAwMDBcIn0iLCJleHAiOjE2NTU3Nzc3NDZ9.9oso_dm-i8U9QMeaCgop87T7PRosYD7gPKyN_xpVBrM' \
--header 'Content-Type: application/json' \
--data-raw '{
"text": "hi, this is test message. Good to see you. hahaha :)"
}'
{
"id": "0c8f23cb-e878-49bf-b69e-03f59252f217",
"conversation_id": "a7bc12b7-f95c-43e6-82a1-38f4b7ff9b3f",
"status": "sent",
"reference_type": "line",
"reference_id": "Ud871bcaf7c3ad13d2a0b0d78a42a287f",
"source_target": "",
"text": "hi, this is test message. Good to see you. hahaha :)",
"medias": [],
"tm_create": "2022-06-20 03:07:11.372307",
"tm_update": "2022-06-20 03:07:11.372315",
"tm_delete": "9999-01-01 00:00:00.000000"
}
Get list of conversation messages
Example
$ curl --location --request GET 'https://api.voipbin.net/v1.0/conversations/a7bc12b7-f95c-43e6-82a1-38f4b7ff9b3f/messages?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lciI6IntcImlkXCI6XCI1ZTRhMDY4MC04MDRlLTExZWMtODQ3Ny0yZmVhNTk2OGQ4NWJcIixcInVzZXJuYW1lXCI6XCJhZG1pblwiLFwibmFtZVwiOlwiYWRtaW5cIixcImRldGFpbFwiOlwiYWRtaW4gYWNjb3VudFwiLFwid2ViaG9va19tZXRob2RcIjpcIlBPU1RcIixcIndlYmhvb2tfdXJpXCI6XCJodHRwczovL2VuN2V2YWp3aG1xYnQueC5waXBlZHJlYW0ubmV0XCIsXCJwZXJtaXNzaW9uX2lkc1wiOltcIjAzNzk2ZTE0LTdjYjQtMTFlYy05ZGJhLWU3MjAyM2VmZDFjNlwiXSxcInRtX2NyZWF0ZVwiOlwiMjAyMi0wMi0wMSAwMDowMDowMC4wMDAwMDBcIixcInRtX3VwZGF0ZVwiOlwiMjAyMi0wNS0xMSAxMzoxNzo1MC42ODkyMzNcIixcInRtX2RlbGV0ZVwiOlwiOTk5OS0wMS0wMSAwMDowMDowMC4wMDAwMDBcIn0iLCJleHAiOjE2NTU3Nzc3NDZ9.9oso_dm-i8U9QMeaCgop87T7PRosYD7gPKyN_xpVBrM'
{
"result": [
{
"id": "0c8f23cb-e878-49bf-b69e-03f59252f217",
"conversation_id": "a7bc12b7-f95c-43e6-82a1-38f4b7ff9b3f",
"status": "sent",
"reference_type": "line",
"reference_id": "Ud871bcaf7c3ad13d2a0b0d78a42a287f",
"source_target": "",
"text": "hi, this is test message. Good to see you. hahaha :)",
"medias": [],
"tm_create": "2022-06-20 03:07:11.372307",
"tm_update": "2022-06-20 03:07:11.372315",
"tm_delete": "9999-01-01 00:00:00.000000"
},
...
],
"next_page_token": "2022-06-17 06:06:14.948432"
}