Publisher and Web Interface > Web Interface > Web Interface REST service > Overview of the Web Interface REST service (Web Interface REST Service) > Worked example: Using returned URIs to navigate to resources (Web Interface REST service)
  
Worked example: Using returned URIs to navigate to resources (Web Interface REST service)
This worked example demonstrates how you can use URIs that are returned from REST service requests to navigate from the Modeler server, to a model, item.
In this example, we use the URIs that are returned from REST service requests to navigate to a top-level Package in a model. We then find out whether the Package is a profile Package.
In the address bar of our web browser, we type the URI of the Web Interface website.
https://localhost:57850
The Web Interface website opens the log in page for the website. We log in to the website using a valid user name and password.
In the address bar of our web browser, we type the URI for the REST service that is provided by the Web Interface website.
https://localhost:57850/ModelerService
The ModelerService request returns the following XML that includes URIs for operation requests that can be made against the REST service.
<?xml version="1.0"?>
<ResourceOperations xmlns:i="http://www.w3.org/2001/XMLSchema-instance"xmlns="http://schemas.datacontract.org/2004/07/StudioRESTService.ModelerRESTService">
<RequestResult>Complete</RequestResult>
<RequestResultType>Operations</RequestResultType>
<ID/>
<Name/>
<ResourceType>Rest Service</ResourceType>
<URIs>
<URI>
<href>https://localhost:57850/ModelerService/Help</href>
</URI>
<URI>
<href>https://localhost:57850/ModelerService/Servers</href>
</URI>
<URI>
<href>https://localhost:57850/ModelerService/LocaleInfo</href>
</URI>
<URI>
<href>https://localhost:57850/ModelerService/Version</href>
</URI>
<URI>
<href>https://localhost:57850/ModelerService/EnablerIcon</href>
</URI>
<URI>
<href>https://localhost:57850/ModelerService/EnablerImage</href>
</URI>
</URIs>
</ResourceOperations>
We copy the URI for the servers request to the address bar of the web browser.
https://localhost:57850/ModelerService/Servers
The Servers request returns URIs for the servers that can be accessed through the REST service. We copy the URI for the Server123@MODELER server instance to the address bar of the web browser.
https://localhost:57850/ModelerService/Servers/Server123@MODELER
The Server123@MODELER request returns URIs for operation requests that can be made against the Server123@MODELER server instance. We copy the URI for the Repositories request to the address bar of the web browser.
https://localhost:57850/ModelerService/Servers/Server123@MODELER/Repositories
The Repositories request returns URIs for the repositories that can be accessed through the REST service. We copy the URI for the Repository123 repository to the address bar of the web browser.
https://localhost:57850/ModelerService/Servers/Server123@MODELER/Repositories/Repository123
The Repository123 request returns URIs for operation requests that can be made against the Database123 repository. We copy the URI for the Models request to the address bar of the web browser.
https://localhost:57850/ModelerService/Servers/Server123@MODELER/Repositories/Repository123/Models
The Models request returns URIs for the models that can be accessed through the REST service. We copy the URI for the Model123 model to the address bar of the web browser.
https://localhost:57850/ModelerService/Servers/Server123@MODELER/Repositories/Repository123/Models/Model123
The Model123 request returns URIs for operation requests that can be made against the Model123 model. We copy the URI for the ModelVersions request to the address bar of the web browser.
https://localhost:57850/ModelerService/Servers/Server123@MODELER/Repositories/Repository123/Models/Model123/ModelVersions
The ModelVersions request returns URIs for the model versions that can be accessed through the REST service. We copy the URI for the 0 model version to the address bar of the web browser.
https://localhost:57850/ModelerService/Servers/Server123@MODELER/Repositories/Repository123/Models/Model123/ModelVersions/0
The 0 request returns URIs for operation requests that can be made against version 0 of the Model123 model. We copy the URI for the ChildItems request to the address bar of the web browser.
https://localhost:57850/ModelerService/Servers/Server123@MODELER/Repositories/Repository123/Models/Model123/ModelVersions/0/ChildItems
The ChildItems request returns URIs for the model items that are scoped directly to the model.
We want to find top-level Packages that are set up as profile packages, that is, Packages that have the Profile check box selected on their Property Pages. When the Profile check box is selected, the 'Is Profile Package' property of the Package is set to TRUE.
The returned XML contains an <ModelItem> section for each returned item. For example, this is the <ModelItem> section for Package1.
<ModelItem>
<RequestResult>Complete</RequestResult>
<RequestResultType>Resource</RequestResultType>
<ID>090983e8-6792-4264-9582-11f608765549</ID>
<Name>Package1</Name>
<ResourceType>Package</ResourceType>
<URIs>
<URI>
<href>https://localhost:57850/ModelerService/Servers/Server123@MODELER/Repositories/Repository123/Models/Model123/ModelVersions/0/Item/090983e8-6792-4264-9582-11f608765549</href>
</URI>
</URIs>
<Ip/>
<StyleIcon>false</StyleIcon>
<Tg>DIC</Tg>
<Ty>Package</Ty>
<WebInterfaceLink>https://localhost:57850/showitem?srvNm=Server101+repNm=Models+modNm=Model1+modVe=0+itemID=090983e8-6792-4264-9582-11f608765549</WebInterfaceLink>
</ModelItem>
By searching for the text 'Package' between the <ResourceType> and </ResourceType> tags, we can find the <ModelItem> sections for Packages. We copy the URI for Package1 to address bar of the web browser.
https://localhost:57850/ModelerService/Servers/Server123@MODELER/Repositories/Repository123/Models/Model123/ModelVersions/0/Item/090983e8-6792-4264-9582-11f608765549
The item request returns URIs for operation requests that can be made against the 090983e8-6792-4264-9582-11f608765549 item, that is, Package1. We copy the URI for the PropertyDescriptors request to the address bar of the web browser.
https://localhost:57850/ModelerService/Servers/Server123@MODELER/Repositories/Repository123/Models/Model123/ModelVersions/0/Item/090983e8-6792-4264-9582-11f608765549/PropertyDescriptors
The PropretyDescriptors request returns URIs for the properties of the item. We copy the URI for the 'Is Profile Package' property to the address bar of the web browser. Note that the property name is percent encoded, so each space character is replaced with %20.
https://localhost:57850/ModelerService/Servers/Server123@MODELER/Repositories/Repository123/Models/Model123/ModelVersions/0/Item/090983e8-6792-4264-9582-11f608765549/Properties/Is%20Profile%20Package
The 'Is Profile Package' property request returns the value of the 'Is Profile Package' property through the <Value> tag.
<PropertyItem>
<RequestResult>Complete</RequestResult>
<RequestResultType>Resource</RequestResultType>
<ID/>
<Name>Is Profile Package</Name>
<ResourceType>Property</ResourceType>
<URIs/>
<DataType>BOOLEAN</DataType>
<Permissions>RW</Permissions>
<Value>TRUE</Value>
<Visibility>PUBLIC</Visibility>
</PropertyItem>
We can see that the 'Is Profile Package' property is set to TRUE, so we know that Package1 is set up as a profile package.
From an item we can use the following operations to navigate to other items in the model:
The ChildItems operations to navigate to child item of that item.
The Parentitem operation to navigate to the parent item of that item.
The RoleDescriptors operations and Role resources to navigate to linked items.