1

**[11:12] Umer Saleem Working on it, sir in this example link what is the components name and how to find it POST https://{subdomain}.{centralDnsSuffixInPath}/api/preview/devices/{device_id}/components/{component_name}/commands/{command_name} **

1 Answers1

0

To find out what components you have for this device, you can do a GET request to

https://{subdomain}.{centralDnsSuffixInPath}/api/preview/devices/{device_id}/components/

This will show you the components, a sample response can be:

{
"value": [
    {
        "@id": "urn:machine:MyMachine:lxhc64xu:1",
        "@type": [
            "InterfaceInstance"
        ],
        "name": "cb_7d7",
        "displayName": "Interface"
    },
    {
        "@id": "urn:machine:MyMachine:_lyh_e2x:1",
        "@type": [
            "InterfaceInstance"
        ],
        "name": "cb_282",
        "displayName": "Properties"
    }
]

}

The name of the {component} is the name of the value that you get in the response. In my example, you can use "cb_7d7" or "cb_282". They are the names of your interfaces.

Matthijs van der Veer
  • 3,865
  • 2
  • 12
  • 22
  • Matthijs van der Veer can you also tell please how to get the latest sesnor value from api in azure iot central? – Umer Saleem May 11 '20 at 10:24
  • Sure thing, you can find the API definition here: https://learn.microsoft.com/en-us/rest/api/iotcentral/devices/gettelemetryvalue It also has an example request. – Matthijs van der Veer May 12 '20 at 06:00