alialjohani | 2018-09-24 11:22:46 UTC | #1
Dears All,
I am trying to integrate with our customer's API, but unfortunately I am having this error related to authentication.
{ "status": 401, "code": "authentication.required", "message": "No authentication bearer token specified in authorization header.", "messageParams": {}, "contextId": "22516e59-9af6-4f8a-bc0f-9c29e572bba8", "details": [], "errors": [ { "status": 401, "code": "AUTHENTICATION_REQUIRED", "message": "REST call for action execute failed. Message:Request to backend service failed. Response from web service: {\"message\":\"insert valid token\",\"success\":false} [22516e59-9af6-4f8a-bc0f-9c29e572bba8]", "messageParams": {}, "details": [], "errors": [] } ] }
I was following same explained details in: https://help.mypurecloud.com/articles/add-web-services-data-actions-integration/ based on "User Defined", and also following the same in here: https://help.mypurecloud.com/articles/create-custom-action-integrations/ https://help.mypurecloud.com/articles/how-to-use-user-defined-credential-type-web-services-data-actions-integration/
However, even though I was following all the mentioned resources above, I still have the error as shown before. These are the different configuration requests:
{ "requestUrlTemplate": "https://apitemp.CustomerApi.com/genesys/genesys-api/get-last-order-by-user/0511223344&token=${credentials.token}", "requestType": "GET", "headers": {}, "requestTemplate": "${input.rawRequest}" }
{ "requestUrlTemplate": "https://apitemp.CustomerApi.com/genesys/genesys-api/get-last-order-by-user/0511223344", "requestType": "GET", "headers": { "Authorization" : "bearer xxxxxxxxxxxxxxxxxxx" }, "requestTemplate": "${input.rawRequest}" }
On other hand, I am not sure how to configure advance configuration during integration process:
Please, any comments or advisement would be helpful.
Best Regards, Ali
Jason_Mathison | 2018-09-24 13:49:11 UTC | #2
The advanced configuration section is unused for data actions.
Assuming that the customer has a stand-alone "authentication" endpoint, you probably need to go through these instructions: https://help.mypurecloud.com/articles/how-to-use-user-defined-oauth-credential-type-web-services-data-actions-integration/
alialjohani | 2018-09-25 09:02:21 UTC | #3
Dear Jason,
I appreciate your feedback. I just have followed the instruction page you provided. Unfortunately, I still have the same error:
{ "status": 401, "code": "authentication.required", "message": "No authentication bearer token specified in authorization header.", "messageParams": {}, "contextId": "0af4409d-52ab-45f0-b92a-66db4e12a5b0", "details": [], "errors": [ { "status": 401, "code": "AUTHENTICATION_REQUIRED", "message": "REST call for action execute failed. Message:Request to backend service failed. Response from web service: {\"message\":\"insert valid token\",\"success\":false} [0af4409d-52ab-45f0-b92a-66db4e12a5b0]", "messageParams": {}, "details": [], "errors": [] } ] }
Since our customer api has provided me Token to be used in the header, I defined a token with its value in Web Service Data Action integration as shown below.
Then, a new action is added based on the previous integration name. Always I have the same error regarding the authentication with different Configuration Requests as shwon below:
On other hand, the customer API works with Postman and RESTED.
Kindly, your comments can be helpful. Best Regards, Ali
Jason_Mathison | 2018-09-25 12:39:27 UTC | #4
In your Data Action examples you are setting an "Authorization" header. In your working example it appears that the header is "token".
alialjohani | 2018-09-25 13:34:03 UTC | #5
Dear Jason,
Thank you very much for your support. The issue has been resolved now as shown below.
Best Regards, Ali
system | 2018-10-26 13:34:07 UTC | #6
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: 3611