setUpConversation

Request Method: POST

Description: Function which set up a conversation between the origin and destination party through a conversational VoxNumber.

URL: https://api.iovox.com:444/Conversations?v=3&method=setUpConversation

The following parameters can be sent in the querystring

ParameterDescriptionDefault ValueData TypeMandatory
vAPI version to use
INTEGERYES

Payload

The following XML payload must be sent with a setUpConversation request:

<?xml version="1.0" encoding="utf-8"?>
<request>
    <country>United Kingdom</country>
    <origin_contact>
        <contact_id>CO1</contact_id>
        <first_name>John</first_name>
        <last_name>Smith</last_name>
        <business_phone>44772345443323</business_phone>
        <country>United Kingdom</country>
        <email>john.smith@iovox.com</email>
    </origin_contact>
    <link_id>AD-123</link_id>
    <expiration>
        <value>2</value>
        <unit>MONTH</unit>
    </expiration>
    <conversation_details>
        <sendSms>
            <origin>44772345443323</origin>
            <welcome_destination_message>You have an enquiry for AD-123</welcome_destination_message>
            <welcome_origin_message>Thanks for your interest for AD-123</welcome_origin_message>
            <main_message>Hello I am in love with this car. Is it still available?</main_message>
        </sendSms>
    </conversation_details>
</request>

Payload Description

Node NameDescriptionDefault ValueData TypeMandatory
countryA valid country name.
STRINGYES
origin_contactContains all the origin contact information needed

YES
origin_contact>contact_idThe reference to the origin contact.
STRINGNO
origin_contact>first_nameThe first name of the origin contact
STRINGYES
origin_contact>last_nameThe last name of the origin contact
STRINGYES
origin_contact>business_phoneWith the origin phone number in an internationalised format
STRINGYES
origin_contact>countryWith the country of the origin contact
STRINGNO
origin_contact>emailWith the email address of the origin contact
STRINGNO
link_idWith the reference to the link we want to set up the conversation
STRINGYES, unless the destination_contact is set
destination_contactContains all the destination contact information needed

NO, unless Link ID is not set
destination_contact>contact_idThe reference to the destination contact.
STRINGNO
destination_contact>first_nameThe first name of the destination contact.
STRINGYES
destination_contact>last_nameThe last name of the destination contact
STRINGYES
destination_contact>business_phoneWith the destination phone number in an internationalised format
STRINGYES
destination_contact>countryWith the country of the destination contact
STRINGNO
destination_contact>emailWith the email address of the destination contact
STRINGNO
conversation_details>sendSms>destinationDestination phone number for the sendSms event. This phone number should belong to the origin contact phone number.
STRINGYES, It is only required if the destination contact is set in the XML
conversation_details>sendSms>welcome_messageCommon message which will be sent when the conversation is set up. This will be sent to the origin and destination.
STRINGNO
conversation_details>sendSms>welcome_origin_messageMessage which will be sent to the origin party when the conversation is set up.  
STRINGNO
conversation_details>sendSms>welcome_destination_messageMessage which will be sent to the destination party when the conversation is set up.
STRINGNO
conversation_details>sendSms>main_messageMessage which contains the text sent from the origin to the destination.
STRINGYES

Result

Error Result

HTTP CodeError StringResolution
400API Version EmptyAdd a value for the v parameter in the query string
400API Version InvalidCorrect v parameter
400Request Method must be POST. x attemptedSwitch request method x to POST
400XML EmptyAdd xml to the request body
400XML parse error. x at line y, column zCorrect XML at point x on line y, column z
400Request EmptyAdd the conversation details for the request
400Country EmptyAdd country.
400Country does not existCorrect for a valid country.
400Origin Contact EmptyAdd origin_contact.
400Link ID EmptyAdd a link_id.
400Link ID does not existsCorrect the link_id.
400Link ID does not have an SMS Template attachedAttach an SMS template to the link.
400Link ID does not have a forwarding contactAttach a contact to the SMS template attached to the link.
400Origin Contact EmptyAdd origin_contact details
400Origin Contact First Name emptyAdd first_name for the origin contact
400Origin Contact First Name invalidCorrect first_name for the origin contact
400Origin Contact Last Name emptyAdd last_name for the origin contact
400Origin Contact Last Name invalidCorrect last_name for the origin contact
400Origin Contact Email is not valid email addressCorrect the email address for the origin contact
400Origin Contact Business Phone invalidCorrect the business phone number for the origin contact
400Origin Contact Business Phone is not internationalisedCorrect the business phone number is not in international format.
400Destination Contact First Name emptyAdd first_name for the destination contact
400Destination Contact First Name invalidCorrect first_name for the destination contact
400Destination Contact Last Name emptyAdd last_name for the destination contact
400Destination Contact Last Name invalidCorrect last_name for the destination contact
400Destination Contact Email is not valid email addressCorrect the email address for the destination contact
400Destination Contact Business Phone invalidCorrect the business phone number for the destination contact
400Destination Contact Business Phone is not internationalisedCorrect the business phone number is not in international format.
400Conversation Details EmptyAdd conversation_details
400Conversation Details x of y Origin emptyAdd origin in the conversation
400Conversation Details x of y Origin should belong to origin contactAdd origin which belongs to the phone numbers of the destination contact
400Conversation Details x of y Origin cannot be the same than destinationCorrect either origin or destination phone number
400Conversation Details x of y Destination emptyAdd destination in the conversation
400Conversation Details x of y Destination should belong to destination contactAdd destination which belongs to the phone numbers of destination contact
400Conversation Details x of y Main message is emptyAdd the main_message in the conversation
400Conversation Details x of y Main message must be less than 160 charactersCorrect the main_message in the conversation
400Conversation Details x of y Welcome message must be less than 160 charactersCorrect the welcome_message in the conversation
400Conversation Details x of y Welcome message origin must be less than 160 charactersCorrect the welcome_message_origin in the conversation
400Conversation Details x of y Welcome message destination must be less than 160 charactersCorrect the welcome_message_destination in the conversation
500Internal Server ErrorRetry later

Success Result

HTTP/1.1 201 Created

<?xml version="1.0" encoding="UTF-8"?>
<response>
    <voxnumber>447441913709</voxnumber>
    <conversation_id>09330234-dc1a-11e6-9852-d43d7ed6ce4c</conversation_id>
</response>