Api Documentation

Getting Started

The SwimClub Manager API allows you to create appications that can read/update information in your SCM account.

Each request to the Api must be authenticated with your Api token using an "Authorization-Token" header containing your token.

For Example:

                        POST https://www.swimclubmanager.co.uk/api/Users
                        Authorization-Token: 6846a9d9eadc4c8bbeae5a1b672309d1
                        Content-Type: application/json
                        {
                            "Firstname": "Joseph",
                            "Lastname": "Bloggs",
                            "KnownAs": "Jo",
                            ...
                        }
                    

When using the authentication token you do not require any additional password.

Important

You must treat your Api token as you would treat your login password. Anyone that has your Api token can post to the Api on your behalf! If you suspect someone has your Api token you can reset it via the "Setup > Club > Club Details" page link.

For POST requests, a content-type header of application/json must be included and the body of the request should be valid json in the same format as what is returned in a GET request.

GET requests are returned in pages of 100. Add a request header or querystring value of "Page = x" to request any page other than the first.

The number of API calls in a 24 hour period is limited to 5000. You can check your current rate limit status by looking at the "X-Ratelimit-Remaining" HTTP header which is returned in response to every API request.


Club Events

Overview
URL https://www.swimclubmanager.co.uk/api/ClubEvents
Methods Supported POST, GET
Description Allows you to create or get club events in an SCM account
Elements For Club Events
Guid The club event unique id in the system (read only)
EventTitle required The title of the event (max length = 50)
EventDetails The details of the event (optional max length = 4000)
EventStartDate required The start date of the event (yyyy-mm-dd format)
EventStartTime required The start time of the event (24hr format)
EventEndDate required The end date of the event (yyyy-mm-dd format)
EventEndTime required The end time of the event (24hr format)
BusProvided Is a bus provided? (1 or 0)
BusSeats How many seats on the bus? (number)
BusDepartureDate The departure date of the bus (optional yyyy-mm-dd format)
BusDepartureTime The departure time of the bus (optional 24hr format)
CalendarColour The colour of the event on the club calendar (0, B, G, O, R, Y, Pu, Gr, Pi, N, T)
EventVenue The venue of the event (optional max length = 50)
Address1 The address line 1 of the event (optional max length = 50)
Address2 The address line 2 of the event (optional max length = 50)
Address3 The address line 3 of the event (optional max length = 50)
Address4 The address line 4 of the event (optional max length = 50)
Postcode The postcode of the event (optional max length = 50)
Fee The fee per event for swimmers (optional decimal)
RelayFee The fee per relay event for swimmers (optional decimal)
Pool The pool size optional (20m, 25m, 33m, 50m, OW)
AgeOnDate The age on date for the event (optional yyyy-mm-dd format)
MeetCode The meet code for the event (optional max length = 50)
SessionNumber The session number of the event (optional max length = 50)
LicenceNumber The licence number of the event (optional max length = 50)
EntryCloseDate The closing date for entries (optional yyyy-mm-dd format)
SwimTimes Any associated swim times for the event (read only)
GET Club Event

To get a Club Event, use the following URL where {guid} is the Guid of the Club Event:

                        GET https://www.swimclubmanager.co.uk/api/ClubEvents/{guid}
                    
Data Returned

When you GET a Club Event, the following JSON will be returned:

                            {
                                "Guid": "f6e21c87-1581-4aa6-a15a-791874b1eddf",
                                "EventTitle": "Club champs",
                                "EventDetails": "",
                                "EventStartDate": "2016-05-14",
                                "EventStartTime": "09:00",
                                "EventEndDate": "2016-05-14",
                                "EventEndTime": "19:00",
                                "SwimTimes": [
                                    {
                                        "Time": "00:28.65",
                                        "Distance": "50m",
                                        ...
                                    },
                                    ...
                                ]
                                ...
                            }
                    

When you POST a new Club Event, the api will return a JSON object with the Club Event's details.


Committee Members

Overview
URL https://www.swimclubmanager.co.uk/api/CommitteeMembers
Methods Supported GET
Description Allows you to get committee members in an SCM account

The "CommitteeMembers" GET method lists the same fields as the "Users" GET method


Trial Requests

