Introduction
LeagueApps APIs are built to support the ever growing needs of our partners. Our current infrastructure includes a Public API and Private API which provide secure access to information from LeagueApps such as member details, registration, transactions, as well as public facing information like program lists, teams and schedules. Innovative Ideas - Integrate with sport applications for recruiting, player evaluations, stats, etc. - Add custom displays of schedules or program registration to your website - Build custom player profiles, applications or reports - Sync data to your CRM, central database or other online tools Read the documentation below for a comprehensive list of data included in our Private and Public API. Then begin building right away with self-serve API access through the LeagueApps Management Console.
General API Information
- Site ID
- The Site ID is an immutable number that uniquely identifies a LeagueApps site. All API requests require a Site ID in the url path. When accessing the LeagueApps Console, the Site ID is in the url after "sites". For example, "https://manager.leagueapps.com/console/sites/1" is site id 1.
- API Authentication
- All API requests require either an API Key (Public) or a Service Account Key (Private) that can be generated in the LeagueApps Console, Side Menu -> Connect -> API Access. A Service Account Client ID can also be used as an API Key for accessing the Public endpoints without requiring 2 keys.
- debug-json HTTP parameter
- By default, JSON responses do not include null fields or whitespace. The debug-json parameter will cause all fields to be returned and pretty print the JSON.
- Request Quotas
- Clients can make a limited number of requests per minute. When quotas are reached,endpoints will return an HTTP status 429 "Too Many Requests". Clients should retry requests using truncated exponential backoff.
- Date Format
- Dates and Timestamps are formatted as milliseconds since Janurary 1, 1970.
Private API
- Base URL
- https://admin.leagueapps.io
- General endpoint format
- https://admin.leagueapps.io/v2/sites/{site-id}/...
- OAuth 2 Token URL
- https://auth.leagueapps.io/v2/auth/token
The Private API provides a way to export registrations, transactions, and members. This API is intended for integrations that need to access private or sensitive data that should not be publicly accessible.
OAuth 2 with JSON Web Tokens (JWT) is used for authorization. There are many OAuth 2 libraries for all programming languages. jwt.io lists libraries for most programming languages for creating JWTs and also a web-based tool to view JWTs for debugging. The example code directly uses a JWT python library.
General Steps
- LeagueApps Admin: Generate a Service Account Key within LeagueApps Console
- Generate a JWT assertion using the Service Account Key
- Post the JWT to get an Access Token
- Pass the Access Token to API requests as a Bearer Authorization header
- When the Access Token expires, repeat the process to get a new token
Generate a Service Account Key
- On the LeagueApps Console Menu, navigate to Connect -> API Access
- Enter a Name and click "Generate Service Account". This should automatically download a PKCS12 file with a filename of <client-id>.p12 with a default password of "notasecret".
- (optional) Depending on programming language, the key may need to be converted to the PEM or other format. On
Mac OS or Linux on the command line:
openssl pkcs12 -nodes -in <client-id>.p12 -out <client-id>.pem
- (optional) Depending on security requirements, the PKCS12 default password should be changed using openssl or another tool that can modify PKCS12 files.
Export Overview
The Private API is primarily used for periodically exporting large amounts of data. A typical usage example is hourly syncing to a client system with new data since the last request. These endpoints are not recommended for interactive or real-time systems.
As of February 2019, version of 2 of the export endpoints (registrations-2, members-2, and transactions-2) now return a limited number of results per request and require the last-updated and last-id parameters. Existing /export/registrations, /export/members, and /export/transactions endpoints are deprecated and will be removed in the future.
The last-updated and last-id request parameters should be set to 0 for the first request.
The last-updated and last-id request parameters should be updated after each response to the lastUpdated and id values in the last record received. To get full results, requests should be made until 0 records are returned.
Python Export Example
Download sample codePrivate Endpoints
Export Registrations
End Point | https://admin.leagueapps.io/v2/sites/{SITE-ID}/export/registrations-2 |
Description | Returns a list of registrants, with basic member information, parent information, invoice details, program data, and custom registration form fields. Intended to pull large exports of registration records. |
Parameters | last-updated (required) Epoch last-id (required) Integer includeDeleted (optional) Boolean program-id (optional) Integer |
Results (JSON) |
|
Export Members
End Point | https://admin.leagueapps.io/v2/sites/{SITE-ID}/export/members-2 |
Description | Returns a list of members on the site including basic member information, custom member profile fields, and family/group information.Intended to pull large exports of member records. |
Parameters | last-updated (required) Epoch last-id (required) Integer includeDeleted (optional) Boolean |
Results (JSON) |
|
Member Detail
End Point | https://admin.leagueapps.io/v2/sites/{SITE-ID}/members/{USER-ID} |
Description | Returns the full profile detail for a single site members. |
Parameters | userId (required) Integer |
Results (JSON) |
|
Export Transactions
End Point | https://admin.leagueapps.io/v2/sites/{SITE-ID}/export/transactions-2 |
Description | Returns transaction details along with user, payments, and basic registration detail. Intended to pull large exports of transaction records. The id field is a non-unique transaction id. A transaction id can have multiple items within the same transaction. The transactionItemId will be unique over all transactions and items. For example, a user that paid for a program registration and an additional hat product at the same time would have 2 records with the same id and different transactionItemId values. Results limited by batch size will not split transaction items. All transaction items with the same id will be returned in a single response. |
Parameters | last-updated (required) Epoch last-id (required) Integer |
Results (JSON) |
|
Public API
https://public.leagueapps.io
The Public API provides access to a full suite of publicly accessible content and functionality for a specific site. This includes information that is typically displayed on public facing websites, such as program listings, teams, and schedules. This API is intended for integrations that need programmatic access to public content (e.g., schedules) in order to create custom apps, pages, content, and tools.Access Requirements
Public content is accessed using a simple key based approach, and supports lightweight client implementations such as Javascript-based fetching of content for inclusion into external websites or apps. The Public API is structured as REST endpoints which return results in JSON format. Every request must include a valid API Key in order to be granted access. Calls to endpoints are made as HTTP GET requests, and the API key is included in the header as ‘la-api-key’. The following illustrates the operation of the API via an example of a request to fetch a list of programs for a given site: Endpoint URL: https://public.leagueapps.io/v1/sites/{SITE_ID}/programs/current Replace {SITE_ID} with your Site’s unique ID. This can be found in the URL of your site when you are logged into the console (https://manager.leagueapps.com/console/sites/{SITE_ID}). The API Key is added into the header of the GET request as: la-api-key: {API_KEY} {API_KEY} is replaced with your provided API Key. Follow these steps to generate access to the Public API:- Login to LeagueApps, click ‘Connect’ on the side navigation bar, then click ‘API’
- Click ‘Generate API Key’
- Copy the generated API Key
Public Endpoints
Site Info
End Point | https://public.leagueapps.io/v1/sites/{SITE-ID} |
Description | Returns basic information about the site. It includes the hex code for color selections made in the theme editor for the site. This can be useful if you want to style your client implementation with the same colors as used on your LA powered site. |
Results (JSON) |
|
Sports
End Point | https://public.leagueapps.io/v1/sites/{SITE-ID}/sports |
Description | Returns the list of sports which have live or upcoming programs for this site. |
Results (JSON) |
|
Announcements
End Point | https://public.leagueapps.io/v1/sites/{SITE-ID}/announcements |
Description | Returns a reverse chronological list of posted site announcements |
Results (JSON) |
|
Programs - Current List
End Point | https://public.leagueapps.io/v1/sites/{SITE-ID}/programs/current |
Description | Returns a list of all programs which are have a state of either LIVE or UPCOMING. For each program, the several relevant details are included. |
Results (JSON) |
|
Programs - Individual Program Detail
End Point | https://public.leagueapps.io/v1/sites/{SITE-ID}/programs/{PROGRAM-ID} |
Description | Returns the full details and description for one particular program, based on {PROGRAM_ID}. |
Results (JSON) |
|
Program Schedule
End Point | https://public.leagueapps.io/v1/sites/{SITE-ID}/programs/{PROGRAM-ID}/schedule |
Description | Returns the full schedule for a given program, as specified by {PROGRAM_ID}. The results include both games (with their corresponding details) as well as “date notes”. |
Results (JSON) |
|
Program Teams
End Point | https://public.leagueapps.io/v1/sites/{SITE-ID}/programs/{PROGRAM-ID}/teams |
Description | Returns a list of teams for a given program, as specified by {PROGRAM_ID}. |
Results (JSON) |
|
Locations - List
End Point | https://public.leagueapps.io/v1/sites/{SITE-ID}/locations |
Description | Returns a list of locations for a given site, with pertinent info on each. |
Results (JSON) |
|
Locations - Individual Location Detail
End Point | https://public.leagueapps.io/v1/sites/{SITE-ID}/locations/{LOCATION-ID} |
Description | Returns full detail for a single location. |
Results (JSON) |
|
Blog - List of Posts
End Point | https://public.leagueapps.io/v1/sites/{SITE-ID}/blog |
Description | Returns a reverse chronological list of blog posts. |
Results (JSON) |
|