Amilia API

You can test the API here directly in your browser. Examples GET calls provided are called using jQuery $.get. Hit F12 to open a developer console and type in the example GET calls documented below.

 

There are two types of API that are available, which returns JSON:

  • Open Public calls: Information that is public facing on your Amilia Store page; and
  • Authenticated calls: (requires a token): Information accessible to signed in Amilia account owners. 

 

Rate Limit

You can only do a certain amount of calls to our API per second for one given IP Address. Our default value will be set to 100 and we may tweak this in the future but do not worry if your web page makes Ajax calls from the client's browser (this most probably will never be met). If you do hit this limit, you will receive an HTTP Status code 429. Wait for a little while before making your next calls.

 

Authenticated API calls

Some endpoints require authentication, which are marked with an <Authenticated> label. To have access to these endpoints you need a token that can be obtained with request to the API (see below) and a valid Amilia account. That account should be an administrator of the organization and have the "Account owner" access level.

NOTE: To avoid problems with staff changes within the org, we recommend using an account that is not linked to a specific person but is rather created specifically to access the API. Note that the account still needs a valid email as a username. 

  • How to use the Token

The token must be used as part of a bearer authentication. Here is an example of bearer authentication in ajax:

$.ajax(
{
url:"https://www.amilia.com/org-name/PublicApi/en/Activities/Spots",
type:"GET",
beforeSend:function(xhr)
{
xhr.setRequestHeader("Authorization", "Bearer " + token));
}
})
  • Get Authentication Token

 /PublicApi/[Lang]/Authentication/Login

Get an authentication token. A "Basic Authentication" header needs to be included in this request, with the username and password of the Amilia account you chose to use for making requests on the API endpoints that require authentication.

Example:

In ajax, the "beforeSend" callback can be used to add the Basic Authorization header, and the credentials are included using the username:password format.

Note that you need to pass valid username and password.

$.ajax(
{
url:"https://www.amilia.com/PublicApi/en/Authentication/Login",
type:"GET",
beforeSend:function(xhr)
{
xhr.setRequestHeader("Authorization", "Basic " + btoa("jhon.doe@doe.com"+":"+"123"));
}
})
Result:
{
"Token": "eyJ0exxxxxxxxxxxxxxxxxxxxxxxxxxiJ9.exxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxXYkZCQ2dzTXNpTlZVUTYiLCJ1YUlkcyI6WzczNjczNjFdfQ.PlEzq9ahzprp5xlust9eOQEPL- EVxxxxxxxxxxxxxyQ"
}
 
Base URL

Through the documentation, data that is meant to be replaced with your own values is surrounded by square brackets ([like this]).

All the endpoints of the API share the same root URL: https://www.amilia.com/PublicApi/[rewriteUrl]/[lang]/.

  • rewriteUrl represents your unique organization token. This is the same token used in your Amilia storefront URL. It can be found in Amilia under the Account>Options tab.
  • lang represents the language in which the localizable values should be returned. The values currently supported are either fr or en. Localization is only applied to values. The attribute names and URLs are not localized.

 

Pagination

Some endpoints do pagination using cursors, which will be marked with a Paged_EN.png label. Paginated responses should all follow the format below:

{
    "Items": [],
    "Page": {
        "NextId": int|string,
        "Next": url
    }
}
                       

To paginate, include the following optional parameters in the URL:

IMAGE_PAGINATION.png

Items should contain a list of the requested items. Page.Next is meant to be the URL to request the next page of data. This field is null if there's no more data to fetch. A limit query string parameter can always be used to control the page size, allowing some kind of control over the expected payload response.

 

Logged User Information

Me

 /PublicApi/[Lang]/Me

Returns the logged user information. Only valid when the user is logged in. 

Example: https://www.amilia.com/PublicApi/en/Me

Result:

{
 "Email": "jobdoe@email.com"
}

 

List organizations the logged user is associated with

/PublicApi/[Lang]/Me/Organizations

Returns a list of organizations where the logged user is an administrator or staff.

Example: https://www.amilia.com/PublicApi/en//Me/Organizations

Result:

