Hi Everyone,
I'm trying to utilize the APM Synthetic feature to setup a recurring ping to an API to health check its availability. This API requires passing an Azure JSON Web Token (JWToken) as part of the header. To obtain the JWToken which expires in about 1 hour I need to invoke another API to go to Azure to provide me with the token value. The response to this API is coming in JSON format and I just need to retrieve one filed from this and after storing it to a Custom Variable, feed it to next API as part of the header.
I've been trying to use the "Setup" Step to store the extracted filed from the json response from Azure. The field name is "access_token" in the sample json response below. To extract this field I've used $.access_token, which is the standard way of getting a scalar value from the json structure below. I save this value as "accessToken" and in second API call I set the header as "Bearer {{accessToken}}".
When I invoke the APIs set I get the error "Test validation: failed. Extract from response body failed".
{
"token_type": "Bearer",
"expires_in": 3599,
"ext_expires_in": 3599,
"access_token": "fsdfhlasdkfhsldfhsd7459438753"
}