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 username and 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.


IncidentBook

Overview
URL https://www.swimclubmanager.co.uk/api/IncidentBook
Methods Supported POST, GET
Description Allows you to create or get incidents in an SCM account
Elements For Incidents
Guid The incident unique id in the system (read only)
IncidentTitle required The title of the incident (max length = 50)
IncidentDate required The date of the incident (yyyy-mm-dd format)
IncidentDetails The details of the incident (optional max length = 4000)
ProposedAction The proposed action for the incident (optional max length = 4000)
Status required The status of the incident (Open, In Progress, On Hold, Closed)
AddedBy required The member that added the incident
Comments Any comments made to the incident (read only)
GET Incident

To get an Incident, use the following URL where {guid} is the Guid of the Incident:

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

When you GET an Incident, the following JSON will be returned:

                            {
                                "Guid": "f6e21c87-1581-4aa6-a15a-791874b1eddf",
                                "IncidentTitle": "Banged head on pool wall",
                                "IncidentDate": "2016-05-14",
                                "IncidentDetails": "...",
                                "ProposedAction": "...",
                                "Status": "Closed",
                                "AddedBy": [
                                    {
                                        "Guid": "46C33DEC-3D26-4151-A8CE-38B152DE2A16",
                                        "Firstname": "Joseph",
                                        "KnownAs": "Jo",
                                        "Lastname": "Bloggs"
                                    }
                                ],
                                "Comments": [
                                    {
                                        "DateAdded": "2016-05-14",
                                        "Comment": "Sent email",
                                        "Firstname": "Joseph",
                                        "KnownAs": "Jo",
                                        "Lastname": "Bloggs"
                                    },
                                    ...
                                ]
                                ...
                            }
                    

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


Meets

Overview
URL https://www.swimclubmanager.co.uk/api/Meets
Methods Supported GET
Description Allows you to get meets in an SCM account
Elements For Meets
Guid The meet unique id in the system (read only)
MeetName The name of the meet (max length = 50)
Facility The location of the meet (optional max length = 50)
Type The type of meet (Open Meet, Team Gala, Club Champs, Turn Up and Swim)
StartDate The start date of the meet (yyyy-mm-dd format)
EndDate The end date of the meet (yyyy-mm-dd format)
AgeUpDate The age up date of the meet (yyyy-mm-dd format)
EligibilityDate The eligibility date of the meet (yyyy-mm-dd format)
EntryOpenDate The entry open date of the meet (yyyy-mm-dd format)
EntryDeadline The entry deadline date of the meet (yyyy-mm-dd format)
Street The street address of the meet (optional max length = 50)
Address2 The address line 2 of the meet (optional max length = 50)
City The city of the meet (optional max length = 50)
County The county of the meet (optional max length = 50)
PostCode The post code of the meet (optional max length = 50)
Country The country of the meet (optional max length = 50)
SwimTimesAdded Swim times have been added (optional 1 or 0)
SwimTimesVerified Swim times have been verified (optional 1 or 0)
SwimTimes Any associated swim times for the meet (read only)
GET Meet

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

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

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

                            {
                                "Guid": "f6e21c87-1581-4aa6-a15a-791874b1eddf",
                                "MeetName": "Droitwich Champs",
                                "Facility": "Leisure Centre",
                                "Type": "Open Meet",
                                "StartDate": "2016-05-14",
                                "EndDate": "2016-05-14",
                                ...
                                "SwimTimes": [
                                    {
                                        "Time": "00:28.65",
                                        "Distance": "50m",
                                        ...
                                    },
                                    ...
                                ]
                                ...
                            }
                    

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, PUT
Description Allows you to create (POST), get (GET) or update (PUT) users in an SCM account
Elements For Users
Guid The user's unique id in the system (read only)
MemberID The member ID of the user (max length = 50)
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)
PrimaryContactName The primary contact for the user (max length = 50)
RelationshipToMember The relationship to the user (max length = 50)
HomePhone The user's home phone number (max length = 50)
MobilePhone The user's mobile phone number (max length = 50)
Email The user's email address (max length = 50)
DOB The user's date of birth (yyyy-mm-dd format)
Gender The user's gender (M or F)
Ethnicity The user's ethnicity Use ASA Ethnicity codes
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)
Town The user's town (max length = 50)
County The user's county (max length = 50)
Postcode The user's postcode (max length = 50)
EmergencyContactPerson1 The user's emergency contact person 1 (max length = 50)
EmergencyContactPhone1 The user's emergency contact phone 1 (max length = 50)
EmergencyContactPerson2 The user's emergency contact person 2 (max length = 50)
EmergencyContactPhone2 The user's emergency contact phone 2 (max length = 50)
DetailsConfirmedCorrect The date the user confirmed their details were correct (yyyy-mm-dd format)
Active The user's active status (1 or 0)
DateJoinedClub The date the user joined your club (yyyy-mm-dd format)
AsaNumber The user's asa number (max length = 50)
AsaCategory The user's asa category (max length = 50)
CountryOfRepresentation The user's country of representation (max length = 50)
IsASwimmer If the user is a swimmer (1 or 0)
IsAVolunteer If the user is a volunteer (1 or 0)
IsACoach If the user is a coach (1 or 0)
IsAParent If the user is a parent (1 or 0)
CommitteeMember If the user is on the committee (1 or 0)
JobTitle The user's job title at the club (max length = 50)
CompetitiveDivingPassed The date the user passed competitive diving (yyyy-mm-dd format)
SwimsForOtherClub The name of another club the user swims for (max length = 100)
AgreeCodeOfConduct If the user has agreed to the club's code of conduct (1 or 0)
LocoParentisRights The date loco parentis rights were given (yyyy-mm-dd format)
ConsentToTravel The date consent to travel was given (yyyy-mm-dd format)
ConsentImageUse The date consent to image use was given (yyyy-mm-dd format)
ConsentVideoUse The date consent to video use was given (yyyy-mm-dd format)
SchoolAttended The school the user attended (max length = 50)
LastClubDisclaimerAcknowledged The date the user last acknowledged a club disclaimer (yyyy-mm-dd format)
DateLeft The date the user left the club (yyyy-mm-dd format)
Notes Any notes pertaining to the user (max length = 4000)
MedicalHistory Any medical history pertaining to the user (max length = 4000)
Allergies Any allergies the user has (max length = 4000)
DisabilityDetails Any disabilities the user has (max length = 4000)
Doctor The user's doctor (max length = 50)
DoctorAddress The user's doctor's address (max length = 50)
DoctorPhone The user's doctor's phone number (max length = 50)
DBSDate The user's DBS date (yyyy-mm-dd format)
DBSRenewalDate The user's DBS renewal date (yyyy-mm-dd format)
DBSCertificateNumber The user's DBS certificate number (max length = 50)
SafeguardingDate The user's Safeguarding date (yyyy-mm-dd format)
SafeguardingRenewalDate The user's Safeguarding renewal date (yyyy-mm-dd format)
Username The user's login username (max length = 50)
Password The user's login password (max length = 50)
LastLoggedIn The date the user last logged in (yyyy-mm-dd format - Read Only)
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": "",
                            "Toen": "",
                            "City": "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.


