LeagueApps API Documentation

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

  1. LeagueApps Admin: Generate a Service Account Key within LeagueApps Console
  2. Generate a JWT assertion using the Service Account Key
  3. Post the JWT to get an Access Token
  4. Pass the Access Token to API requests as a Bearer Authorization header
  5. When the Access Token expires, repeat the process to get a new token

Generate a Service Account Key

  1. On the LeagueApps Console Menu, navigate to Connect -> API Access
  2. 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".
  3. (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
  4. (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 code

Private 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)
[{
      	"registrationId": 3396235,
      	"registrationStatus": "SPOT_RESERVED",
      	"siteName": "LeagueApps Academy",
      	"lastUpdated": 1469216630000,
      	"created": 1469216627000,
      	"userId": 946336,
      	"firstName": "Robbie",
      	"lastName": "Smith",
      	"userType": "CHILD",
      	"birthDate": 916117200000,
      	"gender": "Male",
      	"zipCode": "11215",
        "groupName": "Smith Family",
      	"groupId": 18890,
      	"parentUserId": 2465341,
      	"parentFirstName": "Bob",
      	"parentLastName": "Smith",
      	"parentEmail": "bob.smith@gmail.com",
      	"parentPhone": "+12125551212",
      	"paymentStatus": "PAID",
      	"invoiceId": 2714068,
      	"totalAmountDue": 80.0,
      	"outstandingBalance": 0.0,
      	"amountPaid": 80.0,
      	"price": 75.0,
      	"programId": 65959,
      	"programType": "CAMP",
      	"programName": "Summer Camp",
      	"programCode": "code001",
      	"programState": "UPCOMING",
      	"programStartDate" : 1446350400000,
      	"sportId": 2,
      	"sport": "Basketball",
        "teamId": "554518",
        "team": "Marlins",
      	"waiverAcceptedTimestamp": 1469216627000,
        "role": "FREEAGENT",
      	"Position": "Forward",
      	"Special Requests": "None"
      }]

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)
[{
	"userId": 946335,
	"firstName": "Bob",
	"lastName": "Smith",
	"email": "bob.smith@gmail.com",
	"mobilePhone": "+12125551212",
	"type": "ADULT",
	"username": "bsmith",
	"orgAccountRole": "UNAUTHORIZED",
	"lastLogin": 1407953042000,
	"lastUpdated": 1407953042000,
	"newsletterOptIn": false,
	"dateJoined": 1407953042000,
	"gender": "Male",
	"birthDate": 917067600000,
	"groupId": 18890,
	"groupName": "Smith Family",
	"address1": "123 Main Street",
	"city": "Brooklyn",
	"state": "NY",
	"zipCode": "11215"
}, {
	"userId": 946336,
	"firstName": "Robbie",
	"lastName": "Smith",
	"type": "CHILD",
	"username": "kidt79",
	"orgAccountRole": "UNAUTHORIZED",
	"lastUpdated": 1411661003000,
	"newsletterOptIn": true,
	"dateJoined": 1411661003000,
	"gender": "Male",
	"birthDate": 1073883600000,
	"groupId": 18890,
	"groupName": "Smith Family",
	"address1": "123 Main Street",
	"city": "Brooklyn",
	"state": "NY",
	"zipCode": "11215",
	"School": "Bayside High School",
	"Graduation Year": "2020"
}]

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)
[{
        "userId": 2668506,
        "deleted": "False",
      	"userProfileId": 2666787,
      	"dateJoined": 1476381602000,
      	"lastUpdated": 1527889693000,
      	"lastLogin": 1527889693000,
      	"type": "ADULT",
      	"orgAccountRole": "UNAUTHORIZED",
        "groupId": 640935,
        "email": "test@leagueapps.com",
        "newsletterOptIn": True,
        "membershipExpiration": "None",
      	"firstName": "Robbie",
      	"lastName": "Smith",
      	"birthDate": 916117200000,
      	"gender": "Male",
        "address1": "100 Main St",
        "address2": "2nd floor",
        "city": "New York",
        "state": "NY",
        "country": "None",
      	"zipCode": "11215",
      }]

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)
[{
    "siteId": 1,
    "id": 1234 non-unique,
    "lastUpdated": 1469216630000,
    "transactionItemId": 5435 unique,
    "type": "CHARGE",
    "gateway": "Stripe",
    "amount": 45.00,
    "netAmount": 40.00,
    "userId": 2,
    "firstName": "Stanley",
    "lastName": "Jackson",
    "programId": 13929,
    "programName": "Intermediate Soccer Program",
    "programType": "LEAGUE",
    "programCode": "code001",
    "masterProgramId": null,
    "masterProgramName": null,
    "masterProgramType": null,
    "masterProgramCode": null,
    "productId": null,
    "productName": null,
    "accountingCode1":"AC1",
    "accountingCode2":"AC2"
}]

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:
  1. Login to LeagueApps, click ‘Connect’ on the side navigation bar, then click ‘API’

  2. Click ‘Generate API Key’

  3. Copy the generated API Key
