I have set up an HTTP connection with token authentication and have configured a refresh token that should refresh every 2 hours(because token expires every 2 hours). In the refresh token box I have filled in a wrong dummy token in the token input box and correctly filled in the relative URI and HTTP request body. The path to token field has been set to "token" because this is where I receive the new token, which is in the following format: {token:"newtoken"}.
In my HTTP flow step, I have configured the HTTP header with the token, {{connection.http.auth.token.refreshToken}}. When I perform a test connection from the connection in Integrator, it successfully posts to the relative URI endpoint of the refresh token box and fetches a new token. However, when I perform a post from in HTTP flow step, I receive a response with a status code 401 and the error message "api authentication failed". It appears that my refresh token is not working as expected, as the endpoint receives the dummy token that I had filled in manually instead of performing a post to fetch a new token.
What could I be doing wrong?