{
   {
"Id": 1029
"Logo": "https://9af8441d9955da1e6b2f-37011465e523601d5de5e52536b64028.ssl.cf2.rackcdn.com/logo1029_f8bd.jpg"
"Name": "Demo Amilia Swim"
"RewriteUrl": "demo-amilia-swim-club"
} }

 

Persons

List all persons in a program Paged_EN.png <authenticated>

/PublicApi/[RewriteUrl]/[Lang]/Programs/[Id]/Persons

Lists all the persons registered in a given program. The logged user must be an administrator. 

Example: https://www.amilia.com/PublicApi/org-name/en/Programs/24505/Persons

Result:

{
  "Items": [
{
"Id": 3456789,
"AmiliaId": "P1234567",
"FirstName": "John",
"LastName": "Doe",
"Gender": 0,
"DateOfBirth": "2000-01-01T04:00:00",
"Email": "johndoe@email.com",
"Address": null,
"IsArchived": false
},
{
"Id": 34567810,
"AmiliaId": "P234567",
"FirstName": "Jane",
"LastName": "Smith",
"Gender": 1,
"DateOfBirth": "1999-02-02T04:00:00",
"Email": "smith.j@email.net",
"Address": {
"Telephone": "1234567890",
"AddressLine1": "123 Street Rd.",
"AddressLine2": "",
"City": "City Name",
"PostalCode": "12345",
"Province": "ZX",
"Country": "US"
},
"IsArchived": false
}
],
"Page": {
"NextId": null,
"Next": null
}
}

 

Get a person <authenticated>

/PublicApi/[RewriteUrl]/[Lang]/Persons/[Id]

Retrieve a person's detailed information using the Id. The logged user must be an administrator.

Example:  https://www.amilia.com/PublicApi/org-name/en/Persons/3954324

Result:

{
"Id": 34567810,
"AmiliaId": P234567,
"FirstName": "Jane",
"LastName": "Smith",
"Gender": 0,
"DateOfBirth": "1999-02-02T04:00:00",
"Email": "smith.j@email.net",
"Address": {
"Telephone": "1234567890",
"AddressLine1": "123 Street Rd.",
"AddressLine2": "",
"City": "City Name",
"PostalCode": "12345",
"Province": "ZX",
"Country": "US"
},
"IsArchived": false
}

 

Programs

Listing programs Paged_EN.png

/PublicApi/[RewriteUrl]/[Lang]/Programs

Allows listing the available programs you've defined. The following query string options are available:

option name default value (if not specified)
archived false include programs that have been archived
offline false include programs that are not visible to clients

Example:

$.get('https://www.amilia.com/PublicApi/usa-amilia-group/en/Programs?archived=false&offline=false')

Result:

{
  "Items": [
    {
      "Id": 8680,
      "Name": "Professional Events"
    },
    {
      "Id": 8688,
      "Name": "Recreational Events / Activities "
    },
    {
      "Id": 9173,
      "Name": "Spring Schedule: Jan 2 - April 30, 2014"
    }
  ],
  "Page": {
    "NextId": null,
    "Next": null
  }
}

 

Get a program by Id

/PublicApi/[RewriteUrl]/[Lang]/Programs/[Id]

Fetches the associated program. 

Example:

$.get('https://www.amilia.com/PublicApi/usa-amilia-group/en/Programs/9173')

Result: 

{
  "Id": 9173,
  "Name": "Spring Schedule: Jan 2 - April 30, 2014"
}

 

List activities of a program Paged_EN.png

/PublicApi/[RewriteUrl]/[Lang]/Programs/[Id]/Activities

Lists all the activities available under a certain program. The list of activities returned are ordered by Id. The following query string options are available:

option name default value (if not specified) min/max values
limit 100 5-100 how many activities to return per page
idStart 0   minimum activity id to return

Example:

$.get('https://www.amilia.com/PublicApi/usa-amilia-group/en/Programs/9173/Activities')

Result Show_hide_EN.png

 

List all occurrences of a program <authenticated>

/PublicApi/[RewriteUrl]/[Lang]/Programs/[Id]/Occurrences

Gets all occurrences for a given program. The result can include different states of occurrences. 

  • Normal: is scheduled;
  • Skipped: the specific occurrence was skipped due to a conflict with a holiday or manually by an administrator;
  • Canceled: the activity was canceled, therefore this occurrence too; and
  • Archived: the activity was canceled, but there was a registration linked to this occurrence. 

