Developers
Everything a resident or staff member can do in SportsMgnt goes through the same rules the API uses. The API is JSON over HTTPS under /api/v1.
Basics
- Responses use an envelope: data, plus meta with paging totals. Errors use one shape: error.code, error.message and error.fields.
- Public catalog and facility reads need no token. Anonymous requests are limited to 60 per minute.
- Everything else needs a personal access token in the Authorization header. Tokens are limited to 120 requests per minute.
Try it
curl 'https://sportsmgnt.com/api/v1/health' -H 'Accept: application/json'
curl 'https://sportsmgnt.com/api/v1/me/token' -H 'Authorization: Bearer YOUR_TOKEN'
Create a token
- Sign in (for example as the resident persona) and open Security, then API tokens.
- Pick the scopes the token needs and an expiry of up to 90 days.
- Copy the token: it is shown only once. Revoke it from the same page.
Scopes
| Scopes | Description |
|---|---|
| catalog:read | Read the public catalog |
| household:read | Read my household, members, enrolments and calendar |
| household:write | Change my household and cart |
| facilities:read | Read facilities and availability |
| reservations:write | Request facility reservations |
| staff:rosters | Read rosters (staff, within my roles) |
| staff:attendance | Record attendance (staff, within my roles) |
| staff:reports | Run reports (staff, within my roles) |
Staff tokens are also limited by the staff member's role and locations.
Embed the catalog on a website
Add one script tag where the widget should appear. The script inserts an iframe that resizes itself to its content, so there is no scrollbar inside the frame.
<script src="https://sportsmgnt.com/embed.js" data-widget="catalog" data-lang="en"
data-category="aquatics" data-primary="5b2a86" data-accent="0f7b6c"
data-title="Kestrel Basin Parks activity catalog (SportsMgnt)"></script>
Attributes
data-widget- catalog or facilities
data-lang- en or es
data-category,data-location,data-type- optional filters, for example a category slug or a location code
data-primary,data-accent- your site's colours as six-digit hex values, applied inside the widget
data-title- the accessible name of the frame
The widget pages carry the demo banner and the sample-data notice. Sites allowed to frame them are listed in the embed setting.