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"
}

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"
}

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"
}