Train Service IDs

James Singleton edited this page Sep 13, 2016 · 3 revisions

To get the details of an individual train use the following URL format:

/service/[GUID Service ID]?accessToken=[Your GUID token]

The service ID can be found for each service inside the station board responses.

This endpoint accepts the GUID representation of the ID as /, + and case sensitivity can cause trouble in a URL path if you're not careful. You can make a GUID version of a Service ID with code like this:

var sid = new Guid(Convert.FromBase64String(si.serviceID));

You can still use the Base64 version but to avoid issues you should include it as a query string parameter instead of in the path:

/service?accessToken=[Your GUID token]&ServiceId=[Base64 Service ID]

A better solution may be to use Base64 URL safe encoding. Huxley provides and accepts this.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.