Issue getting token to work

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

Seems the issue is not with the code, but with the try now page on open data.
When I used the code and did a GET request in Postman it worked fine.

Hi radiomedia,

Welcome to the Open Data Forum! The Fuel Check API is not owned by Open Data, we just link to it. I have submitted your enquiry via the Support link on https://api.nsw.gov.au/Product/Index/22. I will keep you updated.

Regards,
Julie

Hi radiomedia,

I have received the following response:

The header value should be :

Authorization: Bearer ACCESS_TOKEN

Could you let me know if this works?

Thanks,
Julie

© Transport for NSW