# API expressivity

Available in...

* Cloud API Services Platform
* Cloud Big Data
* Cloud Big Data Platform
* Cloud Data Fabric
* Cloud Data Integration
* Cloud Data Management Platform
* Cloud Pipeline Designer Standard Edition
* Data Fabric

Use the supported OData expressivity to refine your request and retrieve specific data from your dataset. For more information, see the [OData documentation](https://www.odata.org/getting-started/).

## Supported OData expressivity

The following expressivity patterns can be used to craft specific requests.

Information noteNote: Using an unsupported option in an OData request will result in a 501 - Not Implemented error.

* url/$metadata
* url/entity\_set\_name
* url/entity\_set\_name(primary\_key\_value)
* url/entity\_set\_name(primary\_key\_value)/column\_name
* url/entity\_set\_name(primary\_key\_value)/column\_name/$value
* url/entity\_set\_name?$top=n
* url/entity\_set\_name?$skip=n
* url/entity\_set\_name?$skip=n&$top=n
* url/entity\_set\_name?$select=column\_name
* url/entity\_set\_name?$orderby=column\_name asc|desc
* url/entity\_set\_name?$filter=column\_name eq 'value'
* url/entity\_set\_name?$filter=contains(column\_name, 'value')

## Examples of requests

The following table shows a few examples of requests that can be sent to your API. In this example, an API was created for the entity set named customers and the API path generated is customers-api-2PZPTB. The dataset contains columns named customer\_age, id, customer\_name, customer\_city and customer\_street, and the column id is used as the primary key.

Examples of patterns in requests and their responsesExamples of patterns in requests and their responses

| Pattern | Description | Example |
| --- | --- | --- |
| url/entity\_set\_name | Get all data in the entity set. | Request:<br><br>```<br>https://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/customers<br>```<br><br>Response:<br><br>```<br>{<br>	"@odata.context": "http://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/$metadata#customers",<br>	"value": [<br>		{<br>			"customer_age": "36",<br>			"id": "g9wjC",<br>			"customer_name": "Franklin Washington",<br>			"customer_city": "Olympia",<br>			"customer_street": "North Erringer Road"<br>		},<br>		{<br>			"customer_age": "31",<br>			"id": "DNOFp",<br>			"customer_name": "Theodore Ford",<br>			"customer_city": "Boise",<br>			"customer_street": "Lawrenceville Suwanee"<br>		},<br>		{<br>			"customer_age": "41",<br>			"id": "IRvgp",<br>			"customer_name": "Gerald Cleveland",<br>			"customer_city": "Atlanta",<br>			"customer_street": "Steele Lane"<br>		},<br>		{<br>			"customer_age": "19",<br>			"id": "V7o2h",<br>			"customer_name": "Benjamin Adams",<br>			"customer_city": "Little Rock",<br>			"customer_street": "Castillo Drive"<br>		},<br>		{<br>			"customer_age": "56",<br>			"id": "LwvLC",<br>			"customer_name": "Theodore Hayes",<br>			"customer_city": "Saint Paul",<br>			"customer_street": "Carpinteria South"<br>		},<br>		{<br>			"customer_age": "22",<br>			"id": "2oWSU",<br>			"customer_name": "Harry Roosevelt",<br>			"customer_city": "Bismarck",<br>			"customer_street": "East Calle Primera"<br>		},<br>		{<br>			"customer_age": "68",<br>			"id": "tnXgw",<br>			"customer_name": "Rutherford Fillmore",<br>			"customer_city": "Cheyenne",<br>			"customer_street": "Jean de la Fontaine"<br>		}<br>	]<br>}<br>``` |
| url/$metadata | Get the entity set's metadata. | Request:<br><br>```<br>https://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/$metadata<br>```<br><br>Response:<br><br>```<br><?xml version="1.0" encoding="UTF-8" ?><br><edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"><br><edmx:DataServices><br><Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="customers-api-2PZPTB"><br><EntityType Name="customersItem"><br><Key><br><PropertyRef Name="id"/><br></Key><br><Property Name="customer_age" Type="Edm.String"/><br><Property Name="id" Type="Edm.String"/><br><Property Name="customer_name" Type="Edm.String"/><br><Property Name="customer_city" Type="Edm.String"/><br><Property Name="customer_street" Type="Edm.String"/><br></EntityType><br><EntityContainer Name="customers"><br><EntitySet Name="customers" EntityType="customers-api-2PZPTB.customersItem"/><br></EntityContainer><br></Schema><br></edmx:DataServices><br></edmx:Edmx><br><br>``` |
| url/entity\_set\_name(primary\_key\_value) | Get a specific entity using its primary key value. | Request:<br><br>```<br>https://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/customers('g9wjC')<br>```<br><br>Response:<br><br>```<br>{<br>"@odata.context": "http://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/$metadata#customers",<br>"customer_age": "36",<br>"id": "g9wjC",<br>"customer_name": "Franklin Washington",<br>"customer_city": "Olympia",<br>"customer_street": "North Erringer Road"<br>}<br>``` |
| url/entity\_set\_name(primary\_key\_value)/column\_name | Get a single column for a specific entity. | Request:<br><br>```<br>https://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/customers('g9wjC')/customer_name<br>```<br><br>Response:<br><br>```<br>{<br>"@odata.context": "http://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/$metadata#customers/customer_name",<br>"value": "Franklin Washington"<br>}<br>``` |
| url/entity\_set\_name(primary\_key\_value)/column\_name/$value | Get a column's raw value for a specific entity. | Request:<br><br>```<br>https://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/customers('g9wjC')/customer_city/$value<br>```<br><br>Response:<br><br>```<br>Olympia<br>``` |
| url/entity\_set\_name?$top=n | Get a limited number of entities. | Request:<br><br>```<br>https://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/customers?$top=2<br>```<br><br>Response:<br><br>```<br>{<br>"@odata.context": "http://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/$metadata#customers",<br>"value": [<br>{<br>"customer_age": "36",<br>"id": "g9wjC",<br>"customer_name": "Franklin Washington",<br>"customer_city": "Olympia",<br>"customer_street": "North Erringer Road"<br>},<br>{<br>"customer_age": "31",<br>"id": "DNOFp",<br>"customer_name": "Theodore Ford",<br>"customer_city": "Boise",<br>"customer_street": "Lawrenceville Suwanee"<br>}<br>]<br>}<br>``` |
| url/entity\_set\_name?$skip=n | Get a collection of entities, skipping the first n<br>entities. | Request:<br><br>```<br>https://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/customers?$skip=5<br>```<br><br>Response:<br><br>```<br>{<br>"@odata.context": "http://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/$metadata#customers",<br>"value":[<br>{<br>"customer_age": "22",<br>"id": "2oWSU",<br>"customer_name": "Harry Roosevelt",<br>"customer_city": "Bismarck",<br>"customer_street": "East Calle Primera"<br>},<br>{<br>"customer_age": "68",<br>"id": "tnXgw",<br>"customer_name": "Rutherford Fillmore",<br>"customer_city": "Cheyenne",<br>"customer_street": "Jean de la Fontaine"<br>},<br>{<br>"customer_age": "40",<br>"id": "QcX7L",<br>"customer_name": "Warren Adams",<br>"customer_city": "Columbus",<br>"customer_street": "North Broadway Street"<br>}<br>]<br>}<br>``` |
| url/entity\_set\_name?$skip=n&$top=n | Create a pagination and get a specific page of entities from a<br>collection. | Request:<br><br>```<br>https://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/customers?$skip=5&$top=2<br>```<br><br>Response:<br><br>```<br>{<br>"@odata.context": "http://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/$metadata#customers",<br>"value": [<br>{<br>"customer_age": "22",<br>"id": "2oWSU",<br>"customer_name": "Harry Roosevelt",<br>"customer_city": "Bismarck",<br>"customer_street": "East Calle Primera"<br>},<br>{<br>"customer_age": "68",<br>"id": "tnXgw",<br>"customer_name": "Rutherford Fillmore",<br>"customer_city": "Cheyenne",<br>"customer_street": "Jean de la Fontaine"<br>}<br>]<br>}<br>``` |
| url/entity\_set\_name?$select=column\_name | Get only certain attributes of entities.<br><br>Information noteNote: The column used as<br>primary key is always included. | Request:<br><br>```<br>https://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/customers?$select=customer_city,customer_street<br>```<br><br>Response:<br><br>```<br>{<br>"@odata.context": "http://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/$metadata#customers",<br>"value": [<br>{<br>"@odata.id": "customers('g9wjC')",<br>"id": "g9wjC",<br>"customer_city": "Olympia",<br>"customer_street": "North Erringer Road"<br>},<br>{<br>"@odata.id": "customers('DNOFp')",<br>"id": "DNOFp",<br>"customer_city": "Boise",<br>"customer_street": "Lawrenceville Suwanee"<br>},<br>{<br>"@odata.id": "customers('IRvgp')",<br>"id": "IRvgp",<br>"customer_city": "Atlanta",<br>"customer_street": "Steele Lane"<br>}<br>]<br>}<br>``` |
| url/entity\_set\_name?$orderby=column\_name<br>asc\|desc | Get a collection of entities in a specific order using one or multiple<br>attributes. The two possible values for this option are asc and<br>desc. | Request:<br><br>```<br>https://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/customers?$orderby=customer_age desc<br>```<br><br>Response:<br><br>```<br>{<br>"@odata.context": "http://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/$metadata#customers",<br>"value": [<br>{<br>"customer_age": "78",<br>"id": "2lxMe",<br>"customer_name": "Thomas Johnson",<br>"customer_city": "Charleston",<br>"customer_street": "Redwood Highway"<br>},<br>{<br>"customer_age": "75",<br>"id": "EK0fU",<br>"customer_name": "Benjamin Jefferson",<br>"customer_city": "Austin",<br>"customer_street": "Monroe Street"<br>},<br>{<br>"customer_age": "70",<br>"id": "3Wmih",<br>"customer_name": "Grover Carter",<br>"customer_city": "Dover",<br>"customer_street": "Redwood Highway"<br>}<br>]<br>}<br>``` |
| url/entity\_set\_name?$filter=column\_name<br>eq 'value' | Get a collection of entities corresponding to a filter. | Request:<br><br>```<br>https://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/customers?$filter=customer_city eq 'Olympia'<br>```<br><br>Response:<br><br>```<br>{<br>"@odata.context": "http://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/$metadata#customers",<br>"value":[<br>{<br>"customer_age": "36",<br>"id": "g9wjC",<br>"customer_name": "Franklin Washington",<br>"customer_city": "Olympia",<br>"customer_street": "North Erringer Road"<br>},<br>{<br>"customer_age": "68",<br>"id": "EVFMD",<br>"customer_name": "Ronald Van Buren",<br>"customer_city": "Olympia",<br>"customer_street": "Bayshore Freeway"<br>}<br>]<br>}<br>```<br><br>Information noteNote: Depending on the tool used to call the API, you may get an error<br>if spaces are encoded with plus signs (+). To avoid this issue,<br>make sure that spaces are encoded in Percent-encoding as<br>%20. |
| url/entity\_set\_name?$filter=contains(column\_name,<br>'value') | Get a collection of entities corresponding to a filter where the<br>column\_name contains a certain<br>'value' | Request:<br><br>```<br>https://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/customers?$filter=contains(customer_name, 'Van')<br>```<br><br>Response:<br><br>```<br>{<br>"@odata.context": "http://company-talend-com.eu.talend-dataset.com/apis/customers-api-2PZPTB/$metadata#customers",<br>"value":[<br>{<br>"customer_age": "68",<br>"id": "EVFMD",<br>"customer_name": "Ronald Van Buren",<br>"customer_city": "Olympia",<br>"customer_street": "Bayshore Freeway"<br>}<br>]<br>}<br>``` |