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:
-
Account & Token: Registered a developer account and generated a new API Token under my profile.
-
Authorization Format: In the API Console / Swagger UI, I used the
Authorizebutton and entered the value in the format:apikey [MY_TOKEN_HERE]. -
Python Testing: I have also tested via a Python script with the header
{"Authorization": "apikey [MY_TOKEN]"}and received the same 401 response. -
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:
-
Is there a known delay in token activation (propagation time) for accounts created recently?
-
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?
-
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.