Waiting List

Overview
URL https://www.swimclubmanager.co.uk/api/WaitingList
Methods Supported POST, GET
Description Allows you to get (GET), create (POST) waiting list members in an SCM account
Elements For Waiting List
Guid The person's unique id in the system (read only)
DateAdded required The first name of the person (yyyy-mm-dd format)
Firstname required The first name of the person (max length = 50)
Lastname required The last name of the person (max length = 50)
DOB The person's date of birth (yyyy-mm-dd format)
Gender The person's gender (M or F)
Email The person's email address (max length = 50)
Address1 The person's address 1 (max length = 50)
Address2 The person's address 2(max length = 50)
Address3 The person's address 3 (max length = 50)
Town The person's town (max length = 50)
County The person's county (max length = 50)
Postcode The person's postcode (max length = 50)
HomePhone The person's home phone number (max length = 50)
MobilePhone The person's mobile phone number (max length = 50)
PreviousExperience The person's previous experience (max length = 4000)
Notes Any relevant notes (max length = 4000)
DateLastEmailed The date the person was last emailed (read only)
DateConvertedToMember The date the person was converted to a member (read only)
GET Waiting List

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

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

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

                        {
                            "Guid": "85525b05-ef52-4997-9f50-6ed0539d37b0",
                            "Firstname": "Lakesha",
                            "Lastname": "Wilson",
                            "DOB": "2002-12-03",
                            "Gender": "F",
                            "Email": "jo@bloggs.com",
                            "Address1": "2 Scotsburn Rd",
                            "Address2": "",
                            "Address3": "",
                            "Town": "",
                            "City": "TALERDDIG",
                            "Postcode": "SY19 8FF",
                            ...                         
                        }
                    

When you POST a new Waiting List, the api will return a JSON object with the Waiting List details.


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 returns a list of your Whos Who categories and Members assigned to those categories

                        {
                            "Categories": [
                            { 
                            "Category": "Club Officers",
                            "Members": [
                            {
                                "Firstname": "Joseph",
                                "Lastname": "Bloggs",
                                "KnownAs": "Jo",
                                "Notes": "Secretary"
                            },
                            ...
                            },
                            ...
                        }
                    

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