Introduction
Our API is currently running in private beta. To request access please contact us through the Feedback section when you are logged in to your account. |
Members Portal is an online registration and membership management system, allowing sports organisations, societies, charities and clubs to efficiently manage their organisation, reducing both cost and time spent on administration.
This API allows external programs secure, controlled access to specific areas of your organisation’s data, such as membership or event information. This allows integration with other systems, such as accounting, reporting, or existing applications that your organisation already uses, or new ones that you are developing.
Overview
HTTP Verbs
The Members Portal API adheres as closely as possible to standard HTTP and REST conventions in its use of HTTP verbs.
Verb | Usage |
---|---|
|
Used to retrieve a resource |
|
Used to create a new resource |
|
Not yet supported. In future API versions this will support partial resource updates |
|
Used to update an existing resource, full updates only |
|
Used to delete an existing resource |
HTTP Status Codes
The Members Portal API adheres as closely as possible to standard HTTP and REST conventions in its use of HTTP status codes.
Status code | Usage |
---|---|
|
Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. |
|
The request has been fulfilled and resulted in a new resource being created. |
|
The server successfully processed the request, but is not returning any content. |
|
The server cannot or will not process the request due to something that is perceived to be a client error (e.g. invalid JSON, invalid data, invalid request). |
|
Your client is trying to access a resource with no |
|
The requested resource could not be found but may be available again in the future. Subsequent requests by the client are permissible. |
|
A server error has occurred. This is likely to be temporary, with the support team being notified that such an error has occurred. |
Resources
Authentication
Authentication uses JSON Web Tokens for token access to all resource calls.
The authentication flow is as follows:
-
Your client first makes a
POST
to/auth
with your API username and password to obtain a token -
Your client then sends this token value in the
Authorization
header on subsequent calls
Making a call to any resource without including the Authorization
header with the token will receive
a 401 Unauthorized
response.
Authenticate
A POST
request verifies your credentials and provides an authentication token for subsequent calls.
Example request
$ curl 'https://api.membersportal.co/auth' -i -X POST -H 'Content-Type: application/json' -d '{
"username" : "apitest1@membersportal.co",
"password" : "apiTestPassword1"
}'
$ echo '{
"username" : "apitest1@membersportal.co",
"password" : "apiTestPassword1"
}' | http POST 'https://api.membersportal.co/auth' 'Content-Type:application/json'
Example response
Path | Type | Description |
---|---|---|
|
|
A token to be used with subsequent REST calls |
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 250
{
"token" : "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhcGl0ZXN0MUBtZW1iZXJzcG9ydGFsLmNvIiwiYXVkaWVuY2UiOiJ3ZWIiLCJjcmVhdGVkIjoxNDk0NTExNzQ4MTIxLCJleHAiOjE0OTUxMTY1NDh9.xgoMg1OcYumNTlMBC7L9R6PAWsvRZAuKktNCX3uAKj3AEY_8Z4xX_M4y-nNUDRsOyUWRAWIjL0Kg2HYioEeRtg"
}
OrgHierarchy
An OrgHierarchy resource is a group within your organisation hierarchy. The top level OrgHierarchy is usually your Headquarters, or National Council. Your organisation hierarchy will usually be a tree structure, with headquarters at the top, possibly split into countries, regions, counties, or perhaps leagues or teams.
This resource is used to create, modify and list items in the organisation hierarchy, such as clubs, units, regions, counties, countries. Items in the hierarchy are completely customisable, so depending on your needs you might choose any of:
-
For a small club with members just use a single OrgHierarchy resource. (already created as Headquarters when you create an account)
-
For clubs with multiple teams, such as a Golf Club, you might want to create multiple teams such as Juniors, Mens Team, Ladies Team, Seniors
-
For small organisations, you might create leagues, regions or counties, with teams or clubs in these
-
For large organisations you can create countries, regions, counties, teams, clubs, units or sections
Please note these are entirely configurable to suit your exact needs, all club/organisation setups are possible.
List Org Items
A GET
request lists all of the organisation’s hierarchy items, such as regions, clubs, units.
Path | Type | Description |
---|---|---|
|
|
The organisation hierarchy item’s ID |
|
|
The name of the hierarchy item. This could be the name of a club, unit, region, county, country etc depending on your organisation structure. |
|
|
The parent ID of the hierarchy item. This will be your top level organisation ID if this is your first organisation hierarchy item. |
|
|
The type of the hierarchy item. This could be club, unit, region, county, country etc depending on your organisation structure. |
Example request
$ curl 'https://api.membersportal.co/org/items' -i -H 'Accept: application/json'
$ http GET 'https://api.membersportal.co/org/items' 'Accept:application/json'
Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 277
[ {
"id" : 539,
"parentId" : null,
"name" : "Training League",
"type" : null
}, {
"id" : 554,
"parentId" : null,
"name" : "Barnsfield Football Club",
"type" : null
}, {
"id" : 591,
"parentId" : null,
"name" : "Smithburn Football Club",
"type" : null
} ]
Fetch Org Item
A GET
request fetches a specific organisation hierarchy items, such as a single region, club or unit.
Path | Type | Description |
---|---|---|
|
|
The organisation hierarchy item’s ID |
|
|
The name of the hierarchy item. This could be the name of a club, unit, region, county, country etc depending on your organisation structure. |
|
|
The parent ID of the hierarchy item. This will be your top level organisation ID if this is your first organisation hierarchy item. |
|
|
The type of the hierarchy item. This could be club, unit, region, county, country etc depending on your organisation structure. |
Example request
$ curl 'https://api.membersportal.co/org/items/554' -i -H 'Accept: application/json'
$ http GET 'https://api.membersportal.co/org/items/554' 'Accept:application/json'
Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 93
{
"id" : 554,
"parentId" : null,
"name" : "Barnsfield Football Club",
"type" : null
}
Create Org Item
A POST
request creates a new organisation hierarchy item.
Example request
$ curl 'https://api.membersportal.co/org/items' -i -X POST -H 'Content-Type: application/json' -d '{
"id" : 554,
"name" : "Barnsfield Football Club"
}'
$ echo '{
"id" : 554,
"name" : "Barnsfield Football Club"
}' | http POST 'https://api.membersportal.co/org/items' 'Content-Type:application/json'
Example response
HTTP/1.1 201 Created
Member
Members are the people within your organisation. Members added on the Members Portal can be set to login or not, with information stored on each Member completely configurable depending on your needs.
For example, you may wish to record just member names, or more complicated information such as:
-
Address details
-
Date of birth
-
Role within your organisation (member type)
-
Contact details
The Member API resource is used to create, modify and list members.
List all members
A GET
request lists all of your organisation’s members.
Path | Type | Description |
---|---|---|
|
|
The member’s ID |
|
|
The member’s member type. This depends on what member types are configured for your organisation. e.g. administrator, runner, referee, student |
|
|
Set to true if the member can login to the Members Portal |
|
|
The member’s login username. This is set to an email address, but may be different from 'email' listed below |
|
|
The member’s forename |
|
|
The member’s surname |
|
|
The member’s email address |
|
|
The member’s last successful login time |
|
|
A list of name value pairs detailing information about the member. Name can be any field label (including spaces), value can be any value e.g. John Smith, 4, true, yes, No etc |
Example request
Unresolved directive in v1/Member-v1.adoc - include::/home/munity/Documents/workspace_mu_units/mp-api/build/generated-snippets/list-members-in-org-v1/curl-request.adoc[] Unresolved directive in v1/Member-v1.adoc - include::/home/munity/Documents/workspace_mu_units/mp-api/build/generated-snippets/list-members-in-org-v1/httpie-request.adoc[]
Example response
Unresolved directive in v1/Member-v1.adoc - include::/home/munity/Documents/workspace_mu_units/mp-api/build/generated-snippets/list-members-in-org-v1/http-response.adoc[]
List members in section
A GET
request lists the organisation’s members in a specified section of your organisation.
Depending on how your have setup your organisation hierarchy, examples might include:
-
List all members in Scotland
-
List all members in County Down
-
List all members in the Seniors team
-
List all members in the 1st League
Path | Type | Description |
---|---|---|
|
|
The member’s ID |
|
|
The member’s member type. This depends on what member types are configured for your organisation. e.g. administrator, runner, referee, student |
|
|
Set to true if the member can login to the Members Portal |
|
|
The member’s login username. This is set to an email address, but may be different from 'email' listed below |
|
|
The member’s forename |
|
|
The member’s surname |
|
|
The member’s email address |
|
|
The member’s last successful login time |
|
|
A list of name value pairs detailing information about the member. Name can be any field label (including spaces), value can be any value e.g. John Smith, 4, true, yes, No etc |
Example request
$ curl 'https://api.membersportal.co/org/4/members' -i -H 'Accept: application/json'
$ http GET 'https://api.membersportal.co/org/4/members' 'Accept:application/json'
Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 640
[ {
"id" : 45,
"memberType" : "member",
"fields" : {
"Emergency Contact Phone" : "+441234567890",
"Year of birth" : "1980",
"Emergency Contact Name" : "Peter Smith"
},
"username" : "test45@test45.com",
"lastSuccessfulLogin" : null,
"login" : false,
"memberOfOrgItemId" : null,
"gravatarUrl" : null,
"email" : "",
"forename" : "",
"surname" : ""
}, {
"id" : 92,
"memberType" : "member",
"fields" : { },
"username" : "test92@test92.com",
"lastSuccessfulLogin" : null,
"login" : false,
"memberOfOrgItemId" : null,
"gravatarUrl" : null,
"email" : "",
"forename" : "",
"surname" : ""
} ]
Fetch member
A GET
request fetches a specific person.
Path | Type | Description |
---|---|---|
|
|
The member’s ID |
|
|
The member’s member type. This depends on what member types are configured for your organisation. e.g. administrator, runner, referee, student |
|
|
Set to true if the member can login to the Members Portal |
|
|
The member’s login username. This is set to an email address, but may be different from 'email' listed below |
|
|
The member’s forename |
|
|
The member’s surname |
|
|
The member’s email address |
|
|
The member’s last successful login time |
|
|
A list of name value pairs detailing information about the member. Name can be any field label (including spaces), value can be any value e.g. John Smith, 4, true, yes, No etc |
Example request
$ curl 'https://api.membersportal.co/org/members/45' -i -H 'Accept: application/json'
$ http GET 'https://api.membersportal.co/org/members/45' 'Accept:application/json'
Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 380
{
"id" : 45,
"memberType" : "member",
"fields" : {
"Emergency Contact Phone" : "+441234567890",
"Year of birth" : "1980",
"Emergency Contact Name" : "Peter Smith"
},
"username" : "test45@test45.com",
"lastSuccessfulLogin" : null,
"login" : false,
"memberOfOrgItemId" : null,
"gravatarUrl" : null,
"email" : "",
"forename" : "",
"surname" : ""
}
Create member
A POST
request creates a new member.
Example request
$ curl 'https://api.membersportal.co/org/4/members' -i -X POST -H 'Content-Type: application/json' -d '{
"id" : 45,
"memberType" : "member",
"fields" : {
"Emergency Contact Phone" : "+441234567890",
"Year of birth" : "1980",
"Emergency Contact Name" : "Peter Smith"
},
"username" : "test45@test45.com",
"login" : false,
"email" : "",
"forename" : "",
"surname" : ""
}'
$ echo '{
"id" : 45,
"memberType" : "member",
"fields" : {
"Emergency Contact Phone" : "+441234567890",
"Year of birth" : "1980",
"Emergency Contact Name" : "Peter Smith"
},
"username" : "test45@test45.com",
"login" : false,
"email" : "",
"forename" : "",
"surname" : ""
}' | http POST 'https://api.membersportal.co/org/4/members' 'Content-Type:application/json'
Example response
HTTP/1.1 201 Created
Event
Events allow you to run an event registration, take payments (either full amounts or deposits), requestion expressions of interest for an event, or allow people to fill in surveys or forms to collect information.
Examples of running events include:
-
Members paying yearly registration, or paying for a specific event (e.g. Training day, Day trip etc)
-
Parents paying for their children to attend an event, such as a trip to the zoo
-
Taking deposit payments for a camp
-
Clubs registering interest in a county training day
The Event resource is used to create, modify and list events.
List all events
A GET
request lists all of the organisation’s events.
Path | Type | Description |
---|---|---|
|
|
The event’s ID |
|
|
The name of the event |
|
|
The name of the event |
|
|
The name of the event |
|
|
The name of the event |
|
|
The name of the event |
|
|
The event page’s theme |
Example request
$ curl 'https://api.membersportal.co/org/events' -i -H 'Accept: application/json'
$ http GET 'https://api.membersportal.co/org/events' 'Accept:application/json'
Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 364
[ {
"id" : null,
"eventName" : "Mourne Mountains Camping",
"eventOwnerId" : null,
"currentPageStatus" : null,
"templateName" : null,
"privateTag" : null,
"theme" : null
}, {
"id" : null,
"eventName" : "Hockey Summer Camp",
"eventOwnerId" : null,
"currentPageStatus" : null,
"templateName" : null,
"privateTag" : null,
"theme" : null
} ]
Fetch event
A GET
request fetches a specific person.
Unresolved directive in v1/Event-v1.adoc - include::/home/munity/Documents/workspace_mu_units/mp-api/build/generated-snippets/get-event-v1/response-fields.adoc[]
Example request
Unresolved directive in v1/Event-v1.adoc - include::/home/munity/Documents/workspace_mu_units/mp-api/build/generated-snippets/get-event-v1/curl-request.adoc[] Unresolved directive in v1/Event-v1.adoc - include::/home/munity/Documents/workspace_mu_units/mp-api/build/generated-snippets/get-event-v1/httpie-request.adoc[]
Example response
Unresolved directive in v1/Event-v1.adoc - include::/home/munity/Documents/workspace_mu_units/mp-api/build/generated-snippets/get-event-v1/http-response.adoc[]
Create event
A POST
request creates a new event.
Example request
Unresolved directive in v1/Event-v1.adoc - include::/home/munity/Documents/workspace_mu_units/mp-api/build/generated-snippets/create-event-v1/curl-request.adoc[] Unresolved directive in v1/Event-v1.adoc - include::/home/munity/Documents/workspace_mu_units/mp-api/build/generated-snippets/create-event-v1/httpie-request.adoc[]
Example response
Unresolved directive in v1/Event-v1.adoc - include::/home/munity/Documents/workspace_mu_units/mp-api/build/generated-snippets/create-event-v1/http-response.adoc[]