Use cases

Different use cases for our API v3 are described below, starting with the simplest one. A tag indicates whether the use case is relevant to an organization or a partner.

Getting the activities in a program

Organization

Context

Marc is an admin in an organization called Loyola Gym and he wants to find if a specific program at Loyola Gym has fitness activities.

Building the Amilia API integration

Authenticate the user in the API

First you need to authenticate.

https://www.amilia.com/api/V3/authenticate

The response will contain a token which you will need for all the following calls:

RESPONSE SAMPLE JSON
{
  "Token": "0000aaaa11bbbb4444hh8888rrrr.33dd4455ff.gggg6666"
}
Get all programs for an organization

You will need the organization id, which is the rewriteUrl you set in your Amilia account under Options. Say the organization id here is loyola-gym.

https://www.amilia.com/api/V3/en/org/loyola-gym/programs

This will return the programs for Loyola Gym:

RESPONSE SAMPLE JSON
{
  "Items": [
    {
      "Id": 65111,
      "Name": "Summer 2019",
      "Start": "2019-06-01T00:00:00-04:00",
      "End": "2019-09-01T00:00:00-04:00",
      "Url": "www.org.com/summer2019",
      "PictureUrl": "img/program.jpg",
      "IsArchived": false,
      "IsVisible": true
    },
    {
      "Id": 65122,
      "Name": "Fall 2019",
      "Start": "2019-09-01T00:00:00-04:00",
      "End": "2019-12-01T00:00:00-05:00",
      "Url": "www.org.com/fall2019",
      "PictureUrl": "img/program.jpg",
      "IsArchived": false,
      "IsVisible": true
    }
  ],
  "Paging": {
    "TotalCount": 2,
    "Next": ""
  }
}
Get a program's activities

Say you found the first returned program has id 65111. Send the request below to get its activities.

https://www.amilia.com/api/V3/en/programs/65111/activities

You will get a response with all the activities in the program, where you can check the name of the activities to see if it's related to fitness.

RESPONSE SAMPLE JSON
{
  "Items": [
    {
      "Description": "Cardio + weights",
      "Prerequisite": "Cardio I",
      "Note": "Bring water bottle",
      "ThirdPartyUrl": "merch/activity",
      "AdditionalInformation": "Promotions not applicable",
      "Price": 0.0,
      "DropInPrice": 0.0,
      "Age": {
        "Max": 99,
        "Min": 18,
        "Months": false
      },
      "MaxAttendance": 5,
      "SpotsRemaining": 3,
      "SpotsReserved": 0,
      "NumberOfOccurrences": 10,
      "StartDate": "2020-01-18T00:00:00-05:00",
      "EndDate": "2020-01-18T00:00:00-05:00",
      "ScheduleSummary": "Tuesdays 13h-14h, 2 May to 27 August",
      "HasSessionEnabled": false,
      "HasDropInEnabled": false,
      "AgeSummary": "18-99",
      "Keywords": [
        {
          "Id": 177,
          "Name": "Fitness"
        }
      ],
      "Groups": [
        {
          "Id": 1,
          "Name": "Sheila"
        },
        {
          "Id": 2,
          "Name": "David"
        }
      ],
      "OrganizationId": 0,
      "PictureUrl": "activity/picture.jpg",
      "Id": 111,
      "Name": "Fitness",
      "ProgramId": 65111,
      "ProgramName": "Summer 2019",
      "CategoryId": 56777,
      "CategoryName": "Adults",
      "SubCategoryId": 66788,
      "SubCategoryName": "Tuesdays 13h-14h",
      "Url": "activity/2019/tuesdays",
      "Status": "Normal"
    },
    {
      "Description": "Zumba with Erica",
      "Prerequisite": "None",
      "Note": "Bring water bottle",
      "ThirdPartyUrl": "merch/activity",
      "AdditionalInformation": "Promotions not applicable",
      "Price": 0.0,
      "DropInPrice": 0.0,
      "Age": {
        "Max": 99,
        "Min": 18,
        "Months": false
      },
      "MaxAttendance": 5,
      "SpotsRemaining": 3,
      "SpotsReserved": 0,
      "NumberOfOccurrences": 10,
      "StartDate": "2020-01-18T00:00:00-05:00",
      "EndDate": "2020-01-18T00:00:00-05:00",
      "ScheduleSummary": "Tuesdays 13h-14h, 2 May to 27 August",
      "HasSessionEnabled": false,
      "HasDropInEnabled": false,
      "AgeSummary": "18-99",
      "Keywords": [
        {
          "Id": 122,
          "Name": "Zumba"
        }
      ],
      "Groups": [
        {
          "Id": 1,
          "Name": "Sheila"
        },
        {
          "Id": 2,
          "Name": "David"
        }
      ],
      "OrganizationId": 0,
      "PictureUrl": "activity/picture.jpg",
      "Id": 111,
      "Name": "Zumba",
      "ProgramId": 65111,
      "ProgramName": "Summer 2019",
      "CategoryId": 56777,
      "CategoryName": "Adults",
      "SubCategoryId": 66788,
      "SubCategoryName": "Tuesdays 14h-15h",
      "Url": "activity/2019/tuesdays",
      "Status": "Normal"
    }
  ],
  "Paging": {
    "TotalCount": 2,
    "Next": ""
  }
}

