POST request sending Null object

Hi Everyone,

I'm currently having an issue with our POST data actions within PureCloud

This issue is occurring for all our POST requests below is the details for our CreatePhoneActivity request

Input Contract:
{
"schema": "http://json-schema.org/draft-04/schema#", "title": "CreatePhoneActivityRequest", "description": "Input items to create phone activity", "type": "object", "properties": { "regNumber": { "type": "string", "maxLength": 6, "pattern": "^[0-9]{6}",
"description": "The reg number used to query the CRM"
},
"subject": {
"type": "string",
"maxLength": 200
},
"Description": {
"type": "string",
"maxLength": 2000
},
"startTime": {
"type": "string",
"format": "date-time"
},
"conversationID": {
"type": "string"
},
"pureCloudUserID": {
"type": "string"
},
"userPhoneNumber": {
"type": "string"
}
}
}

Output Contract:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "CreatePhoneActivityResponse",
"description": "Return Phone activity as output",
"type": "object",
"required": [
"status"
],
"properties": {
"status": {
"type": "string",
"enum": [
"SUCCESS",
"ERROR"
]
},
"messageCode": {
"type": "string",
"maxLength": 15
},
"messageText": {
"type": "string",
"maxLength": 255
}
}
}

Request:
{
"requestUrlTemplate": "https://trbwebapiuat.trb.sa.edu.au:443/Purecloud/CreatePhoneActivity",
"requestType": "POST",
"headers": {},
"requestTemplate": "{"regNumber": "{input.regNumber}\",\"subject\": \"{input.subject}","Description": "{input.Description}\",\"startTime\": \"{input.startTime}","conversationID":"{input.conversationID}\",\"pureCloudUserID\": \"{input.pureCloudUserID}","userPhoneNumber": "${input.userPhoneNumber}"}"
}

Response:
{
"translationMap": {},
"successTemplate": "${rawResult}"
}

The purpose for the request is to get the details of the PureCloud phone call and create an activity within CRM once the call has been completed.

I was able to previously successfully run the action in PureCloud once and then once again about every two hours.
However today it seems I'm not even able to successfully run the call once.
I update the input fields with new data and try to run again and get the following response

{
"message.messageCode": [
"ERR001"
],
"message.messageText": [
"System Error – Request not processed"
],
"status": "ERROR"
}”
This is a generic error message that we have created for the request.

I looked into our log files and found the following details

account:System | PureCloudPhoneActivityRequest data: null

Error Calling Get | System.NullReferenceException: Object reference not set to an instance of an object.
at Orion.TRBSA.WEBAPI.Controllers.PurecloudController.CreatePhoneActivity(PureCloudPhoneActivityRequest _pureCloudContactRequestdeserialized) | account:System

This issue doesn't occur if we use PostMan or any other external application

Please find below and example of the log file for a successful call

account:System | PureCloudPhoneActivityRequest data: {"activityID":null,"regNumber":"596979","subject":"testing for Bill 1","description":"desc testing for Bill 1","startTime":"2018-01-08T00:19:40.926Z","pureCloudUserID":"cc8d2225-3bd2-45ec-b06e-9463819df2e1","userPhoneNumber":"+61425185822","conversationID":"cee9db35-1ac3-4f09-aa85-b1a33a11f987","wrapupCode":null,"wrapupDuration":null,"endTime":null,"callDuration":null}

Regards,

I tried to reproduce the issue but got a 401 Unauthorized, so I wasn't able to see the issue firsthand.

Try to see if you can reproduce this issue by adding a "Transfer-Encoding" header in postman with a value of "chunked". If that reproduces the issue then you should be able to resolve this by adding a "transfer-encoding" header in your action with a value of "buffered".

This is currently our go-to solution to head scratching issues. Why this would pop up now is a mystery as there were no related changes in the data action service recently.

--Jason

Thankyou that worked.

Initially the web service did not support "Transfer-Encoding" as a header. But once implemented and each actions header configured with "Content-Transfer-Encoding" :"buffered" it was able to successfully run.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.