Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hi All,
I am trying to get the remote properties of a remote thing. I want to do it programmatically (using services.). To see what are the properties are available at remote thing. Then i can bind or unbind it as per requirement. We can do it in composer by manage binding -> remote tab. I want to see remote properties using service.
Thanks in advance!!!
Regards,
Vishal Vaidya
Solved! Go to Solution.
You can use GetRemoteMetadata:
// result: JSON
Things[ThingName].GetRemoteMetadata();
ThingName should have a Thing Template of 'RemoteThing' in order to see the GetRemoteMetadata service. The service returns JSON, which can then be iterated through:
var remoteData = Things[ThingName].GetRemoteMetadata();
var propertyDefinitions = remoteData.propertyDefinitions;
for(var i in propertyDefinitions)
{
propertyDefinitions.name; //Available remote property name
}
You can use GetRemoteMetadata:
// result: JSON
Things[ThingName].GetRemoteMetadata();
ThingName should have a Thing Template of 'RemoteThing' in order to see the GetRemoteMetadata service. The service returns JSON, which can then be iterated through:
var remoteData = Things[ThingName].GetRemoteMetadata();
var propertyDefinitions = remoteData.propertyDefinitions;
for(var i in propertyDefinitions)
{
propertyDefinitions.name; //Available remote property name
}