Products¶
The products API allows you to retrieve a list of products including courses, accommodation, optional extras and transfers. You need to authenticate using an API Key in order to call this service; see the Authentication section for further details
- URL
/v1/product/products
- HTTP Method
GET
- Client Library Message Name
Product.GetProductsRequest
Request parameters | |||
---|---|---|---|
Name | Type | Required? | Description |
WithProductTypes | array | No | See section Filter products by product types |
WithAvailabilityDatesAfter | date | No | See section Filter products that are available after a specified date |
Get all products¶
Sample request¶
Error
Failed to run contract transformer command: bin\Api.ContractTransformer.exe
{ }
Sample response¶
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Cache-Control: no-cache
Content-Length: 1791
{
"Results": [
{
"ProductOfferingsUrl": "https://api.ecenglish.com/v1/product/offerings?withProducts=C1",
"Code": "C1",
"Name": "General English",
"Type": "Course",
"UnitType": "Weeks",
"Properties": {
"LessonsPerWeek": "20",
"Language": "English",
"Category": "General English"
}
},
{
"ProductOfferingsUrl": "https://api.ecenglish.com/v1/product/offerings?withProducts=H1",
"Code": "H1",
"Name": "Homestay, Single room, Half board",
"Type": "Accommodation",
"UnitType": "Weeks",
"Properties": {
"Accommodation": "Homestay",
"Room": "Single room",
"Board": "Half board"
}
},
{
"ProductOfferingsUrl": "https://api.ecenglish.com/v1/product/offerings?withProducts=R11",
"Code": "R11",
"Name": "New Yorker Residence, Twin room, Ensuite, Self catering",
"Type": "Accommodation",
"UnitType": "Weeks",
"Properties": {
"Accommodation": "Residence",
"Room": "Twin room",
"Bathroom": "Ensuite",
"Board": "Self catering",
"Residence": "New Yorker Residence",
"MinimumAge": "16",
"MinimumStayInWeeks": "1"
}
},
{
"ProductOfferingsUrl": "https://api.ecenglish.com/v1/product/offerings?withProducts=T27",
"Code": "T27",
"Name": "JFK International Airport - Arrival",
"Type": "Transfer",
"UnitType": "SingleItemOnly",
"Properties": {
"Direction": "Arrival",
"Port": "JFK International Airport",
"PortType": "Airport"
}
}
],
"NextPage": "https://api.ecenglish.com/v1/paging/AGQAcAECe30KCXRleHQvaHRtbA~~?format=json"
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
Cache-Control: no-cache
Content-Length: 4310
<GetProductsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/EcEnglish.Api.ServiceContract.Product">
<NextPage xmlns="http://schemas.datacontract.org/2004/07/EcEnglish.Api.ServiceContract">https://api.ecenglish.com/v1/paging/AGQAcAECe30KCXRleHQvaHRtbA~~?format=json</NextPage>
<Results xmlns:d2p1="http://schemas.datacontract.org/2004/07/EcEnglish.Api.ServiceContract.Product" xmlns="http://schemas.datacontract.org/2004/07/EcEnglish.Api.ServiceContract">
<d2p1:ProductWithOfferingsLink>
<d2p1:Code>C1</d2p1:Code>
<d2p1:Name>General English</d2p1:Name>
<d2p1:Properties xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>LessonsPerWeek</d4p1:Key>
<d4p1:Value>20</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Language</d4p1:Key>
<d4p1:Value>English</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Category</d4p1:Key>
<d4p1:Value>General English</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</d2p1:Properties>
<d2p1:Type>Course</d2p1:Type>
<d2p1:UnitType>Weeks</d2p1:UnitType>
<d2p1:ProductOfferingsUrl>https://api.ecenglish.com/v1/product/offerings?withProducts=C1</d2p1:ProductOfferingsUrl>
</d2p1:ProductWithOfferingsLink>
<d2p1:ProductWithOfferingsLink>
<d2p1:Code>H1</d2p1:Code>
<d2p1:Name>Homestay, Single room, Half board</d2p1:Name>
<d2p1:Properties xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Accommodation</d4p1:Key>
<d4p1:Value>Homestay</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Room</d4p1:Key>
<d4p1:Value>Single room</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Board</d4p1:Key>
<d4p1:Value>Half board</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</d2p1:Properties>
<d2p1:Type>Accommodation</d2p1:Type>
<d2p1:UnitType>Weeks</d2p1:UnitType>
<d2p1:ProductOfferingsUrl>https://api.ecenglish.com/v1/product/offerings?withProducts=H1</d2p1:ProductOfferingsUrl>
</d2p1:ProductWithOfferingsLink>
<d2p1:ProductWithOfferingsLink>
<d2p1:Code>R11</d2p1:Code>
<d2p1:Name>New Yorker Residence, Twin room, Ensuite, Self catering</d2p1:Name>
<d2p1:Properties xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Accommodation</d4p1:Key>
<d4p1:Value>Residence</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Room</d4p1:Key>
<d4p1:Value>Twin room</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Bathroom</d4p1:Key>
<d4p1:Value>Ensuite</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Board</d4p1:Key>
<d4p1:Value>Self catering</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Residence</d4p1:Key>
<d4p1:Value>New Yorker Residence</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>MinimumAge</d4p1:Key>
<d4p1:Value>16</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>MinimumStayInWeeks</d4p1:Key>
<d4p1:Value>1</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</d2p1:Properties>
<d2p1:Type>Accommodation</d2p1:Type>
<d2p1:UnitType>Weeks</d2p1:UnitType>
<d2p1:ProductOfferingsUrl>https://api.ecenglish.com/v1/product/offerings?withProducts=R11</d2p1:ProductOfferingsUrl>
</d2p1:ProductWithOfferingsLink>
<d2p1:ProductWithOfferingsLink>
<d2p1:Code>T27</d2p1:Code>
<d2p1:Name>JFK International Airport - Arrival</d2p1:Name>
<d2p1:Properties xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Direction</d4p1:Key>
<d4p1:Value>Arrival</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Port</d4p1:Key>
<d4p1:Value>JFK International Airport</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>PortType</d4p1:Key>
<d4p1:Value>Airport</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</d2p1:Properties>
<d2p1:Type>Transfer</d2p1:Type>
<d2p1:UnitType>SingleItemOnly</d2p1:UnitType>
<d2p1:ProductOfferingsUrl>https://api.ecenglish.com/v1/product/offerings?withProducts=T27</d2p1:ProductOfferingsUrl>
</d2p1:ProductWithOfferingsLink>
</Results>
</GetProductsResponse>
Filter products by product types¶
It is possible to only return products with specific product types using the WithProductTypes request parameter.
- The available product type values are as follows:
- Course
- Accommodation
- OptionalExtra
- Transfer
The sample below requests only Course and Transfer products.
Sample request¶
Error
Failed to run contract transformer command: bin\Api.ContractTransformer.exe
{ "WithProductTypes": ["Course","Transfer"] }
Sample response¶
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Cache-Control: no-cache
Content-Length: 868
{
"Results": [
{
"ProductOfferingsUrl": "https://api.ecenglish.com/v1/product/offerings?withProducts=C1",
"Code": "C1",
"Name": "General English",
"Type": "Course",
"UnitType": "Weeks",
"Properties": {
"LessonsPerWeek": "20",
"Language": "English",
"Category": "General English"
}
},
{
"ProductOfferingsUrl": "https://api.ecenglish.com/v1/product/offerings?withProducts=T27",
"Code": "T27",
"Name": "JFK International Airport - Arrival",
"Type": "Transfer",
"UnitType": "SingleItemOnly",
"Properties": {
"Direction": "Arrival",
"Port": "JFK International Airport",
"PortType": "Airport"
}
}
],
"NextPage": "https://api.ecenglish.com/v1/paging/AGQAcAECe30KCXRleHQvaHRtbA~~?format=json"
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
Cache-Control: no-cache
Content-Length: 2183
<GetProductsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/EcEnglish.Api.ServiceContract.Product">
<NextPage xmlns="http://schemas.datacontract.org/2004/07/EcEnglish.Api.ServiceContract">https://api.ecenglish.com/v1/paging/AGQAcAECe30KCXRleHQvaHRtbA~~?format=json</NextPage>
<Results xmlns:d2p1="http://schemas.datacontract.org/2004/07/EcEnglish.Api.ServiceContract.Product" xmlns="http://schemas.datacontract.org/2004/07/EcEnglish.Api.ServiceContract">
<d2p1:ProductWithOfferingsLink>
<d2p1:Code>C1</d2p1:Code>
<d2p1:Name>General English</d2p1:Name>
<d2p1:Properties xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>LessonsPerWeek</d4p1:Key>
<d4p1:Value>20</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Language</d4p1:Key>
<d4p1:Value>English</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Category</d4p1:Key>
<d4p1:Value>General English</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</d2p1:Properties>
<d2p1:Type>Course</d2p1:Type>
<d2p1:UnitType>Weeks</d2p1:UnitType>
<d2p1:ProductOfferingsUrl>https://api.ecenglish.com/v1/product/offerings?withProducts=C1</d2p1:ProductOfferingsUrl>
</d2p1:ProductWithOfferingsLink>
<d2p1:ProductWithOfferingsLink>
<d2p1:Code>T27</d2p1:Code>
<d2p1:Name>JFK International Airport - Arrival</d2p1:Name>
<d2p1:Properties xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Direction</d4p1:Key>
<d4p1:Value>Arrival</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Port</d4p1:Key>
<d4p1:Value>JFK International Airport</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>PortType</d4p1:Key>
<d4p1:Value>Airport</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</d2p1:Properties>
<d2p1:Type>Transfer</d2p1:Type>
<d2p1:UnitType>SingleItemOnly</d2p1:UnitType>
<d2p1:ProductOfferingsUrl>https://api.ecenglish.com/v1/product/offerings?withProducts=T27</d2p1:ProductOfferingsUrl>
</d2p1:ProductWithOfferingsLink>
</Results>
</GetProductsResponse>
Filter products that are available after a specified date¶
It is possible to only return products that are available after a specified date using the WithAvailabilityDatesAfter request parameter.
The sample below requests only products that are available after the 17th January 2016.
Sample request¶
Error
Failed to run contract transformer command: bin\Api.ContractTransformer.exe
{ "WithAvailabilityDatesAfter": "2016-01-17" }
Sample response¶
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Cache-Control: no-cache
Content-Length: 828
{
"Results": [
{
"ProductOfferingsUrl": "https://api.ecenglish.com/v1/product/offerings?withProducts=C1",
"Code": "C1",
"Name": "General English",
"Type": "Course",
"UnitType": "Weeks",
"Properties": {
"LessonsPerWeek": "20",
"Language": "English",
"Category": "General English"
}
},
{
"ProductOfferingsUrl": "http://localhost:23121/v1/product/offerings?withProducts=C4",
"Code": "C4",
"Name": "Intensive English",
"Type": "Course",
"UnitType": "Weeks",
"Properties": {
"LessonsPerWeek": "30",
"Language": "English",
"Category": "General English"
}
}
],
"NextPage": "https://api.ecenglish.com/v1/paging/AGQAcAECe30KCXRleHQvaHRtbA~~?format=json"
}
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
Cache-Control: no-cache
Content-Length: 2143
<GetProductsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/EcEnglish.Api.ServiceContract.Product">
<NextPage xmlns="http://schemas.datacontract.org/2004/07/EcEnglish.Api.ServiceContract">https://api.ecenglish.com/v1/paging/AGQAcAECe30KCXRleHQvaHRtbA~~?format=json</NextPage>
<Results xmlns:d2p1="http://schemas.datacontract.org/2004/07/EcEnglish.Api.ServiceContract.Product" xmlns="http://schemas.datacontract.org/2004/07/EcEnglish.Api.ServiceContract">
<d2p1:ProductWithOfferingsLink>
<d2p1:Code>C1</d2p1:Code>
<d2p1:Name>General English</d2p1:Name>
<d2p1:Properties xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>LessonsPerWeek</d4p1:Key>
<d4p1:Value>20</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Language</d4p1:Key>
<d4p1:Value>English</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Category</d4p1:Key>
<d4p1:Value>General English</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</d2p1:Properties>
<d2p1:Type>Course</d2p1:Type>
<d2p1:UnitType>Weeks</d2p1:UnitType>
<d2p1:ProductOfferingsUrl>https://api.ecenglish.com/v1/product/offerings?withProducts=C1</d2p1:ProductOfferingsUrl>
</d2p1:ProductWithOfferingsLink>
<d2p1:ProductWithOfferingsLink>
<d2p1:Code>C4</d2p1:Code>
<d2p1:Name>Intensive English</d2p1:Name>
<d2p1:Properties xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>LessonsPerWeek</d4p1:Key>
<d4p1:Value>30</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Language</d4p1:Key>
<d4p1:Value>English</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Category</d4p1:Key>
<d4p1:Value>General English</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</d2p1:Properties>
<d2p1:Type>Course</d2p1:Type>
<d2p1:UnitType>Weeks</d2p1:UnitType>
<d2p1:ProductOfferingsUrl>http://localhost:23121/v1/product/offerings?withProducts=C4</d2p1:ProductOfferingsUrl>
</d2p1:ProductWithOfferingsLink>
</Results>
</GetProductsResponse>