Getting participants for all occurrences of a program [Organization]

Organization

Context

Joanne is the director in the Forest Explorers day camp for 8-11 year olds. Each day at Forest Explorers is divided in half, with the morning spent on an activity and the afternoon spent on another one. For a given half-day each participant picks one of two possible activities, for instance Canoe vs Responsible Marshmallow Roasting.

Joanne wants to get the list of participants in each of the activities in the Summer 2019 program in order to count them and therefore evaluate the popularity of each activity. This will help her decide which ones will be reconducted next year. The camp typically receives five participants each day. If an activity has fewer than two participants, she will not reconduct it.

For example, she noticed the Responsible Marshmallow Roasting activity did not get any participant while Canoe, which happened at the same time, got three participants, so the Responsible Marshmallow Roasting activity will not happen next year.

Building the Amilia API integration

Authenticate the user in the API

First you need to authenticate.

https://www.amilia.com/api/V3/authenticate

The response will contain a token which you will need for all the following calls.

RESPONSE SAMPLE JSON
{
  "Token": "0000aaaa11bbbb4444hh8888rrrr.33dd4455ff.gggg6666"
}
Get all programs

You will need the organization id, which is the rewriteUrl you set in your Amilia account under Options. Say the organization id is forest-explorers. Get the list of programs by entering this request:

https://www.amilia.com/api/V3/en/org/forest-explorers/programs

The response will look like:

RESPONSE SAMPLE JSON
{
  "Items": [
    {
      "Id": 777000,
      "Name": "Summer 2019",
      "Start": "2019-06-01T00:00:00-04:00",
      "End": "2019-09-01T00:00:00-04:00",
      "Url": "www.org.com/summer2019",
      "PictureUrl": "img/program.jpg",
      "IsArchived": false,
      "IsVisible": true
    },
    {
      "Id": 777010,
      "Name": "Fall 2019",
      "Start": "2019-09-01T00:00:00-04:00",
      "End": "2019-12-01T00:00:00-05:00",
      "Url": "www.org.com/fall2019",
      "PictureUrl": "img/program.jpg",
      "IsArchived": false,
      "IsVisible": true
    }
  ],
  "Paging": {
    "TotalCount": 2,
    "Next": ""
  }
}

Note that the organization id can also be a number. You will see it in some responses.

Get activities for a program

Find the program id for Summer 2019. Say it is 777000. Enter the following request:

https://www.amilia.com/api/V3/en/org/forest-explorers/
programs/777000/activities

