Read all Thing Types
With this method, you can retrieve all thing types.
This method retrieves all thing types to which the user has access authorization. It includes thing types from all packages from the same tenant.
In addition, you can retrieve a subset of all thing types, according to the filter criteria provided. For a collective request for a set of thing types, you have these options:
-
You can restrict the set of thing types to be retrieved by filter criteria based on the thing type name, description, and extended thing type name.
-
You can define that the set of matching thing types shall not be transmitted all at once, but in a paged manner so that only a small number of results is transmitted, thereby reducing the server load.
By default, the service displays a maximum of 500 records per response. You can navigate to the next set of results, if available, using the __next link at the end in the response payload. However, the number of records retrieved depends on the query parameter $top, if provided in the request URL. For more information, see Retrieving List of Records.
Request
URI: /ThingConfiguration/v1/ThingTypes
Operation Type: CRUD
HTTP Method: GET
Permissions: <thingconf>.r
Request Headers
| Header | Required | Values |
|---|---|---|
| Accept-Language | No | Language of the thing type description. The default language is en. |
Query Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| $top | No | Integer | Number of records to include in the result set. |
| $skip | No | Integer | Number of the first n records to be excluded from the result set. |
| $inlinecount | No | String |
Total number of thing types available; permissible values are allpages and none. The following results apply if this parameter is used in conjunction with the other query parameters:
|
| $orderby | No | String |
Field name to be used for sorting the result set in ascending order; only valid field is the thing type name. To sort the result set, use asc for the ascending order and desc for the descending order. |
| $filter | No | String |
Filter condition to be applied; the only valid fields are thing type name, description, and extended thing type name. The filter operators supported are eq, lt, gt, le, ge, and ne. Multiple filters are supported using the separators – and, or. You can use the string functions such as substringof, startswith, and endswith to search data using $filter. Valid fields are thing type name, description, and extended thing type name. For more information, see Filter Conditions ($filter). |
| $select | No | String | Select condition for the data fields to be included in the result set; valid fields are thing type name, package name, description, and extended thing type name. |
Request Example
/ThingConfiguration/v1/ThingTypes
Retrieves all thing types
/ThingConfiguration/v1/ThingTypes?$select=Name, PackageName
Retrieves all thing types. The result set only contains selected fields - name of the thing type and name of the package.
/ThingConfiguration/v1/ThingTypes?$filter=Name eq 'core.automobiles:Vehicle'
Retrieves details of a thing type with the specific name.
/ThingConfiguration/v1/ThingTypes?$filter=Description eq 'ABC2 Car Series'
Retrieves all thing types with a specific description.
Response
Response Status and Error Codes
| Code | Description |
|---|---|
| 200 | Details of all thing types retrieved successfully |
Payload
Format: JSON
Media types supported are JSON and XML. The JSON for this method has the following structure:
{
"d": {
"results": [
{
"__metadata": {
"id": "https://thing-configuration-odata-v010-2003.cfapps.staging.sic.ondemand.com:443/ThingConfiguration/v1/ThingTypes('core.automobiles.%3ABC2Series')",
"uri": "https://thing-configuration-odata-v010-2003.cfapps.staging.sic.ondemand.com:443/ThingConfiguration/v1/ThingTypes('core.automobiles.%3ABC2Series')",
"type": "com.sap.appiot.ThingType"
},
"Name": "core.automobiles:ABC2Series",
"PackageName": "core.automobiles",
"Description": "test thing type",
"ExtendedThingType": "",
"PropertySets": {
"__deferred": {
"uri": "https://thing-configuration-odata-v010-2003.cfapps.staging.sic.ondemand.com:443/ThingConfiguration/v1/ThingTypes('core.automobiles%3ABC2Series')/PropertySets"
}
},
"Descriptions": {
"__deferred": {
"uri": "https://thing-configuration-odata-v010-2003.cfapps.staging.sic.ondemand.com:443/ThingConfiguration/v1/ThingTypes('core.automobiles%3ABC2Series')/Descriptions"
}
}
}
],
"__next": "https://thing-configuration-odata-v010-2003.cfapps.staging.sic.ondemand.com:443/ThingConfiguration/v1/ThingTypes?$format=json&$skiptoken=20&$filter=Name eq 'core.automobiles:ABC2Series'"
}
}