Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  Error Data Actions

    Posted 06-05-2025 18:16

    db97f7fa835dbf12c5ab | 2020-03-03 12:48:02 UTC | #1

    Hello,

    We have configured an integration through webservices authenticating with oauth with the client and the secret that the client has given us, when doing the data action we add the token that they have given us, and we get this error, which can be?

    They using Oauth2.

    { "message": "No authentication bearer token specified in authorization header.", "code": "authentication.required", "status": 401, "messageParams": {}, "contextId": "7595fcb5-e346-487e-a7ad-f81326bb171b", "details": [ { "errorCode": "ACTION.REMOTEENDPOINT" } ], "errors": [ { "message": "REST call for action execute failed. Message:Request to backend service failed. Response from web service: {\"code\":\"AUTHENTICATIONFAILURE\",\"details\":{},\"message\":\"Authentication failed\",\"status\":\"error\"}\n [7595fcb5-e346-487e-a7ad-f81326bb171b]", "code": "AUTHENTICATION_REQUIRED", "status": 401, "messageParams": {}, "details": [], "errors": [] } ] }


    Jason_Mathison | 2020-03-03 14:59:38 UTC | #2

    Can you provide an export of the data action (without the client ID and secret) so we can see what is going on?


    db97f7fa835dbf12c5ab | 2020-03-03 15:01:06 UTC | #3

    { "name": "Web Services Data Actions (1) (Auth) - Exported 2020-03-03 @ 16:00", "integrationType": "custom-rest-actions", "actionType": "customAuth", "config": { "request": { "requestUrlTemplate": "https://accounts.zoho.eu/oauth/v2/token?refresh_token={refresh_token}&clientid={clientid}&clientsecret={clientsecret}&granttype=refreshtoken", "requestType": "POST", "headers": { "Authorization": "Basic $encoding.base64(\"${credentials.clientId}:${credentials.clientSecret}\")", "Content-Type": "application/x-www-form-urlencoded" }, "requestTemplate": "granttype=clientcredentials" }, "response": { "translationMap": {}, "translationMapDefaults": {}, "successTemplate": "${rawResult}" } }, "contract": { "input": { "inputSchema": { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Auth Input", "description": "No Input Value", "type": "object", "properties": {} } }, "output": { "successSchema": { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": {}, "additionalProperties": true } } }, "secure": false }


    db97f7fa835dbf12c5ab | 2020-03-03 15:02:01 UTC | #4

    now he gives us this mistake and we don't know what's wrong.

    { "message": "The request could not be understood by the server due to malformed syntax.", "code": "bad.request", "status": 400, "messageParams": {}, "contextId": "c03ad0b0-ac19-474a-a63d-3fc40d2d54ac", "details": [ { "errorCode": "ACTION.PROCESSING" } ], "errors": [ { "message": "Failed due to malformed requestUrlTemplate. Illegal character in query at index 54: https://accounts.zoho.eu/oauth/v2/token?refresh_token={refresh_token}&clientid={clientid}&clientsecret={clientsecret}&granttype=refreshtoken", "code": "BAD_REQUEST", "status": 400, "messageParams": {}, "details": [], "errors": [] } ] }


    Jason_Mathison | 2020-03-03 15:06:25 UTC | #5

    There look to be a couple of issues with your variable substitution.

    Take a look at this page: https://help.mypurecloud.com/articles/how-to-use-the-user-defined-oauth-credential-type/

    Specifically, the example authorization header: "Authorization": "Basic $encoding.base64(\"${credentials.clientId}:${credentials.clientSecret}\")",

    Note that variables in the custom auth action have a $ in front of the { for a variable, and that the variables are in the form ${credentials.foo}


    db97f7fa835dbf12c5ab | 2020-03-03 15:08:43 UTC | #6

    Hello,

    where exactly do you see the flaw?

    thnx


    db97f7fa835dbf12c5ab | 2020-03-03 15:11:19 UTC | #7

    I'm still getting this mistake, too:

    { "message": "The request could not be understood by the server due to malformed syntax.", "code": "bad.request", "status": 400, "messageParams": {}, "contextId": "52356cb0-fc51-4bc7-92bd-2adec2e55f18", "details": [ { "errorCode": "ACTION.PROCESSING" } ], "errors": [ { "message": "Failed due to malformed requestUrlTemplate. Illegal character in query at index 54: https://accounts.zoho.eu/oauth/v2/token?refresh_token={refresh_token}&clientid={clientid}&clientsecret={clientsecret}&granttype=refreshtoken", "code": "BAD_REQUEST", "status": 400, "messageParams": {}, "details": [], "errors": [] } ] }


    Jason_Mathison | 2020-03-03 15:32:44 UTC | #8

    I see at least the following errors: {refreshtoken} {clientid} {client_secret}

    It would also be easier to see what is going on if you would export your action and attach the file to this thread.


    db97f7fa835dbf12c5ab | 2020-03-03 15:36:37 UTC | #9

    <a class="attachment" href="/forum/uploads/db6296/original/2X/d/d33f31e8a671adec509d36207dfa3ba0f104aa88.json">Web-Services-Data-Actions-2-Auth-20200303163608.customAuth.json</a> (1.2 KB)

    Upload

    thnks


    Jason_Mathison | 2020-03-03 15:40:43 UTC | #10

    Your Request URL template contains {refreshtoken} {clientid} {client_secret}

    that all need to be updated.

    Looking at the docs I could find for this I don't think you are expected to include an authorization header https://www.zoho.com/accounts/protocol/oauth/web-apps/access-token.html


    Jason_Mathison | 2020-03-03 15:44:24 UTC | #11

    It also looks like you can empty out the request template.

    Finally, the documentation indicates that you need a "Authorized Redirect URI", however the example doesn't include one so I'm not sure what to do with that.


    db97f7fa835dbf12c5ab | 2020-03-03 15:46:15 UTC | #12

    If I do not include in the integration of webservice, in the section credentials the token of authorization, indicates me this error.

    { "message": "The request could not be understood by the server due to malformed syntax.", "code": "bad.request", "status": 400, "messageParams": {}, "contextId": "ab6876ea-5de0-440b-ab87-6b563dcc0c6a", "details": [ { "errorCode": "ACTION.PROCESSING" } ], "errors": [ { "message": "Failed due to malformed requestUrlTemplate. Illegal character in query at index 54: <REDACTED>", "code": "BAD_REQUEST", "status": 400, "messageParams": {}, "details": [], "errors": [] } ] }


    db97f7fa835dbf12c5ab | 2020-03-03 15:55:44 UTC | #13

    Is correct body?

    { "requestUrlTemplate": "https://accounts.zoho.eu/oauth/v2/token?refresh_token={refresh_token}&clientid={clientid}&clientsecret={clientsecret}&granttype=refreshtoken", "requestType": "POST", "headers": { "Authorization": "Basic $encoding.base64(\"${credentials.clientId}:${credentials.clientSecret}\")", "Content-Type": "application/x-www-form-urlencoded" }, "requestTemplate": "granttype=refreshtoken" }


    Jason_Mathison | 2020-03-03 16:09:01 UTC | #14

    As far as I can tell, you are still missing the $ before the {

    It looks like the forum is sometimes messing up the special characters.

    Also, based on the documentation it doesn't appear that you need anything in the request template.


    db97f7fa835dbf12c5ab | 2020-03-04 07:17:24 UTC | #15

    Hello,

    Where do you think the $ is missing?

    It's still not working and it's still making the same mistake.

    { "message": "The request could not be understood by the server due to malformed syntax.", "code": "bad.request", "status": 400, "messageParams": {}, "contextId": "8af4e7b7-91d2-4889-87de-ac58e823aa88", "details": [ { "errorCode": "ACTION.PROCESSING" } ], "errors": [ { "message": "Failed due to malformed requestUrlTemplate. Illegal character in query at index 54: <REDACTED>", "code": "BAD_REQUEST", "status": 400, "messageParams": {}, "details": [], "errors": [] } ] }


    anon28885283 | 2020-03-04 07:26:00 UTC | #16

    I can't download the json for the action anymore but from what you posted some of your variables does not have $.

    e.g. Instead of {refreshtoken} it should be ${refreshtoken}.

    Everytime you enclose a variable in {} it should be prepended with $.


    db97f7fa835dbf12c5ab | 2020-03-04 07:45:50 UTC | #17

    Hello,

    If I add the $ between {}, it gives us this error.

    Resolve request URL template: Substitution values invalid in action config. Variable $refresh_token has not been set at UrlTemplate[line 1, column 55] A common reason for this error is needing to prepend the variable with 'input.' or 'credentials.'


    anon28885283 | 2020-03-04 08:14:03 UTC | #18

    It depends where you're getting those values. If you've defined it in the Data Action Input contract then it's ${input.refresh_token}, if you've set the credentials for the Integration then it would be like ${credentials.client_id}


    db97f7fa835dbf12c5ab | 2020-03-04 08:12:19 UTC | #19

    In the integration data I set

    loginUrl clientId clientSecret refresh_token

    and these are the details of the request

    { "requestUrlTemplate": "${credentials.loginUrl}" "requestType": "POST", "headers": { "Authorization": "Basic $encoding.base64(${credentials.clientId:${credentials.clientSecret}", "Content-Type": "application/x-www-form-urlencoded" }, "requestTemplate": "granttype=clientcredentials" }

    Documentation:

    https://help.mypurecloud.com/articles/how-to-use-the-user-defined-oauth-credential-type/

    Then in the input of the data action we add an input field, refresh_token?

    Thnks


    anon28885283 | 2020-03-04 08:37:35 UTC | #20

    The resource article is just an example on how one may authenticate with an OAuth service. In your case, at least based on the documentation Jason posted, you won't need the Authorization header since Zoho is asking for the credentials in the URI itself as part of the query parameters.

    Try this as your requestUrlTemplate https://accounts.zoho.eu/oauth/v2/token?refresh_token=${credentials.refresh_token}&client_id=${credentials.client_id}&client_secret=${credentials.client_secret}&grant_type=refresh_token


    db97f7fa835dbf12c5ab | 2020-03-04 08:22:55 UTC | #21

    If we do it with the url you indicate, we get this error.

    Resolve request URL template: Substitution values invalid in action config. Reference ${credentials.client_id} evaluated to null when attempting to render at UrlTemplate[line 1, column 94] A common reason for this error is needing to prepend the variable with 'input.' or 'credentials.'


    anon28885283 | 2020-03-04 08:29:18 UTC | #22

    I did not notice you replaced some of them with camelCase. Replace clientid with clientId. Do the same with clientsecret. Basically it should match the names you've set in the integration credentials.


    db97f7fa835dbf12c5ab | 2020-03-04 08:31:07 UTC | #23

    We make this mistake.

    { "requestUrlTemplate": "https://accounts.zoho.eu/oauth/v2/token?refresh_token=${credentials.refresh_token}&clientId=${credentials.clientId}&clientSecret=${credentials.clientSecret}&granttype=refreshtoken", "requestType": "POST", "headers": { "Authorization": "Basic $encoding.base64(\"${credentials.clientId}:${credentials.clientSecret}\")", "Content-Type": "application/x-www-form-urlencoded" }, "requestTemplate": "granttype=clientcredentials" }

    Error:

    { "message": "The request could not be understood by the server due to malformed syntax.", "code": "bad.request", "status": 400, "messageParams": {}, "contextId": "984d0275-12f9-46a5-8acb-dc8b3359c5de", "details": [ { "errorCode": "ACTION.REMOTEENDPOINT" } ], "errors": [ { "message": "REST call for action execute failed. Message:Request to backend service failed. Response from web service: \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n&lt;html&gt;\n&lt;head&gt;\n&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n&lt;link\n\thref=\"https://fonts.googleapis.com/css?family=Open+Sans:400,600,700\"\n\trel=\"stylesheet\"&gt;\n\n&lt;/head&gt;\n&lt;style&gt;\nbody {\n\twidth: 100%;\n\tfont-family: 'Open Sans', sans-serif;\n\tmargin: 0;\n}\n\n.container {\n\tdisplay: block;\n\twidth: 70%;\n\tmargin: auto;\n\tmargin-top: 120px;\n}\n\n.zohologo {\n\tdisplay: block;\n\tmargin: auto;\n\theight: 34px;\n\twidth: 100px;\n\tbackground: url(\"/v2/components/images/zoho.png\") no-repeat transparent;\n\tbackground-size: auto 100%;\n\tmargin-bottom: 40px;\n}\n\n.errorimg {\n\tdisplay: block;\n\theight: 300px;\n\tmargin-bottom: 40px;\n\twidth: 100%;\n}\n\n.raodblock {\n\tbackground: url(/v2/components/images/roadblock.png) no-repeat transparent;\n\tbackground-size: auto 100%;\n\tbackground-position: center;\n}\n\n.heading {\n\tdisplay: block;\n\ttext-align: center;\n\tfont-size: 24px;\n\tmargin-bottom: 10px;\n\tline-height: 34px;\n\tfont-weight: 600;\n}\n\n.discrption {\n\tdisplay: block;\n\twidth: 500px;\n\tmargin: auto;\n\ttext-align: center;\n\tfont-size: 16px;\n\tmargin-bottom: 10px;\n\tline-height: 24px;\n\tcolor: #444;\n}\n\n@media only screen and (-webkit-min-device-pixel-ratio: 2) , only screen and (\n\t\tmin--moz-device-pixel-ratio: 2) , only screen and (\n\t\t-o-min-device-pixel-ratio: 2/1) , only screen and (\n\t\tmin-device-pixel-ratio: 2) , only screen and ( min-resolution: 192dpi)\n\t\t, only screen and ( min-resolution: 2dppx) {\n\t.raodblock {\n\t\tbackground: url(/v2/components/images/roadblock@2x.png) no-repeat transparent;\n\t\tbackground-size: auto 100%;\n\t\tbackground-position: center;\n\t}\n}\n\n@media only screen and (max-width: 420px) {\n\t.container {\n\t\twidth: 90%;\n\t\tmargin-top: 50px;\n\t}\n\t.discrption {\n\t\twidth: 100%;\n\t}\n\t.errorimg {\n\t\tdisplay: block;\n\t\tmax-width: 340px;\n\t\tbackground-size: 100% auto;\n\t\tmargin: auto;\n\t\tmargin-bottom: 40px;\n\t}\n\t.heading {\n\t\tdisplay: block;\n\t\ttext-align: center;\n\t\tfont-size: 20px;\n\t\tmargin-bottom: 10px;\n\t\tline-height: 30px;\n\t\tfont-weight: 600;\n\t}\n\t.discrption {\n\t\tdisplay: block;\n\t\tmargin: auto;\n\t\ttext-align: center;\n\t\tfont-size: 14px;\n\t\tmargin-bottom: 10px;\n\t\tline-height: 24px;\n\t\tcolor: #444;\n\t}\n}\n&lt;/style&gt;\n\n&lt;body&gt;\n\t&lt;div class=\"container\"&gt;\n\t\t&lt;div class=\"zohologo\"&gt;&lt;/div&gt;\n\t\t&lt;div class=\"errorimg raodblock\"&gt;&lt;/div&gt;\n\t\t&lt;div class=\"heading\"&gt;An error occurred.&lt;/div&gt;\n\t\t&lt;div class=\"discrption\"&gt;An error occurred while processing your request.&lt;br&gt; Please try again later.\n\t\t&lt;/div&gt;\n\t&lt;/div&gt;\n&lt;/body&gt;\n&lt;/html&gt; [984d0275-12f9-46a5-8acb-dc8b3359c5de]", "code": "BAD_REQUEST", "status": 400, "messageParams": {}, "details": [], "errors": [] } ] }


    anon28885283 | 2020-03-04 08:42:46 UTC | #24

    Try removing the headers and emptying out the requestTemplate


    db97f7fa835dbf12c5ab | 2020-03-04 08:49:31 UTC | #25

    Hi,

    Now he's pointing out this mistake:

    { "error": "<REDACTED STRING(14)>" }

    Steps:

    1. Validate request body contains simple json (key-value pairs)

    { "orgId": "c1011b6e-9027-415e-8989-222df70e004e", "integrationId": "6ea2ef2c-328d-49b5-9eba-2e46602b7f4d", "rawRequest": "{}" }

    1. Validate draft definition

    { "success": true }

    1. Validate request body against input schema

    { "success": true }

    1. Perform authentication

    { "success": true }

    1. Resolve request URL template

    "[POST] https://accounts.zoho.eu/oauth/v2/token?refresh_token=<REDACTED>&clientId=<REDACTED>&clientSecret=<REDACTED>&grant_type=refresh_token"

    1. Resolve request header templates

    {}

    1. Resolve request body template

    "{}"

    1. Execute

    { "error": "<REDACTED STRING(14)>" }

    1. Resolve translation map

    { "rawResult": "<REDACTED STRING(32)>" }

    1. Apply output transformation

    { "error": "<REDACTED STRING(14)>" }

    1. Validate output against schema

    { "success": true }

    1. Flatten

    { "error": "invalid_client" }


    db97f7fa835dbf12c5ab | 2020-03-04 12:35:43 UTC | #26

    I've already worked it out. Thank you very much.

    Regards


    db97f7fa835dbf12c5ab | 2020-03-05 08:23:23 UTC | #27

    Now when we generate the data action we get this glitch. Attached is the data action.

    <a class="attachment" href="/forum/uploads/db6296/original/2X/6/6d6487320771c5a8738df1cce4c5b0f986072a7a.json">zoho-2020030585331.custom.json</a> (980 Bytes)

    { "message": "The requested resource was not found.", "code": "not.found", "status": 404, "messageParams": {}, "contextId": "5150e940-c830-43dd-90bf-28502dba7e88", "details": [ { "errorCode": "ACTION.REMOTEENDPOINT" } ], "errors": [ { "message": "REST call for action execute failed. Message:Request to backend service failed. Response from web service: {\"code\":\"INVALIDURLPATTERN\",\"details\":{},\"message\":\"Please check if the URL trying to access is a correct one\",\"status\":\"error\"}\n [5150e940-c830-43dd-90bf-28502dba7e88]", "code": "NOTFOUND", "status": 404, "messageParams": {}, "details": [], "errors": [] } ] }

    Regards,


    anon28885283 | 2020-03-05 08:36:11 UTC | #28

    db97f7fa835dbf12c5ab, post:27, topic:7251
    ACTION.REMOTE_ENDPOINT

    If you're getting this errorCode that means that the service (in this case Zoho) you're trying to request from is throwing back the error. You'd need to consult their documentations on why you're getting the error response.


    db97f7fa835dbf12c5ab | 2020-03-05 09:05:59 UTC | #29

    I already solved it, thanks!


    db97f7fa835dbf12c5ab | 2020-03-05 15:52:59 UTC | #30

    Hello again, now we get this mistake.

    { "message": "The requested resource was not found.", "code": "not.found", "status": 404, "messageParams": {}, "contextId": "720dce79-1112-4ec2-9d3b-bf129c6973d2", "details": [ { "errorCode": "ACTION.REMOTEENDPOINT" } ], "errors": [ { "message": "REST call for action execute failed. Message:Request to backend service failed. Response from web service: {\"code\":\"INVALIDURLPATTERN\",\"details\":{},\"message\":\"Please check if the URL trying to access is a correct one\",\"status\":\"error\"}\n [720dce79-1112-4ec2-9d3b-bf129c6973d2]", "code": "NOTFOUND", "status": 404, "messageParams": {}, "details": [], "errors": [] } ] }

    Fail step 8 attached the data action <a class="attachment" href="/forum/uploads/db6296/original/2X/0/0b3224920b25e9ac235081b186192d4b54c0a2aa.json">AcciondeDatosZoho-PUT-20200305160303.custom.json</a> (1.2 KB)


    anon28885283 | 2020-03-06 01:44:30 UTC | #31

    Hi,

    It seems that you're again getting the errorCode: ACTION.REMOTE_ENDPOINT

    As mentioned, that's an indication that you are successfuly sending the request to the webservice but the service (Zoho) is giving you back the error. Based on the status (404) it seems Zoho did not find what you were trying to query/search for. Unfortunately, I'm not familiar with Zoho or its API so I can't give expert advice on it.


    db97f7fa835dbf12c5ab | 2020-03-06 07:11:46 UTC | #32

    Hello and this mistake, what is it?

    { "message": "The request could not be understood by the server due to malformed syntax.", "code": "bad.request", "status": 400, "messageParams": {}, "contextId": "cf97c5cd-cb94-4284-8fb0-b5c5b7c1f527", "details": [ { "errorCode": "ACTION.REMOTEENDPOINT" } ], "errors": [ { "message": "REST call for action execute failed. Message:Request to backend service failed. Response from web service: {\"code\":\"MANDATORYNOTFOUND\",\"details\":{\"apiname\":\"data\"},\"message\":\"required field not found\",\"status\":\"error\"}\n [cf97c5cd-cb94-4284-8fb0-b5c5b7c1f527]", "code": "BAD_REQUEST", "status": 400, "messageParams": {}, "details": [], "errors": [] } ] }

    Thnks!


    anon28885283 | 2020-03-06 12:12:22 UTC | #33

    db97f7fa835dbf12c5ab, post:32, topic:7251
    "errorCode": "ACTION.REMOTE_ENDPOINT"

    Still Zoho throwing the error back. Looks like your request is missing some field that Zoho is expecting.


    Jason_Mathison | 2020-03-06 13:30:00 UTC | #34

    Reference ${credentials.client_id} evaluated to null when attempting to render at UrlTemplate

    Indicates that the credentials you created didn't include "client_id". Do you still have the key/value pairs of credentials that you created? If not, you might create a new set of credentials and make sure that you keep track of the "name" of each part of the credential.


    system | 2020-04-06 13:30:01 UTC | #35

    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: 7251