Read a Thing Group

Retrieves details of a thing group

With this service, you can retrieve the list of things that are part of the specified thing group. If you retrieve an empty group along with the $expand query parameter, the service only retrieves the group details.

Request

URI: /ThingGroup/v1/ThingGroups('<thing group ID>')

Operation Type: CRUD

HTTP Method: GET

Permissions: <tg>.r

Request Parameters

Parameter Required Data Type Description Parameter Type
GroupId Yes String Unique identifier of the thing group Path

Request Query Parameters

Parameter Required Data Type Description
$expand No String

Includes the related resources inline while retrieving the requested resources.

Supported associations of thing group that can be retrieved using $expand are thing group elements and thing group description.

$filter No String Filter condition to be applied; all fields in the result set are valid.
$format No String Format to be applied on the result set.
$select No String Select condition for the data fields to be included in the result set; all fields in the result set are valid.

Request Example

/ThingGroup/v1/ThingGroups('3E930040F5E3F8021600B10200CB288F')

Response

Response Status and Error Codes

Code Description
200 Thing group details retrieved successfully

Payload

Format: JSON

Media type supported are JSON and XML. The JSON for this method has the following structure.

Example 1

/ThingGroup/v1/ThingGroups('3E930040F5E3F8021600B10200CB288F')

Retrieves the list of things in the group 3E930040F5E3F8021600B10200CB288F

{
    "d": {
        "__metadata": {
            "id": "https://appiot-thing-group-ci.cfapps.sap.hana.ondemand.com:443/ThingGroup/v1/ThingGroup('3E930040F5E3F8021600B10200CB288F')",
            "uri": "https://appiot-thing-group-ci.cfapps.sap.hana.ondemand.com:443/ThingGroup/v1/ThingGroup('3E930040F5E3F8021600B10200CB288F')",
            "type": "com.sap.appiot.ThingGroup"
        },
        "GroupID": "3E930040F5E3F8021600B10200CB288F",
        "Name": "ABCCarGroup",
        "Description": null,
        "ExternalID": "ABCCarGroup",
        "ThingGroupElements": {
            "__deferred": {
                "uri": "https://appiot-thing-group-ci.cfapps.sap.hana.ondemand.com:443/ThingGroup/v1/ThingGroup('3E930040F5E3F8021600B10200CB288F')/ThingGroupElements"
            }
        },
        "ThingGroupDescriptions": {
            "__deferred": {
                "uri": "https://appiot-thing-group-ci.cfapps.sap.hana.ondemand.com:443/ThingGroup/v1/ThingGroup('3E930040F5E3F8021600B10200CB288F')/ThingGroupDescriptions"
            }
        }
    }
}

Example 2

/ThingGroup/v1/ThingGroups('3E930040F5E3F8021600B10200CB288F')?$expand=ThingGroupDescriptions,ThingGroupElements

Retrieves the list of things in the group ABCGroup along with the thing group description and thing group elements

{
    "d": {
        "__metadata": {
            "id": "https://appiot-thing-group-ci.cfapps.sap.hana.ondemand.com:443/ThingGroup/v1/ThingGroup('3E930040F5E3F8021600B10200CB288F')",
            "uri": "https://appiot-thing-group-ci.cfapps.sap.hana.ondemand.com:443/ThingGroup/v1/ThingGroup('3E930040F5E3F8021600B10200CB288F')",
            "type": "com.sap.appiot.ThingGroup"
        },
        "GroupID": "3E930040F5E3F8021600B10200CB288F",
        "Name": "ABCCarGroup",
        "Description": "Group of ABC Car Things",
        "ExternalID": "ABCCarGroup",
        "ThingGroupElements": {
            "results": [
                {
                    "GroupID": "3E930040F5E3F8021600B10200CB288F",
                    "ThingID": "503B8711B5D0445688E7FF7ACFC2177A",
                    "ThingAlternateID": null,
                    "ThingName": "ABCXSeries",
                    "ThingDescription": "ABC X Series",
                    "Operation": null
                },
                {
                    "GroupID": "3E930040F5E3F8021600B10200CB288F",
                    "ThingID": "908758D995094A6F9CC72FC9C18BC366",
                    "ThingAlternateID": null,
                    "ThingName": "ABCZSeries",
                    "ThingDescription": "ABC Z Series",
                    "Operation": null
                }
            ]
        },
        "ThingGroupDescriptions": {
            "results": [
                {
                    "LanguageCode": "en",
                    "Description": "Group of ABC Car Things"
                },
                {
                    "LanguageCode": "de",
                    "Description": "Gruppe von ABC Car Things"
                }
            ]
        }
    }
}

