This page will walk you through an example conversation that is typical of how the Socrates API is used.
Request to: https://www.socratesinsights.com/api/conversation/start
<?xml version="1.0" encoding="UTF-8"?> <conversation> <projectId>ABC12345</projectId> </conversation>
Response:
<?xml version="1.0" encoding="UTF-8"?> <conversation> <token>LZ4A_Q_WK5CHFacsnfh_JpmytqibdWGvYGY-ciUXszo</token> </conversation>
Request to: https://www.socratesinsights.com/api/conversation/variable
<?xml version="1.0" encoding="UTF-8"?> <conversation> <token>LZ4A_Q_WK5CHFacsnfh_JpmytqibdWGvYGY-ciUXszo</token> <variable> <name>externalId</name> <value>12345</value> </variable> </conversation>
Response:
<?xml version="1.0" encoding="UTF-8"?> <conversation> <token>LZ4A_Q_WK5CHFacsnfh_JpmytqibdWGvYGY-ciUXszo</token> <message>Variable passed successfully</message> </conversation>
Request to: https://www.socratesinsights.com/api/conversation/variable
<?xml version="1.0" encoding="UTF-8"?> <conversation> <token>LZ4A_Q_WK5CHFacsnfh_JpmytqibdWGvYGY-ciUXszo</token> <variable> <name>question</name> <value>What do you think of Product X?</value> </variable> </conversation>
Response:
<?xml version="1.0" encoding="UTF-8"?> <conversation> <token>LZ4A_Q_WK5CHFacsnfh_JpmytqibdWGvYGY-ciUXszo</token> <message>Variable passed successfully</message> </conversation>
Request to: https://www.socratesinsights.com/api/conversation/talk
<?xml version="1.0" encoding="UTF-8"?> <conversation> <token>LZ4A_Q_WK5CHFacsnfh_JpmytqibdWGvYGY-ciUXszo</token> </conversation>
Response:
<?xml version="1.0" encoding="UTF-8"?> <conversation> <token>LZ4A_Q_WK5CHFacsnfh_JpmytqibdWGvYGY-ciUXszo</token> <question> <participant>Question</participant> <text>What did you think of Product X?</text> </question> <answer> <participant>Answer</participant> <type>TEXT</type> </answer> </conversation>
Request to: https://www.socratesinsights.com/api/conversation/talk
<?xml version="1.0" encoding="UTF-8"?> <conversation> <token>LZ4A_Q_WK5CHFacsnfh_JpmytqibdWGvYGY-ciUXszo</token> <reply> <answer>It was very bright and colorful.</answer> </reply> </conversation>
Response:
<?xml version="1.0" encoding="UTF-8"?> <conversation> <token>LZ4A_Q_WK5CHFacsnfh_JpmytqibdWGvYGY-ciUXszo</token> <question> <participant>Question</participant> <text>I am interested by your comment ... it was very bright and colorful, it would be great if you could tell me more.</text> </question> <answer> <participant>Answer</participant> <type>TEXT</type> </answer> </conversation>
Request to: https://www.socratesinsights.com/api/conversation/talk
<?xml version="1.0" encoding="UTF-8"?> <conversation> <token>LZ4A_Q_WK5CHFacsnfh_JpmytqibdWGvYGY-ciUXszo</token> <reply> <answer>The color really made it stand out on the shelf.</answer> </reply> </conversation>
Response:
<?xml version="1.0" encoding="UTF-8"?> <conversation> <token>LZ4A_Q_WK5CHFacsnfh_JpmytqibdWGvYGY-ciUXszo</token> <question> <participant>Question</participant> <text>COMPLETE</text> </question> <answer> <participant>Answer</participant> <type>COMPLETE</type> </answer> </conversation>