The request will have activity ids which will be used in the following steps. Say we look at Canoe and it has activity id 343434.

RESPONSE SAMPLE JSON
{
  "Items": [
    {
      "Description": "Group canoe on St. Louis Lake",
      "Prerequisite": "Swimming",
      "Note": "Flotation device is provided",
      "ThirdPartyUrl": "merch/activity",
      "AdditionalInformation": "Promotions not applicable",
      "Price": 0.0,
      "DropInPrice": 0.0,
      "Age": {
        "Max": 11,
        "Min": 8,
        "Months": false
      },
      "MaxAttendance": 5,
      "SpotsRemaining": 2,
      "SpotsReserved": 0,
      "NumberOfOccurrences": 1,
      "StartDate": "2020-01-18T00:00:00-05:00",
      "EndDate": "2020-01-18T00:00:00-05:00",
      "ScheduleSummary": "Tuesdays 13h-14h, 2 May to 27 August",
      "HasSessionEnabled": false,
      "HasDropInEnabled": false,
      "AgeSummary": "8-11",
      "Keywords": [
        {
          "Id": 50,
          "Name": "Canoeing"
        }
      ],
      "Groups": [
        {
          "Id": 1,
          "Name": "Sheila"
        },
        {
          "Id": 2,
          "Name": "David"
        }
      ],
      "OrganizationId": 0,
      "PictureUrl": "activity/picture.jpg",
      "Id": 343434,
      "Name": "Canoe",
      "ProgramId": 777000,
      "ProgramName": "Summer 2019",
      "CategoryId": 56777,
      "CategoryName": "Wednesdays",
      "SubCategoryId": 66788,
      "SubCategoryName": "Morning",
      "Url": "activity/2019/tuesdays",
      "Status": "Normal"
    },
    {
      "Description": "Fire-roasting a marshmallow with minimal risk",
      "Prerequisite": "First aid",
      "Note": "Marshmallows provided",
      "ThirdPartyUrl": "merch/activity",
      "AdditionalInformation": "Promotions not applicable",
      "Price": 0.0,
      "DropInPrice": 0.0,
      "Age": {
        "Max": 11,
        "Min": 8,
        "Months": false
      },
      "MaxAttendance": 5,
      "SpotsRemaining": 5,
      "SpotsReserved": 0,
      "NumberOfOccurrences": 1,
      "StartDate": "2020-01-18T00:00:00-05:00",
      "EndDate": "2020-01-18T00:00:00-05:00",
      "ScheduleSummary": "Tuesdays 13h-14h, 2 May to 27 August",
      "HasSessionEnabled": false,
      "HasDropInEnabled": false,
      "AgeSummary": "8-11",
      "Keywords": [
        {
          "Id": 0,
          "Name": ""
        }
      ],
      "Groups": [
        {
          "Id": 1,
          "Name": "Sheila"
        },
        {
          "Id": 2,
          "Name": "David"
        }
      ],
      "OrganizationId": 0,
      "PictureUrl": "activity/picture.jpg",
      "Id": 343477,
      "Name": "Responsible marshmallow roasting",
      "ProgramId": 777000,
      "ProgramName": "Summer 2019",
      "CategoryId": 56777,
      "CategoryName": "Wednesdays",
      "SubCategoryId": 66788,
      "SubCategoryName": "Morning",
      "Url": "activity/2019/tuesdays",
      "Status": "Normal"
    }
  ],
  "Paging": {
    "TotalCount": 2,
    "Next": ""
  }
}
Get persons in an activity

Using the previous activity id, enter this request:

https://www.amilia.com/api/V3/en/org/forest-explorers/
activities/343434/persons

The response will be a list of participants. If the response is paginated, you will get the number of participants from the Paging TotalCount at the bottom. Here the response is shown without contacts or skills for visual simplicity. We can see that the Canoe activity has three participants: Catherine, Anna and Emma.

