The Amilia API is located here: http://amiliaapp.github.io/amilia-demo-organization/api-documentation.html. It lists calls that are public. In addition, there is another document which lists calls with authentication required. Those are not yet public and will be sent in a separate PDF.
First off, most calls take as argument the language (en
for English in your case) and a "rewrite url" - the id of the organization or customer. For your demo org, it is myskillchart
. You'll notice those parts in the signature of the API calls below. I built the examples using your demo account.
The API is always a URL and returns JSON. Authenticated calls require an extra HTTP header. I've gone ahead and used jQuery to code up the calls. You can run those in your browser from your website domain or on the amilia.com domain (we respect CORS).
$.get('https://www.amilia.com/PublicApi/myskillchart/en/Programs')
Returns
{
"Items": [
{
"Id": 35006,
"Name": "Boys",
"Start": "2018-08-01T00:00:00",
"End": "2020-08-31T00:00:00",
"Url": "https://www.amilia.com/store/en/myskillchart/shop/programs/35006",
"PictureUrl": "https://d44a4f4190a56244f28e-5f78a810e214884e03e314eb55e5dccb.ssl.cf2.rackcdn.com//25e9d1f4-1742-4f32-bfb6-4f52a1154bc1_circus_school4.jpg"
}
],
"Page": {
"NextId": null,
"Next": null
}
}
Pull out the program id 35006
.
$.get('https://www.amilia.com/PublicApi/myskillchart/en/Programs/35006/Activities')
Returns
{
"Items": [
{
"Id": 1891917,
"Name": "Boys Beginner Mondays & Tuesdays",
"Description": null,
"ResponsibleName": "",
"Prerequisite": null,
"Note": null,
"ThirdPartyUrl": null,
"ExtraInformation": "",
"Url": "https://www.amilia.com/store/en/myskillchart/shop/activities/1891917",
"LegacyLocation": "",
"Price": 200,
"Schedule": [
{
"StartTime": "18:00:00",
"EndTime": "19:00:00",
"StartDate": "2018-09-03T00:00:00",
"EndDate": null,
"RecurenceEndDate": "2019-06-24T00:00:00",
"Occurences": null,
"Staff": [],
"Facilities": [],
"ExceptOccurences": [],
"Days": [
"Monday",
"Tuesday"
],
"DayMask": 6
}
],
"Age": null,
"TaxCredit": null,
"SpotsRemaining": null,
"SpotsReserved": 1,
"ShortScheduleString": "On Mondays, Tuesdays from 6:00 PM to 7:00 PM",
"HasSessionEnabled": true,
"AgeSummary": "",
"OrganizationId": 7778,
"SubCategoryName": "Twice a week",
"SubCategoryId": 1891916,
"SubCategoryPosition": 1,
"Status": "Normal",
"CategoryName": "Beginner",
"ProgramName": "Boys",
"PictureUrl": null
},
{
"Id": 1891918,
"Name": "Boys Intermediate Wednesdays & Thursdays",
"Description": null,
"ResponsibleName": "",
"Prerequisite": null,
"Note": null,
"ThirdPartyUrl": null,
"ExtraInformation": "",
"Url": "https://www.amilia.com/store/en/myskillchart/shop/activities/1891918",
"LegacyLocation": "",
"Price": 200,
"Schedule": [
{
"StartTime": "18:00:00",
"EndTime": "19:00:00",
"StartDate": "2018-09-03T00:00:00",
"EndDate": null,
"RecurenceEndDate": "2019-06-24T00:00:00",
"Occurences": null,
"Staff": [],
"Facilities": [],
"ExceptOccurences": [],
"Days": [
"Wednesday",
"Thursday"
],
"DayMask": 24
}
],
"Age": null,
"TaxCredit": null,
"SpotsRemaining": null,
"SpotsReserved": 0,
"ShortScheduleString": "On Wednesdays, Thursdays from 6:00 PM to 7:00 PM",
"HasSessionEnabled": true,
"AgeSummary": "",
"OrganizationId": 7778,
"SubCategoryName": "Twice a week",
"SubCategoryId": 1891925,
"SubCategoryPosition": 2,
"Status": "Normal",
"CategoryName": "Intermediate",
"ProgramName": "Boys",
"PictureUrl": null
}
],
"Page": {
"NextId": null,
"Next": null
}
}
Pull out the activity ID 1891917
. The next step to fetch participants requires an API token.
var username = 'your email';
var password = 'you password';
$.ajax({
url: AMILIA_URL + 'https://www.amilia.com//PublicApi/en/Authentication/Login',
type: 'GET',
dataType: 'json',
beforeSend: function(xhr) {
xhr.setRequestHeader('Authorization', 'Basic ' + btoa(username + ':' + password));
}
});
Returns something like this:
{
"Token": "eyJ0exxxxxxxxxxxxxxxxxxxxxxxxxxiJ9.exxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxXYkZCQ2dzTXNpTlZVUTYiLCJ1YUlkcyI6WzczNjczNjFdfQ.PlEzq9ahzprp5xlust9eOQEPLEVxxxxxxxxxxxxxyQ"";
}
You can use this token in the following call to fetch attendance
var token = 'your API token';
$.ajax({
url: 'https://www.amilia.com/PublicApi/myskillchart/en/Activities/1891917/Persons',
dataType: "json",
beforeSend: function(xhr) {
xhr.setRequestHeader("Authorization", "Bearer " + token);
}
});
Returns something like this:
{
"Items": [
{
"Id": 4832528,
"AmiliaId": "P12113125",
"FirstName": "Oba",
"LastName": "Sharkey",
"Gender": "Male",
"DateOfBirth": "2014-06-06T04:00:00",
"Email": null,
"Address": null,
"IsArchived": false,
"GenuinePerson": null
}
],
"Page": {
"NextId": null,
"Next": null
}
}
The participant information is currently limited to their name, gender and date of birth. We will be adding more information. For example: guardian name, address, phone number and email; participant picture, etc...