How to capture API error in App Flow

I have an App Flow that calls a Google API. I’m storing the Access Token and Refresh Token for the API in a previous process, but it needs to be refreshed. I hope to perform the refresh in the App Flow only when it returns a “401 Unauthorized” because the access token expired, but I’m unsure how to capture the 401.

Also, App Flows seem to separate the API calls into separate network requests. The oauth is a Server Connect and labels is an API action within the App Flow.

image

I’m not sure if the Pass Errors flag on the API works and it doesn’t look like that’s something that can be used in a Condition.

Here’s the error for the 401.

Resolved by using api.status, which you have to manually type.

image

2 Likes