401 Unauthorized / Unauthenticated Application Error on Trip Planner API despite active API Token

I am experiencing a persistent 401 Unauthorized error when attempting to access the Trip Planner APIs (specifically the /stop_finder endpoint). I have followed the User Guide instructions exactly, but the API Gateway returns: "Message":"The calling application is unauthenticated."

Steps I have already taken:

  1. Account & Token: Registered a developer account and generated a new API Token under my profile.

  2. Authorization Format: In the API Console / Swagger UI, I used the Authorize button and entered the value in the format: apikey [MY_TOKEN_HERE].

  3. Python Testing: I have also tested via a Python script with the header {"Authorization": "apikey [MY_TOKEN]"} and received the same 401 response.

  4. Subscription: I have accessed the “Trip Planner APIs” dataset page, but I cannot find a clear “Subscribe” button or an “Applications” dashboard to link this specific token to the Trip Planner resource.

Request Details:

  • Endpoint: https://api.transport.nsw.gov.au/v1/tp/stop_finder

  • Response Code: 401

  • Error Message: { "ErrorDetails": { "Message": "The calling application is unauthenticated." } }

  • Date/Time of last attempt: [Insert Today’s Date/Time]

Questions for the Moderators:

  1. Is there a known delay in token activation (propagation time) for accounts created recently?

  2. Does the current portal version require tokens to be manually associated with a specific “Application” and “Subscription Plan” (e.g., Bronze Plan) before they work, and if so, where is that menu located?

  3. Is my account currently flagged as “Active” for the Trip Planner scope?


A few things to check one last time before you post:

  • The “Secret” vs. “Token”: Some portals show a “Consumer Key” and a “Consumer Secret.” Make sure you are using the API Key/Token, not the secret.

  • Environment: If you are using a VPN or a restricted corporate network, the TfNSW gateway might be blocking the request before it even checks the token. Try running your Python code from a different network (like a mobile hotspot) to rule this out.

Hi @roshandahal

There will be no delay in activating the API token. Please ensure that the token is entered in the correct format and that it is working as expected.

The token should be entered as:
apikey XXX
where XXX is your API token. There is no need to include square brackets ([]) when entering the token.

If the issue persists, please send us a screenshot via email (apigateway.support@transport.nsw.gov.au), and we will review it to identify what might be going wrong.