RESPONSE SAMPLE JSON
{
  "Items": [
    {
      "OrganizationId": 7000,
      "AccountId": 98181,
      "AccountOwnerId": 4321234,
      "AccountOwnerFirstName": "George",
      "AccountOwnerLastName": "Messier",
      "AccountOwnerFullName": "George Messier",
      "AccountOwnerEmail": "gmessier@mymail.com",
      "IsArchived": false,
      "Contacts": [],
      "Skills": [],
      "Registrations": null,
      "MedicalInformation": null,
      "JoinDate": "2019-01-18",
      "PictureUrl": "picture/participant",
      "Id": 4141414,
      "FirstName": "Catherine",
      "LastName": "Messier",
      "FullName": "Catherine Messier",
      "Gender": "Female",
      "DateOfBirth": "2012-01-18",
      "Email": "Catherine@mymail.com",
      "Address": {
        "Latitude": 45.72,
        "Longitude": -73.5,
        "Address1": "111 rue des Saules",
        "Address2": "App. 2",
        "City": "Brossard",
        "Country": "Canada",
        "StateProvince": "QC",
        "ZipPostalCode": "J4S 1Z2"
      },
      "Telephone": "450 555 5555",
      "TelephoneMobile": null,
      "TelephoneWork": null,
      "TelephoneWorkExtension": null,
      "IsChild": true
    },
    {
      "OrganizationId": 7000,
      "AccountId": 98181,
      "AccountOwnerId": 4321234,
      "AccountOwnerFirstName": "George",
      "AccountOwnerLastName": "Messier",
      "AccountOwnerFullName": "George Messier",
      "AccountOwnerEmail": "gmessier@mymail.com",
      "IsArchived": false,
      "Contacts": [],
      "Skills": [],
      "Registrations": null,
      "MedicalInformation": null,
      "JoinDate": "2019-01-18",
      "PictureUrl": "picture/participant",
      "Id": 4141415,
      "FirstName": "Anna",
      "LastName": "Messier",
      "FullName": "Anna Messier",
      "Gender": "Female",
      "DateOfBirth": "2012-01-18",
      "Email": "Anna@mymail.com",
      "Address": {
        "Latitude": 45.72,
        "Longitude": -73.5,
        "Address1": "111 rue des Saules",
        "Address2": "App. 2",
        "City": "Brossard",
        "Country": "Canada",
        "StateProvince": "QC",
        "ZipPostalCode": "J4S 1Z2"
      },
      "Telephone": "450 555 5555",
      "TelephoneMobile": null,
      "TelephoneWork": null,
      "TelephoneWorkExtension": null,
      "IsChild": true
    },
    {
      "OrganizationId": 7000,
      "AccountId": 98181,
      "AccountOwnerId": 4321234,
      "AccountOwnerFirstName": "George",
      "AccountOwnerLastName": "Messier",
      "AccountOwnerFullName": "George Messier",
      "AccountOwnerEmail": "gmessier@mymail.com",
      "IsArchived": false,
      "Contacts": [],
      "Skills": [],
      "Registrations": null,
      "MedicalInformation": null,
      "JoinDate": "2019-01-18",
      "PictureUrl": "picture/participant",
      "Id": 4141416,
      "FirstName": "Emma",
      "LastName": "Messier",
      "FullName": "Emma Messier",
      "Gender": "Female",
      "DateOfBirth": "2012-01-18",
      "Email": "Emma@mymail.com",
      "Address": {
        "Latitude": 45.72,
        "Longitude": -73.5,
        "Address1": "111 rue des Saules",
        "Address2": "App. 2",
        "City": "Brossard",
        "Country": "Canada",
        "StateProvince": "QC",
        "ZipPostalCode": "J4S 1Z2"
      },
      "Telephone": "450 555 5555",
      "TelephoneMobile": null,
      "TelephoneWork": null,
      "TelephoneWorkExtension": null,
      "IsChild": true
    }
  ],
  "Paging": {
    "TotalCount": 3,
    "Next": ""
  }
}
Repeat for all other activities in the program

