Skip to main content
Tweeted twitter.com/StackSalesforce/status/1063944877585645568
edited tags
Link
Adam Spriggs
  • 31.1k
  • 6
  • 44
  • 88
added 151 characters in body
Source Link

I use an api that requires requesting a new access token every 60 minutes because the old one expires. I have ampscript lookup logic in place along with a data extension that aids in both retrieving an existing AccessToken and/or updating the value once the 60 minute max has been exceeded in which catch. There is no issue when the AccessToken is active and created within the last 60 minutes. However, When the error exception occurs and thatthat's when request for a new AccessToken needs to take place and then attempt to perform and update the DE andwith the new AccessToken. Finally, the AccessToken is retrieve that AccessToken DE to use to perform the initial API request.

I use an api that requires requesting a new access token every 60 minutes because the old one expires. I have ampscript lookup logic in place along with a data extension that aids in both retrieving an existing AccessToken and/or updating the value once the 60 minute max has been exceeded in which catch the exception occurs and that request for a new AccessToken needs to take place and then attempt to perform and update the DE and retrieve that AccessToken to use to perform the initial API request.

I use an api that requires requesting a new access token every 60 minutes because the old one expires. I have ampscript lookup logic in place along with a data extension that aids in both retrieving an existing AccessToken and/or updating the value once the 60 minute max has been exceeded. There is no issue when the AccessToken is active and created within the last 60 minutes. However, When the error exception occurs that's when request for a new AccessToken needs to take place and then attempt to perform and update the DE with the new AccessToken. Finally, the AccessToken is retrieve that AccessToken DE to use to perform the initial API request.

added 5 characters in body
Source Link

Upon the form submission and API call the observation that I'm seeing is that the try-catch appears to work but only after the 2nd try. After I submit the form on the first attempt the API call results in a 401 - Unauthorized error and I see the "An unexpected error has occurred!" and ofcourse with a custom RaiseError message (RaiseErrorRaiseError(CONCAT('The error experienced was: ',@httppost),false), I confirmed that it is the 401 Unauthorized.

Upon the form submission and API call the observation that I'm seeing is that the try-catch appears to work but only after the 2nd try. After I submit the form on the first attempt the API call results in a 401 - Unauthorized error and I see the "An unexpected error has occurred!" and ofcourse with a custom RaiseError message (RaiseError(CONCAT('The error experienced was: ',@httppost)), I confirmed that it is the 401 Unauthorized.

Upon the form submission and API call the observation that I'm seeing is that the try-catch appears to work but only after the 2nd try. After I submit the form on the first attempt the API call results in a 401 - Unauthorized error and I see the "An unexpected error has occurred!" and ofcourse with a custom RaiseError message RaiseError(CONCAT('The error experienced was: ',@httppost),false), I confirmed that it is the 401 Unauthorized.

Source Link
Loading