Skip to content

TSO Mobile

ciolt edited this page Jan 20, 2019 · 1 revision

Why?

As far as I know, TSO Mobile’s APIs haven’t been properly documented anywhere else (no, this thing doesn’t count.) This wiki serves to clarify the confusion and mystery of the TSO API by making the current API documentation public, through my own testing and observation.

Getting Started

Connecting

Base URL https://rest.tsoapi.com/
Alternate URL https://app.tsomobile.com/rest/
Sandbox URL http://sandboxrest.tsomobile.com/
Format {Base URL}/{Scope}/{Method}

The API is simple to connect to, and the Base URL accepts either HTTP or HTTPS. It’s recommended to use HTTPS whenever possible.

Making a request

Most requests require a token in the query string after the ‘?’. These are supplied as a parameter named tkn. The known values for tkn are as follows:

Service Area Token Value
Hollywood C6B3CFCC-C1B2-47B4-9FD3-EEFB2A46E3C6
Doral Trolley 582EB861-9C13-4C89-B491-15F0AFBF9F47
Miami Beach Trolley 825894C5-2B5F-402D-A055-88F2297AF99A
Miami Lakes DB13899C-1B19-4577-9CA2-D4DDD773384D
City of Miami 81E39EC9-D773-447E-BE29-D7F30AB177BC

This parameter is REQUIRED for all requests. Failure to provide it will make the server respond with a blank string. The wrong/invalid token will return empty data. Be sure you send the token exactly as-is here.

Example

Sending this:

GET /Routes/GetRouteFromToken?tkn=582EB861-9C13-4C89-B491-15F0AFBF9F47&routeId=-1 HTTP/1.1

Yields:

"{\"stops\":[{\"ID\":\"723723\",\"ContactID\":\"1856141\",\"StopNumber\":\"1001\",\"Street\":\"Northwest 12th Street\",\"City\":\"Miami\", ...

Handling Responses

All responses from the REST API will be encoded in JSON, encoded in a double-quote string. However, sometimes a JSON object won’t be returned: it may be an empty string rather than {}. An invalid endpoint or method may also return an HTML document. Please ensure your application handles this properly.

Examples

"{\"stops\":{},\"routes\":{},\"points\":{}}"
""
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Tra...