And count the number of participants in each activity.

Say we look at Responsible Marshmallow Roasting:

https://www.amilia.com/api/V3/en/org/forest-explorers/
activities/343477/persons

We get an empty response:

RESPONSE SAMPLE JSON
{
  "Items": [],
  "Paging": {
    "TotalCount": 0,
    "Next": ""
  }
}

The response returned empty because there were no participants in the activity. Joanne can then decide not to reconduct Responsible Marshmallow Roasting the following year.

Getting expired memberships

Organization

Context

Celine is an admin in an organization called Yoga Central and she wants to find expired memberships. She wants to contact the persons who purchased them in order to suggest a renewal of their membership.

Building the Amilia API integration

Authenticate the user in the API

First you need to authenticate.

https://www.amilia.com/api/V3/authenticate

The response will contain a token which you will need for all the following calls:

RESPONSE SAMPLE JSON
{
  "Token": "0000aaaa11bbbb4444hh8888rrrr.33dd4455ff.gggg6666"
}
Get all memberships for an organization

You will need the organization id, which is the rewriteUrl you set in your Amilia account under Options. Say the organization id here is yoga-central.

https://www.amilia.com/api/V3/en/org/yoga-central/memberships

This will return the memberships for Yoga Central:

RESPONSE SAMPLE JSON
{
  "Items": [
    {
      "Id": 8421,
      "OrganizationId": 2345,
      "Name": "Evening pass",
      "Description": "Access all the yoga classes given after 18h",
      "Price": 160.0,
      "Position": 0,
      "IsArchived": false,
      "IsVisible": true,
      "DateCreated": "2019-01-08",
      "MembershipType": "IndividualPerson",
      "LedgerCode": {
        "Id": 741,
        "Name": "Passes"
      },
      "Tags": [],
      "IndividualMembership": {
        "AgeRestriction": {
          "Age": {
            "AgeMin": 18,
            "AgeMax": 99,
            "IsAgeInMonths": false
          },
          "AgeRestrictionInDateOf": "2019-04-04"
        },
        "SkillsRestriction": null,
        "GenderRestriction": null,
        "FixedDates": null,
        "FixedDuration": null,
        "Merchandise": [],
        "ReplacementStatus": "Disabled",
        "ReplacementConstraints": null
      },
      "CorporateMembership": null
    },
    {
      "Id": 8428,
      "OrganizationId": 2345,
      "Name": "Morning pass",
      "Description": "Access all the yoga classes given before 9h",
      "Price": 160.0,
      "Position": 0,
      "IsArchived": false,
      "IsVisible": true,
      "DateCreated": "2019-01-08",
      "MembershipType": "IndividualPerson",
      "LedgerCode": {
        "Id": 741,
        "Name": "Passes"
      },
      "Tags": [],
      "IndividualMembership": {
        "AgeRestriction": {
          "Age": {
            "AgeMin": 18,
            "AgeMax": 99,
            "IsAgeInMonths": false
          },
          "AgeRestrictionInDateOf": "2019-04-04"
        },
        "SkillsRestriction": null,
        "GenderRestriction": null,
        "FixedDates": null,
        "FixedDuration": null,
        "Merchandise": [],
        "ReplacementStatus": "Disabled",
        "ReplacementConstraints": null
      },
      "CorporateMembership": null
    }
  ],
  "Paging": {
    "TotalCount": 2,
    "Next": ""
  }
}
Get a membership

Say you found the first returned membership has id 8421. Send the request below to get the persons in that membership:

https://www.amilia.com/api/V3/en/org/yoga-central/memberships/8421/persons?status=Expired

You will get a response with all the persons with that expired membership.