The URL is a link to the page in the store for the activity that is parent to that occurrence. This can be useful if you want to display the occurrences in a calendar and refer to the registration page of the activity. 

Occurrences_of_a_PROGRAM_image_8.png

Start and end options should be passed in as query parameters in the URL.

The logged user must be an administrator. 

Example:

https://www.amilia.com/PublicApi/org-name/en/Programs/23456/Occurrences

https://www.amilia.com/PublicApi/org-name/en/Activities/23456/Occurrences?start=2017-09-10&end=2017-09-31

Result:

[
{
"Id": 9123456,
"Start": "2017-09-10T15:30:00",
"End": "2017-09-10T17:15:00",
"TimeZone": "Eastern Standard Time",
"AllDay": false,
"Url": "http://www.amilia.com/store/en/org-name/shop/activities/1234567",
"State": "Normal",
"ActivityId": 1234567,
"ActivityName": "Activity name 1"
},
{
"Id": 9234567,
"Start": "2017-09-20T15:30:00",
"End": "2017-09-20T17:15:00",
"TimeZone": "Eastern Standard Time",
"AllDay": false,
"Url": "http://www.amilia.com/store/en/org-name/shop/activities/1234568",
"State": "Skipped",
"ActivityId": 1234568,
"ActivityName": "Activity name 2"
}
]

 

Activities

List all persons registered to an activity Paged_EN.png<authenticated>

/PublicApi/[RewriteUrl]/[Lang]/Activities/[Id]/Persons

Lists all the persons registered in a given activity. The logged user must be an administrator. 

 

Get a person registered to an activityPaged_EN.png<authenticated>

/PublicApi/[RewriteUrl]/[Lang]/Activities/[Id]/Persons/[Id]

Returns the person if registered to an activity. The logged user must be an administrator. 

 

Registers a person to an activity Paged_EN.png<authenticated>

/PublicApi/[RewriteUrl]/[Lang]/Activities/[Id]/Persons

Registers an existing person to a given activity. You must use the HTTP verb POST and pass in this payload:

{
PersonId: 12345
}

The logged user must be an administrator.

This will create an invoice in the account of the person and adds them to the roster of attendees of the activity. Returns the registered person.

This call has some restrictions:

  1. Registration is only allowed for $0 activities.
  2. You cannot register a person already registered. An error will be returned in that case.
  3. The person must already exist in the organization.
  4. Constraints such as age, gender and required memberships are not checked. The API call allows bypassing those rules.

Unregisters a person from an activity Paged_EN.png<authenticated>

/PublicApi/[RewriteUrl]/[Lang]/Activities/[Id]/Persons/[Id]

Cancels an existing registration to a given activity. You must use HTTP verb DELETE. 

This will create a credit memo of the amount paid for the activity and remove the person from the list of attendees.

 

Fetch an activity by Id

/PublicApi/[RewriteUrl]/[Lang]/Activities/[Id]

Fetch a single activity, by Id.

Example:

$.get('https://www.amilia.com/PublicApi/usa-amilia-group/en/Activities/630191');

Result:

