Skip to content

Latest commit

 

History

History
171 lines (142 loc) · 8.05 KB

Integration.md

File metadata and controls

171 lines (142 loc) · 8.05 KB

API for integration

SMS Survey is our own solution for customer satisfaction survey using SMS. A survey request can be sent to the SMS survey application by using either the HTTP POST or HTTP GET method. The overview for the solution is displayed below:

alt text

HTTP POST

A survey request has to be sent to the following address in order to send a survey SMS to an end user:

https://feedback.puzzel.com/survey/v1/customersurvey/RequestHandlerServlet

Here is an example of the body of a POST request containing the following XML:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<log serviceid="[serviceid]">
    <caller>
        <queue>[Queue]</queue>
        <agent>[agent]</agent>
        <team>[team]</team>              
        <msisdn>[msisdn]</msisdn>
        <password>[xxxx]<</password>
    </caller>
</log>

the parameters can be optional or mandatory and the value in bracket must be substituted:

POST with extra parameter:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<log serviceid="[serviceid]">
  <caller>
    <queue>[queue]</queue>
    <agent>[agent]</agent>
    <team>[team]</team>              
    <msisdn>[msisdn]</msisdn>
    <password>[xxxx]</password>
    <Parameter1>[xxxx]</Parameter1>
    <Parameter2>[xxxx]</Parameter2>
    <Parameter3>[xxxx]</Parameter3>
    <Parameter4>[xxxx]</Parameter4>
    <Parameter5>[xxxx]</Parameter5>
  </caller>
</log>

Parameter

ParameterData TypeDescription
serviceidStringSMSSurvey service's unique identifiermandatory
queueStringIdentifier for queueoptional
agentStringIdentifier for agentoptional
teamStringIdentifier for teamoptional
msisdnStringvalid cellphone number which the survey SMS will be sent tomandatory
passwordStringSMSSurvey service's passwordmandatory

Extra parameters

ParameterData TypeDescription
Parameter 1StringEx.: call wait timeoptional
Parameter 2StringEx.: call durationoptional
Parameter 3Stringoptional
Parameter 4Stringoptional
Parameter 5Stringoptional

It can be defined up to 5 extra parameters.

Extra parameters must be registered at Puzzel in order to be displayed and must be sent in the same order as defined. Please URL encode parameters containing spaces with %20, for example: parameter 1 = call%20wait%20time, parameter 2= call%20duration.

Request

Content-Type is set to 'text/xml; charset=ISO-8859-1'

HTTP POST Request

POST https://feedback.puzzel.com/survey/v1/customersurvey/RequestHandlerServlet HTTP/1.1
Content-Type: text/xml; charset=ISO-8859-1

<?xml version="1.0" encoding="ISO-8859-1" ?>
<log serviceid="2106">
    <caller>
        <queue>queue1</queue>
        <agent>agent1</agent>
        <team>team1</team>              
        <msisdn>90937954</msisdn>
        <password>xxxx<</password>
    </caller>
</log>

Example with extra parameters

POST https://feedback.puzzel.com/survey/v1/customersurvey/RequestHandlerServlet HTTP/1.1
Content-Type: text/xml; charset=ISO-8859-1

<?xml version="1.0" encoding="ISO-8859-1" ?>
<log serviceid="2106">
    <caller>
        <queue>queue1</queue>
        <agent>agent1</agent>
        <team>team1</team>              
        <msisdn>90937954</msisdn>
        <password>xxxx<</password>
        <waittime>xxxx<</waittime>
        <callduration>xxxx<</callduration>
    </caller>
</log>

Response

The server responds with 200 OK HTTP status code indicating the request has succeeded.

HTTP GET

A survey request can be sent to the SMS survey application by using the following URL:

https://feedback.puzzel.com/survey/v1/customersurvey/RequestHandlerServlet?serviceid=2106&queue=1&agentid=1&msisdn=99999999&password=xxxx&customer_key=customer&user_id=xxxxx&related_iq_session=session

Parameter

ParameterData TypeDescription
serviceidStringSMSSurvey service's unique identifiermandatory
queueStringIdentifier for queueoptional
agentStringIdentifier for agentoptional
teamStringIdentifier for teamoptional
msisdnStringValid cellphone number which the survey SMS will be sent tomandatory
passwordStringSMSSurvey service's passwordmandatory
customer_keyStringIdentifier for PCC customer (valid only for Puzzel Contact Center (PCC) customers)optional
user_idStringIdentifier for PCC user (valid only for Puzzel Contact Center customers)optional
related_iq_sessionStringIdentifier for PCC iq session (valid only for Puzzel Contact Center customers)optional

Extra parameters

ParameterData TypeDescription
Parameter 1StringEx.: call wait timeoptional
Parameter 2StringEx.: call durationoptional
Parameter 3Stringoptional
Parameter 4Stringoptional
Parameter 5Stringoptional

It can be defined up to 5 extra parameters.

Extra parameters must be registered at Puzzel in order to be displayed and must be sent in the same order as defined. Please URL encode parameters containing spaces with %20, for example: parameter 1 = call%20wait%20time, parameter 2= call%20duration.

Request

HTTP GET Request

GET https://feedback.puzzel.com/survey/v1/customersurvey/RequestHandlerServlet?serviceid=XXXX&queue=1&agentid=1&team=1&msisdn=99999999&password=XXXX&customer_key=customer&user_id=xxxxx&related_iq_session=session

HTTP/1.1
Host: feedback.puzzel.com

Request with extra parameters

GET https://feedback.puzzel.com/survey/v1/customersurvey/RequestHandlerServlet?serviceid=XXXX&queue=1&agentid=1&team=1&msisdn=99999999&password=XXXX&customer_key=customer&user_id=xxxxx&related_iq_session=session&call%20wait%20time=xxxx&call%20duration=xxxx

HTTP/1.1
Host: feedback.puzzel.com

GET live score

Your application must support the HTTP GET method.
Send your URL (location of your server application) to Puzzel's support team.
For example: http://foo.com/yourapplication

Retrieving query string values

Our SMS application will send a GET request to your server application at the specified URL.
For example: http://foo.com/yourapplication?date=[date]&msisdn=[originator]&agentid=[agent]&queue=[queue]&team=[team]&score=[end user score]
Your server application can retrieve the values from the query string.

Response

The server responds with 200 OK HTTP status code indicating the request has succeeded.