Reference data¶
The reference data API allows you to retrieve a list of data items, such as a list of countries or language levels that will be required when calling other API services. You need to authenticate using an API Key in order to call this service; see the Authentication section for further details
- URL
/v1/reference-data
- HTTP Method
GET
- Client Library Message Name
Product.GetReferenceDataRequest
Request parameters | |||
---|---|---|---|
Name | Type | Required? | Description |
WithDataTypes | array | Yes | See section Get reference data by data types |
Get reference data by data types¶
When using the reference data API you must supply a list of data types to specify which reference data items are required.
- The available data type values are as follows:
- Country
- LanguageLevel
The sample below requests countries and language levels.
Sample request¶
Error
Failed to run contract transformer command: bin\Api.ContractTransformer.exe
{ "WithDataTypes": ["Country","LanguageLevel"] }
Sample response¶
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Cache-Control: no-cache
Content-Length: 734
{
"Results": [
{
"Type": "Country",
"Code": "GB",
"Name": "United Kingdom",
"Properties": {}
},
{
"Type": "Country",
"Code": "US",
"Name": "United States",
"Properties": {}
},
{
"Type": "LanguageLevel",
"Code": "Advanced",
"Name": "Advanced",
"Properties": {
"CefrLevel": "C1",
"Sequence": "7"
}
},
{
"Type": "LanguageLevel",
"Code": "Proficiency",
"Name": "Proficiency",
"Properties": {
"CefrLevel": "C2",
"Sequence": "8"
}
}
],
"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: 1993
<GetReferenceDataResponse 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:ReferenceData>
<d2p1:Code>GB</d2p1:Code>
<d2p1:Name>United Kingdom</d2p1:Name>
<d2p1:Properties xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
<d2p1:Type>Country</d2p1:Type>
</d2p1:ReferenceData>
<d2p1:ReferenceData>
<d2p1:Code>US</d2p1:Code>
<d2p1:Name>United States</d2p1:Name>
<d2p1:Properties xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
<d2p1:Type>Country</d2p1:Type>
</d2p1:ReferenceData>
<d2p1:ReferenceData>
<d2p1:Code>Advanced</d2p1:Code>
<d2p1:Name>Advanced</d2p1:Name>
<d2p1:Properties xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>CefrLevel</d4p1:Key>
<d4p1:Value>C1</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Sequence</d4p1:Key>
<d4p1:Value>7</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</d2p1:Properties>
<d2p1:Type>LanguageLevel</d2p1:Type>
</d2p1:ReferenceData>
<d2p1:ReferenceData>
<d2p1:Code>Proficiency</d2p1:Code>
<d2p1:Name>Proficiency</d2p1:Name>
<d2p1:Properties xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>CefrLevel</d4p1:Key>
<d4p1:Value>C2</d4p1:Value>
</d4p1:KeyValueOfstringstring>
<d4p1:KeyValueOfstringstring>
<d4p1:Key>Sequence</d4p1:Key>
<d4p1:Value>8</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</d2p1:Properties>
<d2p1:Type>LanguageLevel</d2p1:Type>
</d2p1:ReferenceData>
</Results>
</GetReferenceDataResponse>