Skip to main content

gettransactionhashforonlinehelp

POST v1/application/gettransactionhashforonlinehelp#

This API is used to start live help from your mobile application. In your mobile application, send the Diyalog deviceHash (obtained from the Diyalog SDK) and the customer number to your own application server. Your application server should then call this API with this information to create and retrieve a transactionHash for this customer and device on the fly. You should then return this transactionHash to your mobile application so that it can start live help.

API requests

  • Must be authenticated with HMAC Authentication. For HMAC Authentication, see the Authentication document.
  • API URI : https://DIYALOG-SERVER-API-ENDPOINT/v1/application/gettransactionhashforonlinehelp
  • HTTP Request Type POST
  • HTTP Content-Type application/json

Request Body#

Schema
json object
customerId (String)
Customer number for which you want to start live help
deviceHash (String)
The Diyalog deviceHash obtained with DiyalogSDK's getDeviceHash method on the mobile device where you will start live help. This value is unique for each device.

Example Json Request Body :#

{
"customerId" : "123456",
"deviceHash" : "fwCZgi6zl2DPuNck6H644eq6JfPZpXKCqa2ouP2JS+k="
}

Responses#

HTTP 200 Response
json object
The API returns a json object as a response. This json object contains the result of the transactionHash creation and the transactionHash value.
     isSuccess (boolean)
      Indicates whether the transactionHash was created successfully.
      If false is returned, the transactionHash could not be created. You can get the reason from the message parameter below.
     message (string)
      Returns the result text of the operation. If the operation fails, you can see the error message in this field.
     transactionHash (string)
      The transactionHash created for the customer and deviceHash passed as parameters. With this value, you can start live help from your mobile application.

Example Response Body :#

{
"isSuccess": true,
"message": "TransactionHash created",
"transactionHash": "7c5963043b37edbe2706c2b48b4568387084acc7"
}
HTTP 500 Response
string
When the API receives an exception, it will return a response with the HTTP 500 status code. The API's error message is returned as text.

If the request fails HMAC validation, the following errors are returned as plain text. See Authentication.

HTTP statusMessageDescription
400Required headers not foundOne or more of the x-dlg-date, x-dlg-requester-userid or x-dlg-authorization headers are missing.
400Authorization failed due to data format not validThe x-dlg-authorization value after DLGA is not in the AccessKeyId:Signature form.
400Date format is invalid. EEE, dd MMM yyyy HH:mm:ss Z is requiedThe x-dlg-date value cannot be parsed in this format. The message text is returned as shown, including its spelling.
401Authorization failedThe x-dlg-authorization header does not contain DLGA , the AccessKeyId is unknown, or the signature is not correct.
401You have no permission on this operation. Contact your admin.The signature is correct, but your access key has no application permission.
403Request time may not be correct.The x-dlg-date value differs from the server time by more than 15 minutes.