This operation lists all conversations that are associated with an app and/or a contact.
project_id required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
A successful response.
Malformed request. See common error responses for more information.
Incorrect credentials. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Something went wrong on our end, try again with exponential back-off. See common error responses for more information.
{- "conversations": [
- {
- "active": true,
- "active_channel": "WHATSAPP",
- "app_id": "string",
- "contact_id": "string",
- "id": "string",
- "last_received": "2019-08-24T14:15:22Z",
- "metadata": "string",
- "metadata_json": { },
- "correlation_id": "string"
}
], - "next_page_token": "string",
- "total_size": 0
}
Creates a new empty conversation. It is generally not needed to create a conversation explicitly since sending or receiving a message automatically creates a new conversation if it does not already exist between the given app and contact. Creating empty conversation is useful if the metadata of the conversation should be populated when the first message in the conversation is a contact message or the first message in the conversation comes out-of-band and needs to be injected with InjectMessage endpoint.
project_id required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
The conversation to create. ID will be generated for the conversation and any ID in the given conversation will be ignored.
A successful response.
Malformed request. See common error responses for more information.
Incorrect credentials. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Something went wrong on our end, try again with exponential back-off. See common error responses for more information.
{- "active": true,
- "active_channel": "WHATSAPP",
- "app_id": "{APP_ID}",
- "contact_id": "{CONTACT_ID}",
- "id": "string",
- "metadata": "string",
- "metadata_json": { }
}
{- "active": true,
- "active_channel": "WHATSAPP",
- "app_id": "string",
- "contact_id": "string",
- "id": "string",
- "last_received": "2019-08-24T14:15:22Z",
- "metadata": "string",
- "metadata_json": { },
- "correlation_id": "string"
}
Retrieves a conversation by id. A conversation has two participating entities, an app and a contact.
project_id required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
conversation_id required | string The unique ID of the conversation. This is generated by the system. |
A successful response.
Malformed request. See common error responses for more information.
Incorrect credentials. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Something went wrong on our end, try again with exponential back-off. See common error responses for more information.
{- "active": true,
- "active_channel": "WHATSAPP",
- "app_id": "string",
- "contact_id": "string",
- "id": "string",
- "last_received": "2019-08-24T14:15:22Z",
- "metadata": "string",
- "metadata_json": { },
- "correlation_id": "string"
}
Deletes a conversation together with all the messages sent as part of the conversation.
project_id required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
conversation_id required | string The unique ID of the conversation. This is generated by the system. |
A successful response.
Malformed request. See common error responses for more information.
Incorrect credentials. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Something went wrong on our end, try again with exponential back-off. See common error responses for more information.
{- "code": 400,
- "message": "Malformed request",
- "status": "INVALID_REQUEST",
- "details": [ ]
}
This operation updates a conversation which can, for instance, be used to update the metadata associated with a conversation.
project_id required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
conversation_id required | string The unique ID of the conversation. This is generated by the system. |
The updated conversation.
active | boolean Flag for whether this conversation is active. |
active_channel | string (Channel Identifier) The identifier of the channel you want to include. Must be one of the enum values. |
app_id | string The ID of the participating app. |
contact_id | string The ID of the participating contact. |
id | string The ID of the conversation. |
metadata | string Arbitrary data set by the Conversation API clients. Up to 1024 characters long. NOTE: This field has been deprecated due to changes in the system architecture or functionality. It is no longer actively maintained and may be removed in future versions. Please avoid relying on this field in new code. |
metadata_json | object Arbitrary data set by the Conversation API clients and/or provided in the |
correlation_id | string Arbitrary correlation ID related to the MT message set by the Conversation API user. |
A successful response.
active | boolean Flag for whether this conversation is active. |
active_channel | string (Channel Identifier) The identifier of the channel you want to include. Must be one of the enum values. |
app_id | string The ID of the participating app. |
contact_id | string The ID of the participating contact. |
id | string The ID of the conversation. |
last_received | string <date-time> The timestamp of the latest message in the conversation. The timestamp will be Thursday January 01, 1970 00:00:00 UTC if the conversation contains no messages. |
metadata | string Arbitrary data set by the Conversation API clients. Up to 1024 characters long. NOTE: This field has been deprecated due to changes in the system architecture or functionality. It is no longer actively maintained and may be removed in future versions. Please avoid relying on this field in new code. |
metadata_json | object Arbitrary data set by the Conversation API clients and/or provided in the |
correlation_id | string Arbitrary correlation ID related to the MT message set by the Conversation API user. |
Malformed request. See common error responses for more information.
Incorrect credentials. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Something went wrong on our end, try again with exponential back-off. See common error responses for more information.
{- "app_id": "string ",
- "metadata": "string",
- "active_channel": "WHATSAPP",
- "active": true
}
{- "active": true,
- "active_channel": "WHATSAPP",
- "app_id": "string",
- "contact_id": "string",
- "id": "string",
- "last_received": "2019-08-24T14:15:22Z",
- "metadata": "string",
- "metadata_json": { },
- "correlation_id": "string"
}
This operation lists conversations and their most recent message, ordered by when the most recent message was sent for that conversation.
project_id required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
app_id required | string The application ID |
only_active | boolean True if only active conversations should be listed. Default is false. |
page_size | integer <int32> The maximum number of conversations to fetch. Defaults to 10 and the maximum value is 50. |
page_token | string Next page token previously returned if any. When specifying this token, make sure to use the same values for the other parameters from the request that originated the token, otherwise the paged results may be inconsistent. |
order | string Whether to sort conversations by newest message first or oldest. Default is DESC (newest first) |
A successful response.
Malformed request. See common error responses for more information.
Incorrect credentials. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Something went wrong on our end, try again with exponential back-off. See common error responses for more information.
{- "conversations": [
- {
- "conversation": {
- "active": true,
- "active_channel": "WHATSAPP",
- "app_id": "string",
- "contact_id": "string",
- "id": "string",
- "last_received": "2019-08-24T14:15:22Z",
- "metadata": "string",
- "metadata_json": { },
- "correlation_id": "string"
}, - "last_message": {
- "app_message": {
- "card_message": {
- "choices": [
- {
- "call_message": { },
- "postback_data": null
}
], - "description": "string",
- "height": "UNSPECIFIED_HEIGHT",
- "title": "string",
- "media_message": {
- "thumbnail_url": "string",
- "url": "string",
- "filename_override": "string"
}
}, - "explicit_channel_message": { },
- "explicit_channel_omni_message": {
- "property1": {
- "text_message": {
- "text": null
}
}, - "property2": {
- "text_message": {
- "text": null
}
}
}, - "channel_specific_message": {
- "property1": {
- "message_type": "FLOWS",
- "message": {
- "header": { },
- "body": null,
- "footer": null,
- "flow_id": null,
- "flow_token": null,
- "flow_mode": null,
- "flow_cta": null,
- "flow_action": null,
- "flow_action_payload": { }
}
}, - "property2": {
- "message_type": "FLOWS",
- "message": {
- "header": { },
- "body": null,
- "footer": null,
- "flow_id": null,
- "flow_token": null,
- "flow_mode": null,
- "flow_cta": null,
- "flow_action": null,
- "flow_action_payload": { }
}
}
}, - "agent": {
- "display_name": "string",
- "type": "UNKNOWN_AGENT_TYPE",
- "picture_url": "string"
}
}, - "accept_time": "2019-08-24T14:15:22Z",
- "channel_identity": {
- "app_id": "string",
- "channel": "WHATSAPP",
- "identity": "string"
}, - "contact_id": "string",
- "conversation_id": "string",
- "direction": "UNDEFINED_DIRECTION",
- "id": "string",
- "metadata": "string",
- "injected": true,
- "sender_id": "string",
- "processing_mode": "CONVERSATION"
}
}
], - "next_page_token": "string",
- "total_size": 0
}
This operation injects a conversation event in to a specific conversation. It only supports injecting App events in CONVERSATION
mode.
project_id required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
conversation_id required | string The unique ID of the conversation. This is generated by the system. |
Inject event request
required | App Event Type (object) The content of the events. | ||||||
accept_time required | string <date-time> The processed time of the message in UTC timezone. Must be less than current_time and greater than (current_time - 30 days). | ||||||
conversation_id | string Optional. The ID of the event's conversation. Will not be present for apps in Dispatch Mode. | ||||||
contact_id | string Optional. The ID of the contact. Will not be present for apps in Dispatch Mode. | ||||||
object (Channel Identity) A unique identity of message recipient on a particular channel. For example, the channel identity on SMS, WHATSAPP or VIBERBM is a MSISDN phone number. | |||||||
processing_mode | string (ProcessingMode) Default: "CONVERSATION" Whether or not Conversation API should store contacts and conversations for the app. For more information, see Processing Modes.
|
A succcessful response.
Malformed request. See common error responses for more information.
Incorrect credentials. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Something went wrong on our end, try again with exponential back-off. See common error responses for more information.
{- "id": "string",
- "direction": "TO_APP",
- "channel_identity": {
- "channel": "MESSENGER",
- "identity": "{{FACEBOOK_USER_NAME}}",
- "app_id": "{{APP_ID}}"
}, - "app_event": {
- "composing_event": { }
}, - "accept_time": "YYYY-MM-DDTHH:MM:SS"
}
{- "event_id": "string",
- "accepted_time": "YYYY-MM-DDTHH:MM:SS"
}
This operation stops the referenced conversation, if the conversation is still active. A new conversation will be created if a new message is exchanged between the app or contact that was part of the stopped conversation.
project_id required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
conversation_id required | string The unique ID of the conversation. This is generated by the system. |
A successful response.
Malformed request. See common error responses for more information.
Incorrect credentials. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Something went wrong on our end, try again with exponential back-off. See common error responses for more information.
{- "code": 400,
- "message": "Malformed request",
- "status": "INVALID_REQUEST",
- "details": [ ]
}
This operation injects a conversation message in to a specific conversation.
project_id required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
message.conversation_id required | string The ID of the conversation. |
Message to be injected.
A message on a particular channel.
required | Card (object) or Carousel (object) or Choice (object) or Location (object) or Media (object) or Template Message (object) or Text (object) or List (object) or Contact Info (object) (AppMessage) Message originating from an app | ||||||
required | object (Channel Identity) A unique identity of message recipient on a particular channel. For example, the channel identity on SMS, WHATSAPP or VIBERBM is a MSISDN phone number. | ||||||
contact_id required | string The ID of the contact registered in the conversation provided. | ||||||
direction required | string (ConversationDirection) Default: "UNDEFINED_DIRECTION" Enum: "UNDEFINED_DIRECTION" "TO_APP" "TO_CONTACT" | ||||||
accept_time required | string <date-time> The processed time of the message in UTC timezone. Must be less than current_time and greater than (current_time - 30 days) | ||||||
conversation_id | string The ID of the conversation. | ||||||
sender_id | string For Contact Messages the sender ID is the contact sent the message to. For App Messages the sender that was used to send the message, if applicable. | ||||||
processing_mode | string (ProcessingMode) Default: "CONVERSATION" Whether or not Conversation API should store contacts and conversations for the app. For more information, see Processing Modes.
| ||||||
metadata | string Optional. Metadata associated with the contact. Up to 1024 characters long. |
A successful response.
Malformed request. See common error responses for more information.
Incorrect credentials. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Correct credentials but you don't have access to the requested resource. See common error responses for more information.
Something went wrong on our end, try again with exponential back-off. See common error responses for more information.
{- "direction": "TO_CONTACT",
- "channel_identity": {
- "channel": "{{CHANNEL_NAME}}",
- "identity": "{{CHANNEL_IDENTITY}}"
}, - "app_message": {
- "text_message": {
- "text": "string"
}
}, - "contact_id": "string",
- "accept_time": "YYYY-MM-DDTHH:MM:SS"
}
{- "code": 400,
- "message": "Malformed request",
- "status": "INVALID_REQUEST",
- "details": [ ]
}