{
  "Id": 630191,
  "Name": "(C) Trapeze (Static), Rope & Tissue / 9 yrs - Teen / 5:30pm - 6:55pm / (Beg-Mixed Levels)",
  "Description": "",
  "ResponsibleName": "",
  "Prerequisite": "",
  "Note": "",
  "ExtraInformation": "",
  "Url": "https://www.amilia.com/store/en/usa-amilia-group/shop/activities/630191",
  "LegacyLocation": "",
  "PictureUrl": null,
  "Price": 38.0000,
  "Schedule": [
    {
      "StartTime": "17:30:00",
      "EndTime": "18:55:00",
      "StartDate": "2014-01-13T00:00:00",
      "EndDate": "2014-01-13T00:00:00",
      "RecurenceEndDate": null,
      "Occurences": 0,
      "Staff": [
        
      ],
      "Facilities": [
        
      ],
      "ExceptOccurences": [
        
      ],
      "Days": [
        
      ]
    }
  ],
  "Age": {
    "Max": 15,
    "Min": 9,
    "Months": false
  },
  "TaxCredit": null,
  "SpotsRemaining": 2147483647,
  "SpotsReserved": 0,
  "ShortScheduleString": "5:30 PM",
  "HasSessionEnabled": true,
  "AgeSummary": "9-15",
  "SubCategoryName": "Monday's Classes",
  "CategoryName": "Week of January 13, 2014",
  "ProgramName": "Spring Schedule: Jan 2 - April 30, 2014"

 

List occurrences of an activity <authenticated>

/PublicApi/[RewriteUrl]/[Lang]/Activities/[Id]/Occurrences

Gets all occurrences for a given activity. The result can include different states of occurrences:

  • Normal: is scheduled;
  • Skipped: the specific occurrence was skipped due to a conflict with a holiday or manually by an administrator;
  • Canceled: the activity was canceled, therefore this occurrence too; and
  • Archived: the activity was canceled, but there was a registration linked to this occurrence. 

The URL is a link to the page in the store for the activity that is parent to that occurrence. This can be useful if you want to display the occurrences in a calendar and refer to the registration page of the activity. 

Occurrences_of_a_PROGRAM_image_8.png

Start and end options should be passed in as query parameters in the URL.

The logged user must be an administrator. 

Example:

https://www.amilia.com/PublicApi/org-name/en/Activities/12345678/Occurrences

https://www.amilia.com/PublicApi/org-name/en/Activities/12345678/Occurrences?start=2017-09-10&end=2017-09-31

[
{
"Id": 9123456,
"Start": "2017-09-10T15:30:00",
"End": "2017-09-10T17:15:00",
"TimeZone": "Eastern Standard Time",
"AllDay": false,
"Url": "http://www.amilia.com/store/en/org-name/shop/activities/1234567",
"State": "Normal",
"ActivityId": 1234567,
"ActivityName": "Activity name 1"
},
{
"Id": 9234567,
"Start": "2017-09-20T15:30:00",
"End": "2017-09-20T17:15:00",
"TimeZone": "Eastern Standard Time",
"AllDay": false,
"Url": "http://www.amilia.com/store/en/org-name/shop/activities/1234567",
"State": "Skipped",
"ActivityId": 1234567,
"ActivityName": "Activity name 1"
}
]

 

Get the spots in an activity Paged_EN.png <authenticated>

URL /PublicApi/[RewriteUrl]/[Lang]/Activities/[Id]/Spots

A spot is a reserved drop-in. Gets the spots for a given activity. The server will iterate through all occurrences in the activity with status "Normal" or "Archived", and the spots in those occurrences with a status other than "Unconfirmed" will be part of the result.

Get_spots_for_an_activity_Image_9.png

The date option should be passed in as a query parameter in the URL.

The logged user must be an administrator.

Example:

https://www.amilia.com/PublicApi/org-name/en/Activities/12345678/Spots

https://www.amilia.com/PublicApi/org-name/en/Activities/12345678/Spots?date=2017-10-09

Result:

{
"Items": [
{
"Id": 2955024,
"PersonId": 3922953,
"OccurrenceId": 9105103,
"SpotStatus": "Taken"
},
{
"Id": 2955025,
"PersonId": 3922953,
"OccurrenceId": 9105105,
"SpotStatus": "Taken"
},
{
"Id": 2955026,
"PersonId": 3922953,
"OccurrenceId": 9105107,
"SpotStatus": "Taken"
}
],
"Page": {
"NextId": null,
"Next": null
}
}

Occurrences with spots in an activity Paged_EN.png<authenticated>

URL /PublicApi/[RewriteUrl]/[Lang]/Activities/[Id]/OccurrencesWithSpots

Gets the occurrences for a given activity and includes the spots for each occurrence.

Get_spots_for_an_activity_Image_9.png

The date option should be passed in as a query parameter in the URL.

The logged user must be an administrator.

Example:

https://www.amilia.com/PublicApi/org-name/en/Activities/12345678/OccurrencesWithSpots

https://www.amilia.com/PublicApi/org-name/en/Activities/12345678/OccurrencesWithSpots?date=2017-10-09

Result:

{
"Items": [
{
"Id": 9105103,
"StartDateTime": "2017-09-18T15:30:00",
"EndDateTime": "2017-09-18T17:15:00",
"Spots": [
{
"Id": 2955024,
"PersonId": 3922953,
"OccurrenceId": 9105103,
"SpotStatus": "Taken"
},
{
"Id": 3014093,
"PersonId": 3985142,
"OccurrenceId": 9105103,
"SpotStatus": "Taken"
}
]
},
{
"Id": 9105105,
"StartDateTime": "2017-09-25T15:30:00",
"EndDateTime": "2017-09-25T17:15:00",
"Spots": [
{
"Id": 2955025,
"PersonId": 3922953,
"OccurrenceId": 9105105,
"SpotStatus": "Taken"
},
{
"Id": 3032095,
"PersonId": 3985142,
"OccurrenceId": 9105105,
"SpotStatus": "Taken"
}
]
},
{
"Id": 9105106,
"StartDateTime": "2017-09-28T15:30:00",
"EndDateTime": "2017-09-28T17:15:00",
"Spots": [
{
"Id": 3032096,
"PersonId": 3985142,
"OccurrenceId": 9105106,
"SpotStatus": "Archived"
}
]
}
],
"Page": {
"NextId": null,
"Next": null
}
}

 

Occurrences

Get an occurrence

/PublicApi/[RewriteUrl]/[Lang]/Occurrences/[Id]

Gets a given occurrence's basic information. 

Example:

http://www.amilia.localhost/PublicApi/org-name/en/Occurrences/12345678

Result:

{
"Id": 12345678,
"Start": "2017-09-10T15:30:00",
"End": "2017-09-10T17:15:00",
"TimeZone": "Eastern Standard Time",
"State": "Normal"
"AllDay": false,
"Url": "http://www.amilia.com/store/en/org-name/shop/activities/1234567",
"ActivityId": 1234567,
"ActivityName": "Activity name 1"
}

Create an occurrence <authenticated>

/PublicApi/[RewriteUrl]/[Lang]/Occurrences/

Creates a new occurrence on a given activity. You must use HTTP verb POST and pass in this payload:

{
"ActivityId": 1635890,
"Start": "2018-08-02 18:45:00",
"End": "2018-08-02 19:45:00",
"AllDay": false,
"Facilities": [
{Id: 15382}
]
}

Where ActivityId is the activity in which to add the occurrence. The occurrence must have Start and End dates that are logical (End must be after Start). For an all-day occurrence, set the AllDay flag to true. If omitted will be false. You can optionally pass a facility id via Facilities using the exact signature as above. Although it takes a list of objects, only one facility is currently supported. If you attempt to pass more than one facility, an error code 400 will be returned.

The logged user must be an administrator. A staff cannot create an occurrence.

 

Attendance

Get the attendance list of an occurrence <authenticated>

/PublicApi/[RewriteUrl]/[Lang]/Occurrences/[Id]/PersonAttendance

Gets a list of attendance for people registered to that occurrence. Returns a list of people along with their attendance Status and list of user-defined Values. Attendance status has possible values None and Present.

The logged user must be an administrator or staff.

Example:

http://www.amilia.localhost/PublicApi/org-name/en/Occurrences/1234/PersonAttendance

Result:

[
{
Id: 43037,
AmiliaId: "P1223",
SegmentId: 1234,
FirstName: "Étienne",
LastName: "Cardinal",
UpdatedOn: "2018-04-19T01:50:22.937",
Status: "None",
Values: [ ],
},
{
Id: 31194,
AmiliaId: "P1173",
SegmentId: 1234,
FirstName: "Jaëlle",
LastName: "Tremblay",
UpdatedOn: "2018-04-19T01:50:22.937",
Status: "Present",
Values: [ "GOAL" ],
}
]

Get a single person's attendance <authenticated>

/PublicApi/[RewriteUrl]/[Lang]/Occurrences/[Id]/PersonAttendance/[Id]

Gets a single person attendance provided with the person Id.

The logged user must be an administrator or staff.

 

Update a person's attendance <authenticated>

/PublicApi/[RewriteUrl]/[Lang]/Occurrences/[Id]/PersonAttendance/[Id]

Updates the attendance record of a person for a given occurrence. You must use HTTP verb PUT to pass JSON to the server. Attributes you can change are:

  • Status: Possible values are "None" or "Present". Other values will result to "None".
  • Values: A list of user-defined strings to store alongside the attendance of the person. Can be used for meta data such as score tracking. For example you could pass ["GOAL","GOAL","ASSIST"] to indicate two goals and one assist.

Attributes UpdatedOn will automatically be changed to the present date and time. Other attributes will be ignored. Returns the updated record.

The logged user must be an administrator or staff. 

 

Multipass 

Get a client's multipass <authenticated>

/PublicApi/[RewriteUrl]/[Lang]/Multipasses/[Id]

Gets a given multipass's basic information, by Id.

NOTE: This corresponds to a client's multipass. The associated client can use the remaining number of passes (if any) on a multipass to reserve a drop-in.

To look at multipasses from the organization's point of view -- that is, viewing and editing which multipasses can be bought on the store, as well as price, time until expiration etc. -- visit the Amilia website.

The logged user must be an administrator.

Example: 

http://www.amilia.localhost/PublicApi/org-name/en/Multipasses/12345678

Result:

{
"Status": "Active",
"Id": 12345678,
"Name": "5 Class Pack",
"NbTokens": 3,
"HasUnlimitedTokens": false,
"EffectiveDate": null,
"ExpirationDate": "2018-10-08T00:00:00",
"IsEffective": true,
"IsExpired": false,
"IsUsable": true
}

 

Get all clients' multipasses within an organization Paged_EN.png

<authenticated>

 URL /PublicApi/[RewriteUrl]/[Lang]/Multipasses

Gets the occurrences for a given activity and includes the spots for each occurrence.

client_multipasses_image_10.png

The logged user must be an administrator.

Example:

https://www.amilia.com/PublicApi/org-name/en/Multipasses

https://www.amilia.com/PublicApi/org-name/en/Multipasses?onlyIncludeUsable=true

Result:

{
"Items": [
{
"Status": "Active",
"Id": 123,
"Name": "1 Class",
"NbTokens": 1,
"HasUnlimitedTokens": false,
"EffectiveDate": null,
"ExpirationDate": "2017-09-26T00:00:00",
"IsEffective": true,
"IsExpired": true,
"IsUsable": false
},
{
"Status": "Active",
"Id": 456,
"Name": "20 Class Pack",
"NbTokens": 18,
"HasUnlimitedTokens": false,
"EffectiveDate": null,
"ExpirationDate": "2018-08-25T00:00:00",
"IsEffective": true,
"IsExpired": false,
"IsUsable": true
},
{
"Status": "Active",
"Id": 789,
"Name": "1 Class",
"NbTokens": 0,
"HasUnlimitedTokens": false,
"EffectiveDate": null,
"ExpirationDate": "2017-10-26T00:00:00",
"IsEffective": true,
"IsExpired": true,
"IsUsable": false
},
],
"Page": {
"NextId": null,
"Next": null
}
}

Tags

List available tags

/PublicApi/[RewriteUrl]/[Lang]/Tags

Lists all the tags that have been defined for your organization.

Example:

$.get('https://www.amilia.com/PublicApi/usa-amilia-group/en/Tags')

Result:

[
  {
    "Id": 1051050,
    "Name": "Art",
    "Color": "orange",
    "Icon": null
  },
  {
    "Id": 1085084,
    "Name": "Sports",
    "Color": "green",
    "Icon": null
  },
  {
    "Id": 1085085,
    "Name": "Circus",
    "Color": "red",
    "Icon": null
  }
]

 

Fetch a tag by Id

/PublicApi/[RewriteUrl]/[Lang]/Tags/[Id]

Fetches a tag by Id.

Example:

$.get('https://www.amilia.com/PublicApi/usa-amilia-group/en/Tags/1051050')

Result:

{
  "Id": 1051050,
  "Name": "Art",
  "Color": "orange",
  "Icon": null
}

 

Fetch the list of activities which have the given tag

/PublicApi/[RewriteUrl]/[Lang]/Tags/[Id]/Activities?v2

Fetches the list of activities for a given tag. This is used by many to give fine-grained control over a grouping of activities when the program's structure  is not-ideal

There are two versions of this API. We highly suggest using the version2 (v2) as we plan to deprecate the first version in the future. 

$.get('https://www.amilia.com/PublicApi/usa-amilia-group/en/Tags/1051050/Activities?v2')

Result Show_hide_EN.png

 

Events

Fetch the list of activity events for active programs

/PublicApi/[RewriteUrl]/[Lang]/Events[?start=date[&end=date]][&programId=ID][&showHidden=true]

Retrieves all activity events occurring in the active programs, for the given date range. Arguments start and end are dates formatted as YYYY-MM-DD. If end is omitted, retrieves only for one day specified by start. When both start and end are omitted, returns events for today. You can also limit the search to a given program given the programId argument. You can list hidden activities by passing showHidden=true. This call is useful to build a calendar. Output is compatible with FullCalendar.

NOTE: For performance reasons, the date range is limited to 50 days, enough to cover a month view in FullCalendar.

Example:

$.get('https://www.amilia.com/PublicApi/usa-amilia-group/en/Events?start=2013-10-28');

Result:

[
  {
    "id": 2212779,
    "start": "2013-10-28T20:00:00.01",
    "end": "2013-10-28T21:00:00",
    "allDay": false,
    "title": "Badminton",
    "url": "https://www.amilia.com/store/fr/usa-amilia-group/shop/activities/593501",
    "state": "Normal",
    "Type": "activity-segment",
    "AttendanceString": null,
    "HasPlaceLeft": false,
    "CanRegister": false,
    "CanUnregister": false,
    "HasPassed": true,
    "HasDropIns": false,
    "IsHidden": false,
    "PictureUrl": null,
    "Price": null,
    "ActivityId": 593501,
    "ActivityName": "Badminton",
    "SubCategoryId": 593500,
    "SubCategoryName": "SPORT LESSONS",
    "CategoryId": 593486,
    "CategoryName": "General Courses",
    "ProgramId": 8688,
    "ProgramName": "Recreational Events / Activities ",
    "Location": "",
    "Facilities": [],
    "Tags": []
  }
]

NOTE: Attribute Location as been replaced with Facilities. Attribute Location will be removed so please update your code.

 

Facilities

 /PublicApi/[RewriteUrl]/[Lang]/Facilities

Lists all the facilities that have been defined for your organization. 

Example:

$.get('https://www.amilia.com/PublicApi/usa-amilia-group/en/Facilities')

Result:

[
  {
    "ParentId": 0,
    "Description": "Centre sportif principal",
    "State": "Normal",
    "Id": 606,
    "Name": "Centre Sportif",
    "Address": {
      "Latitude": null,
      "Longitude": null,
      "Telephone": "",
      "AddressLine1": "",
      "AddressLine2": "",
      "City": "",
      "ZipPostalCode": "",
      "StateProvince": "",
      "Country": ""
    }
  },
  {
    "ParentId": 606,
    "Description": null,
    "State": "Normal",
    "Id": 1313,
    "Name": "Aile A",
    "Address": {
      "Latitude": null,
      "Longitude": null,
      "Telephone": "",
      "AddressLine1": "",
      "AddressLine2": "",
      "City": "",
      "ZipPostalCode": "",
      "StateProvince": "",
      "Country": ""
    }
  },
  {
    "ParentId": 606,
    "Description": null,
    "State": "Normal",
    "Id": 1314,
    "Name": "Aile B",
    "Address": {
      "Latitude": null,
      "Longitude": null,
      "Telephone": "",
      "AddressLine1": "",
      "AddressLine2": "",
      "City": "",
      "ZipPostalCode": "",
      "StateProvince": "",
      "Country": ""
    }
  }
]

 

Fetch a facility by Id

/PublicApi/[RewriteUrl]/[Lang]/Facilities/[Id]

Fetches a facility by Id.

Example:

$.get('https://www.amilia.com/PublicApi/usa-amilia-group/en/Facilities/606')

Result:

{
  "ParentId": 0,
  "Description": "Centre sportif principal",
  "State": "Normal",
  "Id": 606,
  "Name": "Centre Sportif",
  "Address": {
    "Latitude": null,
    "Longitude": null,
    "Telephone": "",
    "AddressLine1": "",
    "AddressLine2": "",
    "City": "",
    "ZipPostalCode": "",
    "StateProvince": "",
    "Country": ""
  }
}

 

This article is updated as new calls are created.  You can check back at your convenience or follow this page!

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.