amazon-connect / amazon-connect-salesforce-lambda

Apache License 2.0
45 stars 34 forks source link

Exception : Destination URL not reset. The URL returned from login must be set #12

Closed tejasb09 closed 3 years ago

tejasb09 commented 3 years ago

Hello,

I have just deployed the latest v5.9 release of this application. When I invoking the sfInvokeAPI lambda function , I am getting the below exception.

Am older version is working fine.

Payload: { "Details": { "Parameters": { "sf_operation": "lookup", "sf_object": "User", "Email": "", "sf_fields": "Id" } } }

[DEBUG] 2021-01-18T22:51:24.333Z bb72c63f-0d86-4a14-952b-184ec6372cbc https://test.salesforce.com:443 "GET /services/data/v48.0/query?q=SELECT+Id+FROM+User+WHERE+Email%3D%27DataMaskedforPrivacy%27 HTTP/1.1" 400 None

[INFO] 2021-01-18T22:51:24.335Z bb72c63f-0d86-4a14-952b-184ec6372cbc Response: [{"errorCode":"URL_NOT_RESET","message":"Destination URL not reset. The URL returned from login must be set"}]

[ERROR] 2021-01-18T22:51:24.351Z bb72c63f-0d86-4a14-952b-184ec6372cbc URL_NOT_RESET: Destination URL not reset. The URL returned from login must be set

[ERROR] Exception: URL_NOT_RESET: Destination URL not reset. The URL returned from login must be set Traceback (most recent call last):   File "/var/task/sfInvokeAPI.py", line 55, in lambda_handler     resp = lookup(sf=sf, event['Details']['Parameters'])   File "/var/task/sfInvokeAPI.py", line 90, in lookup     records = sf.query(query=query)   File "/var/task/salesforce.py", line 89, in query     resp = self.makeRequest(self.request.get, {"url": url, "params":{'q':query}})   File "/var/task/salesforce.py", line 183, in makeRequest     return requestMethod(**kwargs, headers=self.headers)   File "/var/task/salesforce.py", line 224, in get     return check_resp(r)   File "/var/task/salesforce.py", line 244, in check_resp     raise Exception(msg) END RequestId: bb72c63f-0d86-4a14-952b-184ec6372cbc

Regards

tejasb09 commented 3 years ago

used the SF domain URL to resolve this