Download OpenAPI specification:Download
The Conversation API is a REST web service that enables you to trigger smart conversation flows to a contact or a segment of contacts. A smart conversation flow is an automated workflow process implemented on the DANAConnect platform that is used to send messages to customers through different channels such as email, sms, push and others.
username
and password
in the DANAConnect platform.conversationID
) for this flow.conversationID
)?For most DANAConnect API requests, you will need to send the Conversation ID as a parameter.
This conversation ID refers to the number assigned to the activation of the flow and can be found by logging into the DANAConnect platform and looking in the activation report for the conversation you need to refer to.
It is important to mention that every time a conversation is reactivated, a new Conversation ID will be generated.
Here is a video explaining how to find the conversation ID:
The API uses the same user credential system that is used to enter the DANAConnect platform.
The method used for all DANAConnect APIs is HTTP BASIC AUTH, which is based on login and password authentication.
Login: The login consists of the username concatenated with an @ and followed by the company code.
Login example:
Security Scheme Type | HTTP |
---|---|
HTTP Authorization Scheme | basic |
Starts a conversation with the preloaded list
conversationID required | integer <int32> >= 1 Example: 200897 Indicates the id of the conversation to be executed |
X-DEBUG | integer <int32> [ 0 .. 1 ] Default: 0 Example: 1 Header that activates debug mode of conversations |
const fetch = require('node-fetch'); async function makeRequest(){ const conversationId = '<ConversationID>'; const resp = await fetch( `https://appserv.danaconnect.com/api/1.0/rest/conversation/${conversationId}/start/list`, { method: 'POST', headers: { 'X-DEBUG': '0', Authorization: 'Basic ' + Buffer.from('<username>@<companyCode>:%<Password>').toString('base64') } } ); const data = await resp.text(); console.log(data); } makeRequest()
Result of a successful request
{- "wsResult": {
- "idResult": 0,
- "resultDescription": "OK"
}
}
Starts a conversation with one new record using the data given in the JSON
conversationID required | integer <int32> >= 1 Example: 200897 Conversation Id to be started |
X-DEBUG | integer <int32> [ 0 .. 1 ] Default: 0 Example: 1 Header that activates debug mode of conversations |
Json with the values to be used to create a new record \n Example:
{"NAME":"Dana", "EMAIL":"support@danaconnect.com"}
Request sent to a contact defined in the JSON
{- "NAME": "Dana",
- "EMAIL": "support@danaconnect.com"
}
Result of a successful request
{- "wsResult": {
- "idResult": 23617,
- "resultDescription": "OK"
}
}
Starts a conversation with a record identified by recordUID (idRow)
conversationID required | integer <int32> >= 1 Example: 200897 Conversation Id to be started |
idRow required | integer <int32> >= 1 Example: 6 Record Id in the Contact List |
X-DEBUG | integer <int32> [ 0 .. 1 ] Default: 0 Example: 1 Header that activates debug mode of conversations |
JSON with the values to be used to update the record
Example:
{"PHONE_NUMBER":"+19546441233","RECEIPT_FILE":"s3:\/\/Receipt\/receipt-example.pdf"}
JSON with the values to be used to update the record
{- "PHONE_NUMBER": "+19546441233",
- "RECEIPT_FILE": "s3://Receipt/receipt-example.pdf"
}
Result of a successful request
{- "wsResult": {
- "idResult": 0,
- "resultDescription": "OK"
}
}
Starts a conversation with a batch of up to 10 new contacts with the given information
conversationID required | integer <int32> >= 1 Example: 200897 Id of the conversation to be started |
X-DEBUG | integer <int32> [ 0 .. 1 ] Default: 0 Example: 1 Header that activates debug mode of conversations |
JSON Array with different fields for each record to be created ( up to 10 new records )
Example:
[
{"LASTNAME":"MOLA","EMAIL":"954222233","ID_TYPE":"PASSPORT","NAME":"JOHN","GENDER":"M"},
{"LASTNAME":"BORDA","EMAIL":"939988777","ID_TYPE":"PASSPORT","NAME":"ROBERT","GENDER":"M"}]
JSON Array containing the records to be created
[- {
- "LASTNAME": "MOLA",
- "EMAIL": "954222233",
- "ID_TYPE": "PASSPORT",
- "NAME": "JOHN",
- "GENDER": "M"
}, - {
- "LASTNAME": "BORDA",
- "EMAIL": "939988777",
- "ID_TYPE": "PASSPORT",
- "NAME": "ROBERT",
- "GENDER": "M"
}
]
Result of a successful request
[- {
- "wsResult": {
- "idResult": 3663,
- "resultDescription": "OK"
}
}, - {
- "wsResult": {
- "idResult": 3664,
- "resultDescription": "OK"
}
}
]
Starts a conversation with one new record using the data given in the JSON
projectID required | integer <int32> >= 1 Example: 101007 Project Id to be started |
X-DEBUG | integer <int32> [ 0 .. 1 ] Default: 0 Example: 1 Header that activates debug mode of conversations |
Json with the values to be used to create a new record
Example:
{"NAME":"Dana", "EMAIL":"support@danaconnect.com"}
Request sent to a contact defined in the JSON
{- "NAME": "Dana",
- "EMAIL": "support@danaconnect.com"
}
Result of a successful request
{- "wsResult": {
- "idResult": 23617,
- "resultDescription": "OK"
}
}
Multiple values are returned for each contact
danaparam required | string non-empty Example: 1KZK5BdVKDH6mKcAiXGMPh1KT3xpx2w Code 'dana' usually sent to external URLs |
fields | string Example: fields=EMAIL,NAME,PHONE_NUMBER String containing a list of requiered fields separated by comma ( , ) |
curl -i -X GET \ -u <username@companycode>:<password> \ 'https://appserv.danaconnect.com/api/1.0/rest/conversation/data/:danaparam?fields=EMAIL,NAME,PHONE_NUMBER' \ -H 'Accept: application/json'
Successful Result
{- "record": {
- "TESTREST_NAME": "John",
- "TESTREST_SIGNATURES": "s3://WS/2021/3/05c8ae8f0a8bed9e0ffd361a214d1c21",
- "TESTREST_VALUE": "Doe",
- "TESTREST_PHONE_NUMBER": "+3465900000",
- "TESTREST_PLAN": "Medio",
- "TESTREST_EMAIL": "jdoe@danaconnect.com"
}, - "requestID": "5bc6bb89-82c7-4a2a-80a3-fbf5abedeee9"
}