Example 3

/ThingGroup/v1/ThingGroups('3E930040F5E3F8021600B10200CB288F')?$expand=ThingGroupElements

Retrieves the list of things in the group 3E930040F5E3F8021600B10200CB288F along with the thing group elements

{
    "d": {
        "__metadata": {
            "id": "https://appiot-thing-group-ci.cfapps.sap.hana.ondemand.com:443/ThingGroup/v1/ThingGroup('3E930040F5E3F8021600B10200CB288F')",
            "uri": "https://appiot-thing-group-ci.cfapps.sap.hana.ondemand.com:443/ThingGroup/v1/ThingGroup('3E930040F5E3F8021600B10200CB288F')",
            "type": "com.sap.appiot.ThingGroup"
        },
        "GroupID": "3E930040F5E3F8021600B10200CB288F",
        "Name": "ABCCarGroup",
        "Description": "Group of ABC Car Things",
        "ExternalID": "ABCCarGroup",
        "ThingGroupElements": {
            "results": [
                {
                    "GroupID": "3E930040F5E3F8021600B10200CB288F",
                    "ThingID": "503B8711B5D0445688E7FF7ACFC2177A",
                    "ThingAlternateID": null,
                    "ThingName": "ABCXSeries",
                    "ThingDescription": "ABC X Series",
                    "Operation": null
                },
                {
                    "GroupID": "3E930040F5E3F8021600B10200CB288F",
                    "ThingID": "908758D995094A6F9CC72FC9C18BC366",
                    "ThingAlternateID": null,
                    "ThingName": "ABCZSeries",
                    "ThingDescription": "ABC Z Series",
                    "Operation": null
                }
            ]
        },
        "ThingGroupDescriptions": {
            "__deferred": {
                "uri": "https://appiot-thing-group-ci.cfapps.sap.hana.ondemand.com:443/ThingGroup/v1/ThingGroup('3E930040F5E3F8021600B10200CB288F')/ThingGroupDescriptions"
            }
        }
    }
}

Example 4

/ThingGroup/v1/ThingGroups('56930040F5E3F8021600B10200CB288F')?$expand=ThingGroupElements

The group 56930040F5E3F8021600B10200CB288F is an empty group and result is as follows:

{
    "d": {
        "__metadata": {
            "id": "https://appiot-thing-group-ci.cfapps.sap.hana.ondemand.com:443/ThingGroup/v1/ThingGroup('56930040F5E3F8021600B10200CB288F')",
            "uri": "https://appiot-thing-group-ci.cfapps.sap.hana.ondemand.com:443/ThingGroup/v1/ThingGroup('56930040F5E3F8021600B10200CB288F')",
            "type": "com.sap.appiot.ThingGroup"
        },
        "GroupID": "56930040F5E3F8021600B10200CB288F",
        "Name": "EmptyGroup",
        "Description": null,
        "ExternalID": "EmptyGroup",
        "ThingGroupElements": {
            "__deferred": {
                "uri": "https://appiot-thing-group-ci.cfapps.sap.hana.ondemand.com:443/ThingGroup/v1/ThingGroup('56930040F5E3F8021600B10200CB288F')/ThingGroupElements"
            }
        },
        "ThingGroupDescriptions": {
            "__deferred": {
                "uri": "https://appiot-thing-group-ci.cfapps.sap.hana.ondemand.com:443/ThingGroup/v1/ThingGroup('56930040F5E3F8021600B10200CB288F')/ThingGroupDescriptions"
            }
        }
    }
}