So I am trying to fetch the NSW fuel data, and I am running into issues about how we authorise and then use that token in the next step.
Basically the token I received in the first step
{
"refresh_token_expires_in": "0",
"api_product_list": "[Fuel Check Portal Api]",
"api_product_list_json": [
"Fuel Check Portal Api"
],
"organization_name": "onegov",
"developer.email": "russell@EMAIL.com",
"token_type": "BearerToken",
"issued_at": "1631666514337",
"client_id": "CLIENT_ID",
"access_token": "ACCESS TOKEN",
"application_name": "XXXXX-XXX-XXXX-XXX-XXXXXX",
"scope": "",
"expires_in": "43199",
"refresh_count": "0",
"status": "approved"
}
I then use the access token along with the API key that I have to request.
curl -X GET "https://api.onegov.nsw.gov.au/FuelPriceCheck/v1/fuel/prices" -H "accept: application/json" -H "Authorization: ACCESS_TOKEN" -H "Content-Type: application/json; charset=utf-8" -H "apikey: API_KEY" -H "transactionid: 716" -H "requesttimestamp: 2021-09-15T00:40:42Z"
The response I am getting is.
{
"errorDetails": {
"code": "TokenValidationError",
"message": "Access token is not valid."
}
}
I don’t know how the access token is not valid if I just requested it.
Is it because my timestamp requesttimestamp: 2021-09-15T00:40:42Z