The Optimo Sport API allows 3rd party developers to expand and build on the Optimo Sport platform.
The Optimo Sport API is an interface for accessing your Optimo Sport account data using HTTP and XML. The API makes it easy to create web and desktop applications that integrate with your account.
Some potential application ideas:
- Mobile applications or service
- Develop fun and useful apps
- Custom import tools (Polar, Timex, CSV, etc.)
- Variety of Assessments
Service URL
The Optimo Sport's API has a single point of entry, derived from your account URL:
https://sample.optimosport.com/api/2.1/xml-in
Please note the use of https:// in the URL above. All Optimo Sport's API communication is encrypted over HTTPS. Any non-secure requests are automatically rejected, so we recommend establishing a test connection with the secure API entry point before sending sensitive data.
Authentication
For your account, you'll be given a unique authentication token. For every API request you make, you'll need to use HTTP basic authorization to present the unique authorization token assigned to you. The admin user, and each staff member, has an API token. The admin user's authentication token can be found on the "Optimo Sport's API" page. The coaches token can be found on each coaches member's Profile page, or on the Edit Coaches page (for admin only). At this time, coaches have limited access to the API (see the individual method pages for details).
Please note your authentication token is based on your account password. If your password changes, so will your authentication token.
HTTP authentication traditionally takes a username/password pair, but since we're dealing with a single token, you'll only use the username field. If your HTTP library requires a password as well, just use an arbitrary string - like "X".
Here's an example authenticated request made with cURL:
curl -u insert_token_here:X https://sample.optimosport.com/api/2.1/xml-in -d '[xml body here]'
Keep this token secret. It should be guarded just as you would your regular account password. If you feel your token has been compromised, you can reset it by clicking the "Reset" link on the "Optimo Sport's API" page.
Lastly, we also ask you use a unique User-Agent string to identify your application and/or organization.
Request Limits
By default, all accounts have a request limit of 5000 API requests per day. Additionally, a maximum of 100 results will be returned for list methods, regardless of the value sent with the per_page parameter.
Representation Formats
All Optimo Sport API requests are composed of light-weight XML delivered as an HTTP POST request to the endpoint URL.
- All XML should be UTF-8 encoded.
- Date and time values are of the form YYYY-MM-DD HH:MM:SS
- Booleans are either 1 (true) or 0 (false).
- Fields denoting percentages are passed as whole values, not decimals (e.g. 5 for five percent).
Sample request
<!--?xml version="1.0" encoding="utf-8"?--> <request method="[method name]"> <!-- method arguments --> </request>
All responses are wrapped in a top-level response element. The status attribute will let you know whether the request succeeded or failed.
Successful response<!--?xml version="1.0" encoding="utf-8"?--> <request status="[ok]"> <!-- return value(s) here --> </request>
In the case of a failure response, the response body will contain one or more error messages.
Unsuccessful response<!--?xml version="1.0" encoding="utf-8"?--> <request status="[fail]"> <error> ... </error> </request>