Legacy Dev Forum Posts

 View Only

Sign Up

DATA ACTION WS with Custom AUTH

  • 1.  DATA ACTION WS with Custom AUTH

    Posted 06-05-2025 18:46

    ErnestJohnNuque | 2024-06-20 09:24:44 UTC | #1

    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?

    ![image

    690x440](upload://pp5qIvWgJ3F56tynQToCBJOVKyu.png)

    ![image

    690x405](upload://k3EYsEu8wBy7YA7DTPwCXXh0f9.png)


    Jason_Mathison | 2024-06-20 13:55:16 UTC | #2

    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. https://developer.genesys.cloud/organization/utilities-apis#get-api-v2-ipranges

    --Jason


    ErnestJohnNuque | 2024-06-20 15:07:08 UTC | #3

    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.tokentype} ${authResponse.accesstoken}", "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.tokentype} ${authResponse.accesstoken}", "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


    Jason_Mathison | 2024-06-20 15:49:35 UTC | #4

    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


    system | 2024-07-21 15:49:53 UTC | #5

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


    This post was migrated from the old Developer Forum.

    ref: 26878