TIP: If you’ve already created a Service Account for the Private API, you can use the Client ID provided by that step as the Public API Key for the Public API.

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)
[
  {
      "id": "1482",
      "name": "My Site Name",
      "subdomain": "mysite",
      "domain": null,
      "url": "//mysite.leagueapps.com//",
      "logoUrl": null,
      "theme": {
          "colors": {
              "alerts": "#ffffdd",
              "alternateText": "#aaaaaa",
              "bodyText": "#484848",
              "buttonBackground": "#2d6cbe",
              "buttonBackgroundHover": "#1d4483",
              "buttonText": "#ffffff",
              "buttonTextHover": "#ffffff",
              "contentBackground": "#ffffff",
              "headerBackground": "#333333",
              "headings": "#484848",
              "links": "#2d6cbe",
              "linksHover": "#1d4483",
              "logo": "#ffffff",
              "mainNavBackground": "#212121",
              "mainNavLinks": "#bbbbbb",
              "mainNavLinksHover": "#ffffff",
              "pageBackground": "#6f727a",
              "sidebarBackground": "#f6f6f6",
              "widgetBackground": ""
          }
      }
  }
]

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)
[
    {
        "sportId": 11,
        "name": "Lacrosse",
        "leagueCount": 2,
        "leaguesUrlHtml": "//api.leagueapps.com//leagues/lacrosse"
    }
]

Announcements

