Obtaining a GUID for use with  id prefix


The GUID for an item is displayed in many REST responses, identified by the attribute objectId. For example, if you are working with assets, and you want to find a server's GUID, you can obtain it in the following ways:

Get the children of type Server (type prefix)

Note the presence of the objectId attribute. For example, the GUID for myServer is displayed as objectId="0d3a0f31-7185-4594-b326-26f3ecf463a5".

Request URI: /type/PropertySetClasses/SystemObject/Server/

XML response

<?xml version="1.0" encoding="UTF-8" ?>
<RESTXMLResponse>
 <PropertySetClassChildrenResponse>
   <PropertySetClassChildren>
     <PropertySetClasses totalCount="1">
       <PropertySetClass name="Agentless Managed Object" uri="/type/PropertySetClasses/SystemObject/Server/Agentless Managed Object" />
     </PropertySetClasses>
     <PropertySetInstances totalCount="1">
       <PropertySetInstance name="myServer" description="" type="/type/PropertySetClasses/SystemObject/Server" dbKey="DBKey:SDeviceModelKeyImpl:2000000-2003106" objectId="0d3a0f31-7185-4594-b326-26f3ecf463a5" uri="/id/SystemObject/Server/0d3a0f31-7185-4594-b326-26f3ecf463a5" modelType="SERVER" modelTypeId="5004" />
     </PropertySetInstances>
   </PropertySetClassChildren>
 </PropertySetClassChildrenResponse>
</RESTXMLResponse>

Get the children of a server group (group prefix)

Note the presence of the objectId attribute. For example, the GUID for server1 is displayed as objectId="3d4cdbe6-0206-4c42-bf9c-c5f358892f7e".
Request URI: /group/Servers/myServers/

XML response

<?xml version="1.0" encoding="UTF-8" ?>
<RESTXMLResponse>
<GroupChildrenResponse>
<GroupChildren>
<GroupChildren>
<PropertySetInstances totalCount="2">
<PropertySetInstances totalCount="2">
<PropertySetInstance name="server1" description="" type="/type/PropertySetClasses/SystemObject/Server" dbKey="DBKey:SDeviceModelKeyImpl:2000000-2003100" objectId="3d4cdbe6-0206-4c42-bf9c-c5f358892f7e" uri="/id/SystemObject/Server/3d4cdbe6-0206-4c42-bf9c-c5f358892f7e" modelType="SERVER" modelTypeId="5004" />
<PropertySetInstance name="server1" description="" type="/type/PropertySetClasses/SystemObject/Server" dbKey="DBKey:SDeviceModelKeyImpl:2000000-2003100" objectId="3d4cdbe6-0206-4c42-bf9c-c5f358892f7e" uri="/id/SystemObject/Server/3d4cdbe6-0206-4c42-bf9c-c5f358892f7e" modelType="SERVER" modelTypeId="5004" />
<PropertySetInstance name="server2" description="" type="/type/PropertySetClasses/SystemObject/Server" dbKey="DBKey:SDeviceModelKeyImpl:2000100-2003201" objectId="b97ca8e5-5fe6-4a49-8ead-da0f218565ec" uri="/id/SystemObject/Server/b97ca8e5-5fe6-4a49-8ead-da0f218565ec" modelType="SERVER" modelTypeId="5004" />
<PropertySetInstance name="server2" description="" type="/type/PropertySetClasses/SystemObject/Server" dbKey="DBKey:SDeviceModelKeyImpl:2000100-2003201" objectId="b97ca8e5-5fe6-4a49-8ead-da0f218565ec" uri="/id/SystemObject/Server/b97ca8e5-5fe6-4a49-8ead-da0f218565ec" modelType="SERVER" modelTypeId="5004" />
</PropertySetInstances>
</PropertySetInstances>
</PropertySetInstances>
...OMITTED...
...OMITTED...

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*