RESPONSE SAMPLE JSON
{
  "Items": [
    {
      "PurchasedDate": "2019-03-03",
      "EffectiveDate": "2019-05-01",
      "ExpirationDate": "2019-08-31",
      "OrganizationId": 7667,
      "AccountId": 125167,
      "AccountOwnerId": 77614,
      "AccountOwnerFirstName": "Corinne",
      "AccountOwnerLastName": "Delorme",
      "AccountOwnerFullName": "Corinne Delorme",
      "AccountOwnerEmail": "corinne@mymail.com",
      "IsArchived": false,
      "Contacts": null,
      "Skills": null,
      "MedicalInformation": null,
      "JoinDate": null,
      "PictureUrl": null,
      "Id": 90001,
      "FirstName": "Corinne",
      "LastName": "Delorme",
      "FullName": "Corinne Delorme",
      "Gender": "Female",
      "DateOfBirth": "1984-02-07",
      "Email": "corinne@mymail.com",
      "Address": {
        "Latitude": 45.53647,
        "Longitude": -73.54251,
        "Address1": "105 rue Delorme",
        "Address2": "",
        "City": "Laval",
        "Country": "Canada",
        "StateProvince": "QC",
        "ZipPostalCode": "H7A 0A4"
      },
      "Telephone": "514 555 5555",
      "TelephoneMobile": "514 555 4444",
      "TelephoneWork": "514 555 3333",
      "TelephoneWorkExtension": "111",
      "IsChild": false
    },
    {
      "PurchasedDate": "2019-03-03",
      "EffectiveDate": "2019-05-01",
      "ExpirationDate": "2019-08-31",
      "OrganizationId": 7667,
      "AccountId": 125176,
      "AccountOwnerId": 87114,
      "AccountOwnerFirstName": "Lorna",
      "AccountOwnerLastName": "Smith",
      "AccountOwnerFullName": "Lorna Smith",
      "AccountOwnerEmail": "lorna@mymail.com",
      "IsArchived": false,
      "Contacts": null,
      "Skills": null,
      "MedicalInformation": null,
      "JoinDate": null,
      "PictureUrl": null,
      "Id": 90002,
      "FirstName": "Lorna",
      "LastName": "Smith",
      "FullName": "Lorna Smith",
      "Gender": "Female",
      "DateOfBirth": "1984-02-05",
      "Email": "lorna@mymail.com",
      "Address": {
        "Latitude": 45.53647,
        "Longitude": -73.54251,
        "Address1": "110 rue Smith",
        "Address2": "",
        "City": "Laval",
        "Country": "Canada",
        "StateProvince": "QC",
        "ZipPostalCode": "H7A 0A4"
      },
      "Telephone": "514 555 5555",
      "TelephoneMobile": "514 555 4444",
      "TelephoneWork": "514 555 3333",
      "TelephoneWorkExtension": "111",
      "IsChild": false
    }
  ],
  "Paging": {
    "TotalCount": 2,
    "Next": ""
  }
}
Repeat for other memberships

Repeat the last step for all the organization's memberships.

Getting all standup paddling activities along the Montreal southern coast

Partner

Context

Florence wants to build an application to find all the standup paddling (SUP) activities and their occurrences within a perimeter surrounding the south side of the Montreal coast.

Building the Amilia API integration

Authenticate the user in the API

First you need to authenticate.

https://www.amilia.com/api/V3/authenticate

The response will contain a token which you will need for all the following calls.

RESPONSE SAMPLE JSON
{
  "Token": "0000aaaa11bbbb4444hh8888rrrr.33dd4455ff.gggg6666"
}
Make a list of geographical points encompassing the area.

This is done outside of our API. Say the area under consideration for the SUP-finding app is a polygon encompassing the following points, starting from the westernmost one and going clockwise:

  • the Honore-Mercier bridge in Lasalle (45.41298, -73.65284)
  • Hochelaga (45.53647, -73.54251)
  • the St. Lawrence River in front of Hochelaga (45.53647, -73.52947)
  • between the South Shore and St. Helen Island (45.48655, -73.51419)
  • the St. Lawrence River in front of La Prairie (45.41707, -73.51848)
  • another point in Lasalle slightly more to the South (45.40864, -73.63281)
