Sync environment properties via Rest API
Recipe ToolsDeveloper ToolAPI Integration
What it does
When someone calls this automation, it fetches or updates an environment property by making an HTTP request. The result returns so the caller knows whether the operation succeeded.
Who it's for
Engineering teams who need to manage environment properties programmatically without manual intervention.
How teams use this
Fetch the current refresh token
Call this automation with action set to fetch so the refresh token environment property is retrieved through an HTTP request via Rest. The result comes back in the response without any manual steps.
Update access tokens after rotation
Call this automation with action set to update so both new and old access token environment properties are set through HTTP requests via Rest. This keeps the environment in sync after a token rotation event.
Add a new environment property type
Extend this automation to handle additional property types by adding a condition branch that checks the action parameter and makes the appropriate HTTP request via Rest. Only the condition logic needs to be added.
How it works
- Receive the function call. A real-time function call arrives with an action parameter that specifies fetch or update for the environment property.
- Fetch the refresh token property. When the action is fetch, this automation makes an HTTP request to retrieve the current refresh token environment property value from Rest.
- Update the access token properties. When the action is update, this automation makes HTTP requests through Rest to set both the new and old access token environment properties.
- Return the result. The automation sends back the outcome of the fetch or update operation so the caller receives confirmation of success or failure.