End Point https://public.leagueapps.io/v1/sites/{SITE-ID}/announcements
Description Returns a reverse chronological list of posted site announcements
Results (JSON)
[
    {
        "announcementId": 401049,
        "userId": 2,
        "username": "steve",
        "userFirstName": "Steve",
        "userLastName": "McQueen",
        "admin": true,
        "createdTime": 1435251085000,
        "message": "Just a reminder to everyone that there are just 2 days until tryouts!",
        "userUrlHtml": "//api.leagueapps.com//members/steve",
        "userIconUrl": "https://svite-league-apps-img.s3.amazonaws.com/profile-0-s1.jpg"
    },
    {
        "announcementId": 401048,
        "userId": 2,
        "username": "steve",
        "userFirstName": "Steve",
        "userLastName": "McQueen",
        "admin": true,
        "createdTime": 1435251060000,
        "message": "Lacrosse tryouts are coming up in 2 weeks.  Registerbefore spots fill up!",
        "userUrlHtml": "//api.leagueapps.com//members/steve",
        "userIconUrl": "https://svite-league-apps-img.s3.amazonaws.com/profile-0-s1.jpg"
    }
]

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)
[
    {
        "programId": 59621,
        "name": "Intermediate Lacrosse Program 1",
        "state": "UPCOMING",
        "type": "LEAGUE",
        "description": "",
        "startTime": 1496289600000,
        "tentativeStartTime": false,
        "publicRegstrationTime": 1433131200000,
        "gender": "CO_ED",
        "mode": "MIXED",
        "sponsor": "Under Armour",
        "freeAgentLabel": "Free Agent",
        "teamLabel": "Team",
        "captainLabel": "Captain",
        "divisionLabel": "Division",
        "processingFeeLabel": "Processing Fee",
        "additionalTeamFeeLabel": "Additional Team Fee",
        "sportId": 11,
        "sport": "Lacrosse",
        "season": "Summer",
        "experienceLevel": "Intermediate",
        "leagueFormat": "",
        "code": "code001",
        "feeRequired": true,
        "regularRegistrationTime": 1433131200000,
        "teamIndividualFee": 100,
        "freeAgentFee": 100,
        "chargeProcessingFee": false,
        "usingVariableTeamFee": true,
        "chargeMembershipFee": false,
        "hasPaymentPlans": false,
        "ageLimitEffectiveDate": 1496289600000,
        "maxFreeAgentsCount": 20,
        "maxPlayersCount": 100,
        "hasWaitlist": true,
        "programUrlHtml": "//api.leagueapps.com//leagues/lacrosse/59621-intermediate-lacrosse-program-1",
        "registerUrlHtml": "//api.leagueapps.com//registration/init?bid=59621",
        "scheduleUrlHtml": "//api.leagueapps.com//leagues/59621/schedule",
        "standingsUrlHtml": "//api.leagueapps.com//leagues/59621/standings",
        "programLogo150": "//svite-league-apps-img.s3.amazonaws.com/program-54787-s3.jpg"
    }
]

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)
[
  {
      "programId": 59621,
      "name": "Intermediate Lacrosse Program 1",
      "state": "UPCOMING",
      "type": "LEAGUE",
      "description": "",
      "startTime": 1496289600000,
      "tentativeStartTime": false,
      "publicRegstrationTime": 1433131200000,
      "gender": "CO_ED",
      "mode": "MIXED",
      "sponsor": "Under Armour",
      "freeAgentLabel": "Free Agent",
      "teamLabel": "Team",
      "captainLabel": "Captain",
      "divisionLabel": "Division",
      "processingFeeLabel": "Processing Fee",
      "additionalTeamFeeLabel": "Additional Team Fee",
      "sportId": 11,
      "sport": "Lacrosse",
      "season": "Summer",
      "experienceLevel": "Intermediate",
      "leagueFormat": "",
      "feeRequired": true,
      "regularRegistrationTime": 1433131200000,
      "teamIndividualFee": 100,
      "freeAgentFee": 100,
      "chargeProcessingFee": false,
      "usingVariableTeamFee": true,
      "chargeMembershipFee": false,
      "hasPaymentPlans": false,
      "ageLimitEffectiveDate": 1496289600000,
      "maxFreeAgentsCount": 20,
      "maxPlayersCount": 100,
      "hasWaitlist": true,
      "programUrlHtml": "//api.leagueapps.com//leagues/lacrosse/59621-intermediate-lacrosse-program-1",
      "registerUrlHtml": "//api.leagueapps.com//registration/init?bid=59621",
      "scheduleUrlHtml": "//api.leagueapps.com//leagues/59621/schedule",
      "standingsUrlHtml": "//api.leagueapps.com//leagues/59621/standings",
      "programLogo150": "//svite-league-apps-img.s3.amazonaws.com/program-54787-s3.jpg"
  }
]  

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)
"games": [
    {
      "scheduleItemType": "EVENT",
      "eventId": 334398,
      "teamId": 1075848,
      "teamName": "U14 Blizards",
      "type": "Practice",
      "title": "Tuesday Practive",
      "startDate": 1511301600000,
      "endDate": 1511307000000,
      "description": "Strength and Conditioning Practice",
      "location": "Downtown Ice Rink",
      "locationLabel": "",
      "allowEdit": false
    },
    {
      "scheduleItemType": "EVENT",
      "eventId": 334401,
      "teamId": 1075848,
      "teamName": "U14 Blizards",
      "type": "Practice",
      "title": "Tuesday Practive",
      "startDate": 1511906400000,
      "endDate": 1511911800000,
      "description": "Strength and Conditioning Practice",
      "location": "Downtown Ice Rink",
      "locationLabel": "",
      "allowEdit": false
    },
    {
      "scheduleItemType": "STRUCTURED_GAME",
      "gameId": 4626927,
      "type": "SCHEDULED",
      "typeLabel": "Regular Season",
      "state": "SCHEDULED",
      "stateLabel": "Scheduled",
      "startTime": 1512838800000,
      "team1Id": 1075848,
      "team1": "U14 Blizards",
      "team1Seed": null,
      "team1Score": null,
      "team1Result": null,
      "team2Id": 305051,
      "team2": "Hurricanes",
      "team2Seed": null,
      "team2Score": null,
      "team2Result": null,
      "locationId": 10649,
      "locationName": "Downtown Ice Rink",
      "subLocationId": null,
      "subLocationName": null,
      "latitude": null,
      "longitude": null,
      "round": null,
      "notes": null
    },
    {
      "scheduleItemType": "STRUCTURED_GAME",
      "gameId": 4626930,
      "type": "SCHEDULED",
      "typeLabel": "Regular Season",
      "state": "SCHEDULED",
      "stateLabel": "Scheduled",
      "startTime": 1513443600000,
      "team1Id": 1075848,
      "team1": "U14 Blizards",
      "team1Seed": null,
      "team1Score": null,
      "team1Result": null,
      "team2Id": 305052,
      "team2": "Thunder",
      "team2Seed": null,
      "team2Score": null,
      "team2Result": null,
      "locationId": 10649,"locationName": "Downtown Ice Rink",
      "subLocationId": null,
      "subLocationName": null,
      "latitude": null,
      "longitude": null,
      "round": null,
      "notes": null
    }
  ],
  "notes": [

{
              "noteId": 22023,
              "startTime": 1437192000000,
              "color": "date-note-type0",
              "message": "This is a \"date note\" on the schedule"
          }

  ]
}

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)
[{
    "teamName": "Wildcats",
    "teamId": 20939,
    "division": "Legends",
    "teamStatus": "COMPLETE",
    "teamProfileURL": "//api.leagueapps.com//leagues/1337/teams/311244",
    "dateCreated": 1447839864000
}, {
    "teamName": "Pumas",
    "teamId": 20938,
    "division": "Leaders",
    "teamStatus": "COMPLETE",
    "teamProfileURL": "//api.leagueapps.com//leagues/1337/teams/311245",
    "dateCreated": 1447839872000
}]

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)
[
  {
    "locationId": 10649,
    "name": "Downtown Field House",
    "description": "Description goes here!",
    "address1": "1400 Key Blvd",
    "address2": "",
    "city": "Arlington ",
    "state": "Va",
    "zipCode": "22209",
    "country": "",
    "sublocations": [
      {
        "name": "Field 1",
        "description": "Field One"
      },
      {
        "name": "Field 2",
        "description": "Field Two"
      }
    ]
  },
  {
    "locationId": 10650,
    "name": "Uptown Field House",
    "description": "<html />",
    "address1": "2500 Wilson Blvd",
    "address2": "",
    "city": "Arlington",
    "state": "Va",
    "zipCode": "22201",
    "country": null,
    "sublocations": []
  }
]

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)
[
  {
    "locationId": 10649,
    "name": "Downtown Ice Rink",
    "description": "Description goes here!",
    "address1": "1400 Key Blvd",
    "address2": "",
    "city": "Arlington ",
    "state": "Va",
    "zipCode": "22209",
    "country": "",
    "sublocations": [
      {
        "name": "Field 1",
        "description": "Field One"
      },
      {
        "name": "Field 2",
        "description": "Field Two"
      }
    ]
  }
]

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)
 {
    "blogId": 230343,
    "title": "Second Blog",
    "summary": "This is a mini description",
    "urlHtml": "//youth-baseball.leagueapps.com/blog/second",
    "createdOn": 1488580523000,
    "lastUpdated": 1488580523000,
    "featured": true,
    "imageUrl": "https://svite-league-apps-img.s3.amazonaws.com/page-a284dce1-b9a9-4fce-9b79-4a62b573e67f-s2.jpg",
    "halfImageUrl": "https://svite-league-apps-img.s3.amazonaws.com/page-a284dce1-b9a9-4fce-9b79-4a62b573e67f-s1.jpg"
  },
  {
    "blogId": 230340,
    "title": "First Blog",
    "summary": "This is a summary that shows up",
    "urlHtml": "//youth-baseball.leagueapps.com/blog/first",
    "createdOn": 1488580424000,
    "lastUpdated": 1488580424000,
    "featured": true,
    "imageUrl": "https://svite-league-apps-img.s3.amazonaws.com/page-56157463-96fc-45f8-aeb9-eca325caab82-s2.jpg",
    "halfImageUrl": "https://svite-league-apps-img.s3.amazonaws.com/page-56157463-96fc-45f8-aeb9-eca325caab82-s1.jpg"
  }
]