Map with the polygon encompassing the St. Lawrence river around Montreal
Get keywords

SUP is related to a keyword. Enter this request to get the list of keywords:

https://www.amilia.com/api/v3/en/keywords

In the response we have a keyword for 'Surf SUP' and it is 248, so 248 will be used as the keyword id from now on.

RESPONSE SAMPLE JSON
[
  {
    "Id": 70,
    "Name": "Soccer"
  },
  {
    "Id": 248,
    "Name": "Surf SUP"
  },
  {
    "Id": 87,
    "Name": "Surfing"
  },
  {
    "Id": 19,
    "Name": "Baseball"
  },
  {
    "Id": 15,
    "Name": "Marathon"
  }
]
Get locations

For this you will need to do a search by polygon with the above geographical points and the keyword id.

https://www.amilia.com/api/v3/en/locations?type=Polygon
&coordinates=45.41298,-73.65284,45.53647,-73.54251,
45.53647,-73.52947,45.48655,-73.51419,
45.41707,-73.51848,45.40864,-73.63281 &keywordId=248

This will return a list of locations where SUP happens. You will need the location ids for the next call.

RESPONSE SAMPLE JSON
{
  "Items": [
    {
      "FullName": "Surfing Company Verdun",
      "Description": "Surfing and standup paddling",
      "Telephone": "514 555 5555",
      "TelephoneExtension": "333",
      "ParentId": null,
      "TopParentId": null,
      "AncestorIds": null,
      "Keywords": [
        {
          "Id": 87,
          "Name": "Surfing"
        },
        {
          "Id": 248,
          "Name": "Surf SUP"
        }
      ],
      "Address": {
        "Latitude": 45.72,
        "Longitude": -73.5,
        "Address1": "6510 Boulevard LaSalle",
        "Address2": "",
        "City": "Verdun",
        "Country": "Canada",
        "StateProvince": "QC",
        "ZipPostalCode": "H4H 2S9"
      },
      "Id": 821128,
      "Name": "Surf co. - Verdun"
    },
    {
      "FullName": "Surfing Company - Parc Jean Drapeau",
      "Description": "Standup paddling",
      "Telephone": "514 555 5555",
      "TelephoneExtension": "333",
      "ParentId": null,
      "TopParentId": null,
      "AncestorIds": null,
      "Keywords": [
        {
          "Id": 248,
          "Name": "Surf SUP"
        }
      ],
      "Address": {
        "Latitude": 45.72,
        "Longitude": -73.5,
        "Address1": "Circuit Gilles Villeneuve",
        "Address2": "",
        "City": "Montreal",
        "Country": "Canada",
        "StateProvince": "QC",
        "ZipPostalCode": "H3C 4W7"
      },
      "Id": 821239,
      "Name": "Surf co. - Parc Jean Drapeau"
    }
  ],
  "Paging": {
    "TotalCount": 2,
    "Next": ""
  }
}
Get activities by location

Say one of the location ids is 821128. Enter this request:

https://www.amilia.com/api/v3/en/locations/821128/
activities?keywordId=248

You will get the SUP activities. You will need their id for the next request.