Overview
URL https://www.swimclubmanager.co.uk/api/TrialRequests
Methods Supported POST, GET
Description Allows you to create or get trial requests in an SCM account
Elements For Trial Requests
Guid The trial request unique id in the system (read only)
DateAdded The date the trial request was added (yyyy-mm-dd format)
FirstName required The first name of the trial requester (max length = 50)
LastName required The last name of the trial requester (max length = 50)
Dob required The date of birth of the trial requester (yyyy-mm-dd format)
Gender The trial requester's gender (M or F)
Email The trial requester's email address (max length = 50)
SwimmingExperience The swimming experience of the trial requester (max length = 4000)
GET Trial Request

To get a Trial Request, use the following URL where {guid} is the Guid of the Trial Request:

                        GET https://www.swimclubmanager.co.uk/api/TrialRequests/{guid}
                    
Data Returned

When you GET a Trial Request, the following JSON will be returned:

                            {
                                "Guid": "f6e21c87-1581-4aa6-a15a-791874b1eddf",
                                "Firstname": "Jo",
                                "Lastname": "Bloggs",
                                "Dob": "1999-06-12",
                                "Email": "email@domain.com",
                                ...
                            }
                    

When you POST a new Trial Request, the api will return a JSON object with the Trial Request's details.


Users

Overview
URL https://www.swimclubmanager.co.uk/api/Users
Methods Supported POST, GET
Description Allows you to create or get users in an SCM account
Elements For Users
Guid The user's unique id in the system (read only)
Firstname required The first name of the user (max length = 50)
KnownAs The name the user is known as if different from Firstname (max length = 50)
Lastname required The last name of the user (max length = 50)
Dob The user's date of birth (yyyy-mm-dd format)
Gender The user's gender (M or F)
Address1 The user's address 1 (max length = 50)
Address2 The user's address 2(max length = 50)
Address3 The user's address 3 (max length = 50)
Address4 The user's address 4 (max length = 50)
Address5 The user's address 5 (max length = 50)
Postcode The user's postcode (max length = 50)
HomePhone The user's home phone number (max length = 50)
MobilePhone The user's mobile phone number (max length = 50)
DateJoinedClub The date the user joined your club (yyyy-mm-dd format)
Email The user's email address (max length = 50)
Username The user's login username (max length = 50)
Password The user's login password (max length = 50)
Active The user's active status (1 or 0)
InWhosWho If the user is in the who's who (1 or 0)
JobTitle The user's job title at the club (max length = 50)
CommitteeMember If the user is on the committee (1 or 0)
IsACoach If the user is a coach (1 or 0)
IsASwimmer If the user is a swimmer (1 or 0)
IsAParent If the user is a parent (1 or 0)
AsaNumber The user's asa number (max length = 50)
AsaCategory The user's asa category (max length = 50)
InvoiceDiscountPercent The user's invoice discount if applicable number to 2 decimal places
GET User

To get a User, use the following URL where {guid} is the Guid of the User:

                        GET https://www.swimclubmanager.co.uk/api/Users/{guid}
                    
Data Returned

When you GET a User, the following JSON will be returned:

                        {
                            "Guid": "85525b05-ef52-4997-9f50-6ed0539d37b0",
                            "Firstname": "Lakesha",
                            "Lastname": "Wilson",
                            "KnownAs": "",
                            "Dob": "2002-12-03",
                            "Gender": "F",
                            "Address1": "2 Scotsburn Rd",
                            "Address2": "",
                            "Address3": "",
                            "Address4": "",
                            "Address5": "TALERDDIG",
                            "Postcode": "SY19 8FF",
                            ...                         
                        }
                    

When you POST a new User, the api will return a JSON object with the User's details. The password field will always be blank.


Whos Who

Overview
URL https://www.swimclubmanager.co.uk/api/WhosWho
Methods Supported GET
Description Allows you to get whos who in an SCM account

The "WhosWho" GET method lists the same fields as the "Users" GET method


Error Codes

Code Explanation
400 Bad request - something is wrong with your data i.e. missing required fields etc
401 Unauthorized - invalid authorization token
403 Forbidden - you have made too many api requests in the current 24 hour period
404 Not Found - you supplied an incorrect object id
500 Internal Server Error - something has gone wrong on our side

A message detailing the exact error will also be sent along with the error code above