Lloyd | 2021-11-22 03:20:46 UTC | #1
Currently in the process of doing a POC validation between Genesys Cloud and Alemba ServiceDesk (ASM) v10.3
I can successfully retrieve an access token from the OAuth endpoint using Postman, but get an *SocketTimeoutException* error returned when I attempt the Auth request from Genesys Cloud
Postman:
Data Action Configuration:
Error returned:
8. Execute: The server encountered an unexpected condition which prevented it from fulfilling the request.
- REST call for action execute failed. Message:Unable to send message after 2 attempts, due to: SocketTimeoutException: connect timed out [3cee9ed0-fde6-4e8e-bcb4-06a14af54456]
I've tried adding in the "Transfer-Encoding": "buffered" header parameter as well, as I've had to do that in the past to resolve an issue with an x-www-form-urlencoded request. But that did not work/same error.
The full error message is:
{ "message": "The server encountered an unexpected condition which prevented it from fulfilling the request.", "code": "internal.server.error", "status": 500, "messageParams": {}, "contextId": "3cee9ed0-fde6-4e8e-bcb4-06a14af54456", "details": [ { "errorCode": "ACTION.REMOTEENDPOINT" } ], "errors": [ { "message": "REST call for action execute failed. Message:Unable to send message after 2 attempts, due to: SocketTimeoutException: connect timed out [3cee9ed0-fde6-4e8e-bcb4-06a14af54456]", "code": "INTERNALSERVER_ERROR", "status": 500, "messageParams": {}, "details": [], "errors": [] } ] }
Any leads or recommendations on how to pursue it further?
Thanks
Jerome.Saint-Marc | 2021-11-22 09:57:05 UTC | #2
Hello,
I think your problem comes from the fact that your Request Body Template is using an incorrect format.
When using application/x-www-form-urlencoded, "the keys and values are encoded in key-value tuples separated by '&' , with a '=' between the key and the value. Non-alphanumeric characters in both keys and values are percent encoded:" This is something that Postman does automatically/underneath. You can see what Postman is sending (request) through the View menu in Postman, and selecting "Show Postman Console".
So your request Body Template should not use ': 'and ',' (use '=' and '&' instead). It should not use the double quotes either (for the parameter name and parameter value). And depending on what you have in your password, you may have to escape the password string (i.e. percent encoding) - and probably scope as well. This is something you can check using the Postman Console to see exactly what is sent in the request body.
Try with something like this in your Request Body Template (using "Simple" display as you did in your screenshot above):: client_id=xxxxxxx&grant_type=password&scope=$esc.url("session-type:Analyst")&password=$esc.url("yyyyyyy")&username=postman
Regards,
Lloyd | 2021-11-22 17:14:31 UTC | #3
Thanks Jerome - Changed my request using your corrections and all working perfectly now.
system | 2021-12-23 17:15:05 UTC | #4
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: 12721