DATA ACTION WS with Custom AUTH

Hi,

I am working on a data action with custom auth using client id and client secret and I am successful in requesting for the token.

now my question is how can properly use the retirieved token to request on my api?


It looks like everything is correct in terms of setting up custom authentication. All I can see in the logs is that you are calling the api.blacked.out URL that is configured in the URL template, and that end point never responds in 60 seconds.

For troubleshooting this I would first try calling that endpoint in a tool like postman, and make sure it responds in a reasonable amount of time.

If it works in postman I would check if the endpoint uses an IP address whitelist. If so, make sure that the IP addresses used by Data Actions in your region are in the whitelist.

--Jason

Hi,
in postman it is working fine earlier but now getting 503 service unavailable I will check it further later.

anyway can you check if I have correct set up:

Input Contract:
{
"type": "object",
"properties": {
"policyNumber": {
"type": "string"
}
},
"additionalProperties": true
}

Output Contract:
{
"type": "object",
"properties": {
"policyNumber": {
"type": "string"
},
"clientName": {
"type": "string"
},
"dob": {
"type": "string"
},
"policyStatusCode": {
"type": "string"
},
"policyStatusDescription": {
"type": "string"
},
"productType": {
"type": "string"
},
"paidToDate": {
"type": "string"
},
"premiumAmount": {
"type": "string"
},
"maturityDate": {
"type": "string"
},
"maturityAmount": {
"type": "string"
},
"policyCurrency": {
"type": "string"
}
},
"additionalProperties": true
}

Action Request:
{
"requestUrlTemplate": "https://api.emmuat.com/ext/idn-ivr-cas-service/v1/cas/getPolicyInfo",
"requestType": "POST",
"headers": {
"Authorization": "${authResponse.token_type} ${authResponse.access_token}",
"Content-Type": "application/json"
},
"requestTemplate": "${input.rawRequest}"
}

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

that is my set up when getting this error:

but if I changed my Action Request to this:

{
"requestUrlTemplate": "https://api.emmuat.com/ext/idn-ivr-cas-service/v1/cas/getPolicyInfo",
"requestType": "POST",
"headers": {
"Authorization": "${authResponse.token_type} ${authResponse.access_token}",
"Content-Type": "application/json"
},
"requestTemplate": "${input.policyNumber}"
}

I am getting this error:

which should be the correct template? I am getting different error base on what request template I used

With the second version
"requestTemplate": "${input.policyNumber} "

You are only sending something like this
000012345
which is failing because json numbers can't have leading zeros.

You might want something like this, which would require all of the extra stuff around the policyNumber / string to be added to the request template.
{
"PolicyNumber" : "000012345"
}

--Jason

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