RESPONSE SAMPLE JSON
{
  "Items": [
    {
      "Description": "Standup paddling on the St. Lawrence River",
      "Prerequisite": "Swimming",
      "Note": "Flotation device and surf board are provided",
      "ThirdPartyUrl": "merch/activity",
      "AdditionalInformation": "Promotions not applicable",
      "Price": 0.0,
      "DropInPrice": 0.0,
      "Age": {
        "Max": 99,
        "Min": 18,
        "Months": false
      },
      "MaxAttendance": 5,
      "SpotsRemaining": 3,
      "SpotsReserved": 0,
      "NumberOfOccurrences": 2,
      "StartDate": "2020-01-18T00:00:00-05:00",
      "EndDate": "2020-01-18T00:00:00-05:00",
      "ScheduleSummary": "Tuesdays 13h-14h, 2 May to 27 August",
      "HasSessionEnabled": false,
      "HasDropInEnabled": false,
      "AgeSummary": "18-99",
      "Keywords": [
        {
          "Id": 248,
          "Name": "Surf SUP"
        }
      ],
      "Groups": [
        {
          "Id": 1,
          "Name": "Sheila"
        },
        {
          "Id": 2,
          "Name": "David"
        }
      ],
      "OrganizationId": 0,
      "PictureUrl": "activity/picture.jpg",
      "Id": 121212,
      "Name": "Standup paddling",
      "ProgramId": 102030,
      "ProgramName": "Summer 2019",
      "CategoryId": 56777,
      "CategoryName": "Adults",
      "SubCategoryId": 66788,
      "SubCategoryName": "Group standup paddling",
      "Url": "activity/2019/tuesdays",
      "Status": "Normal"
    },
    {
      "Description": "Standup paddling on the St. Lawrence River",
      "Prerequisite": "Swimming",
      "Note": "Flotation device and surf board are provided",
      "ThirdPartyUrl": "merch/activity",
      "AdditionalInformation": "Promotions not applicable",
      "Price": 0.0,
      "DropInPrice": 0.0,
      "Age": {
        "Max": 17,
        "Min": 12,
        "Months": false
      },
      "MaxAttendance": 5,
      "SpotsRemaining": 3,
      "SpotsReserved": 0,
      "NumberOfOccurrences": 2,
      "StartDate": "2020-01-18T00:00:00-05:00",
      "EndDate": "2020-01-18T00:00:00-05:00",
      "ScheduleSummary": "Tuesdays 13h-14h, 2 May to 27 August",
      "HasSessionEnabled": false,
      "HasDropInEnabled": false,
      "AgeSummary": "12-17",
      "Keywords": [
        {
          "Id": 248,
          "Name": "Surf SUP"
        }
      ],
      "Groups": [
        {
          "Id": 1,
          "Name": "Sheila"
        },
        {
          "Id": 2,
          "Name": "David"
        }
      ],
      "OrganizationId": 0,
      "PictureUrl": "activity/picture.jpg",
      "Id": 121323,
      "Name": "Standup paddling",
      "ProgramId": 421421,
      "ProgramName": "Summer 2019",
      "CategoryId": 56777,
      "CategoryName": "Teenagers",
      "SubCategoryId": 66788,
      "SubCategoryName": "Standup paddling with Paul",
      "Url": "activity/2019/tuesdays",
      "Status": "Normal"
    }
  ],
  "Paging": {
    "TotalCount": 2,
    "Next": ""
  }
}
Get an activity's occurrences

Using the first returned activity id, 121212, enter this request to get its occurrences:

https://www.amilia.com/api/V3/en/activities/
121212/occurrences

The response will be:

RESPONSE SAMPLE JSON
{
  "Items": [
    {
      "ActivityId": 121212,
      "Start": "2020-01-18T18:46:58.2521302-05:00",
      "End": "2020-01-18T19:46:58.2521302-05:00",
      "State": "Normal",
      "Id": 999,
      "Location": {
        "Id": 821128,
        "Name": "Cabane 2"
      },
      "Staff": []
    },
    {
      "ActivityId": 121212,
      "Start": "2020-01-25T18:46:58.2521302-05:00",
      "End": "2020-01-25T19:46:58.2521302-05:00",
      "State": "Normal",
      "Id": 1000,
      "Location": {
        "Id": 821128,
        "Name": "Cabane 2"
      },
      "Staff": []
    }
  ],
  "Paging": {
    "TotalCount": 2,
    "Next": ""
  }
}
Repeat for the other activities in that location and then for the other locations

Repeat the occurrence step for all activities, and then repeat the activities and occurrences steps for all locations.