Skip Navigation
Expand
Simple example of how to authenticate to the Chat UQ API
Answer ID 8601   |   Last Review Date 09/16/2019

What is a simple example of how to authenticate to the Chat UQ API?

Environment:

Chat API, Chat Universal Queue

Issue:

This answer serves as a simple example of soap envelopes required to establish connectivity to the Chat UQ API.  Note that this is just to be used as a simple example to guide you in getting starting using the Chat UQ API, not a complete application.  For more in-depth details of this API please refer to the Oracle B2C Service Chat APIs Developer Guide, or you can find many hints and tips in the Oracle Cloud Customer Connect Integrations and APIs Forum.

Note that to call the getChatUrl, you need to use this wsdl to generate that code:

https://<your_site_name>.custhelp.com/cgi-bin/<your_site_name>.cfg/services/chat_soap?wsdl

...and to generate the authenticate, you need to generate the code from this wsdl:

https://<your_site_name>.custhelp.com/cgi-bin/<your_interface_name>.cfg/services/chat_soap?wsdl=uq

Here are the detailed envelopes:

TO ENDPOINT:
https://<your_site_name>.custhelp.com/cgi-bin/<your_site_name>.cfg/services/chat_soap

YOU SEND:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="urn:messages.chat.ws.rightnow.com/v1_2">
    <soapenv:Header>
        <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" mustUnderstand="1">
            <wsse:UsernameToken>
                <wsse:Username>your_user_name</wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxxx</wsse:Password>
            </wsse:UsernameToken>
        </wsse:Security>
        <v1:ClientRequestHeader>
            <v1:AppID>Oracle Test</v1:AppID>
        </v1:ClientRequestHeader>
    </soapenv:Header>
    <soapenv:Body>
        <v1:GetChatUrl>
            <v1:UrlType>UQ</v1:UrlType>
            <v1:Version>1.1</v1:Version>
        </v1:GetChatUrl>
    </soapenv:Body>
</soapenv:Envelope>

RECEIVED:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Header/>
  <soapenv:Body>
      <n0:GetChatUrlResponse xmlns:n0="urn:messages.chat.ws.rightnow.com/v1_2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <n0:GetChatUrlResult>
            <n0:ChatUrl>https://ssbcvipmw02.rightnowtech.com/Chat-WS/services/wschatuq/v1_1?pool=4297:5</n0:ChatUrl>
            <n0:SiteName>your_site_name</n0:SiteName>
        </n0:GetChatUrlResult>
      </n0:GetChatUrlResponse>
  </soapenv:Body>
</soapenv:Envelope>

TO ENDPOINT:
https://ssbcvipmw02.rightnowtech.com/Chat-WS/services/wschatuq/v1_1?pool=4297:5

YOU WILL SEND:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="urn:messages.uq.chat.ws.rightnow.com/v1_1">
<soapenv:Header>
        <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" mustUnderstand="1">
            <wsse:UsernameToken>
                <wsse:Username>your_user_name</wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxxx</wsse:Password>
            </wsse:UsernameToken>
        </wsse:Security>
    </soapenv:Header>
    <soapenv:Body>
      <v1:Authentication>
        <v1:TransactionRequestData>
            <v1:Timestamp>2016-04-15T08:05:00</v1:Timestamp>
            <v1:TransactionID>1</v1:TransactionID>
            <v1:SiteName>your_site_name</v1:SiteName>
        </v1:TransactionRequestData>
      </v1:Authentication>
  </soapenv:Body>
</soapenv:Envelope>

RECEIVED:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
      <ns2:AuthenticationResponse xmlns="urn:messages.common.chat.ws.rightnow.com/v1_1" xmlns:ns2="urn:messages.uq.chat.ws.rightnow.com/v1_1" xmlns:ns3="urn:faults.chat.ws.rightnow.com/v1_1">
        <ns2:TransactionResponseData>
            <ns2:Timestamp>2016-04-15T14:13:20.378Z</ns2:Timestamp>
            <ns2:TransactionID>1</ns2:TransactionID>
            <ns2:TransactionResult>true</ns2:TransactionResult>
            <ns2:ResultCode>SUCCESS</ns2:ResultCode>
        </ns2:TransactionResponseData>
        <ns2:SessionID>1234abcd5678efgh90ij</ns2:SessionID>
      </ns2:AuthenticationResponse>
  </S:Body>
</S:Envelope>