Advanced Customization > Use Windchill REST Web Services to Develop Your Task
  
Use Windchill REST Web Services to Develop Your Task
Windchill provides various REST (Representational State Transfer) web services that can be used in a mashup. These services provide a means to access Windchill data and the processing power of the Windchill system. The PTC Windchill Extension includes the WindchillSwaggerConnector thing template that starts Windchill REST web services. The instance of the connector for ThingWorx Navigate is ptc-windchill-integration-connector.
* 
Windchill also provides the OData-based Windchill REST services. In future releases, ThingWorx Navigate will utilize those services.
We recommend that you plan for this change when you customize ThingWorx Navigate.
For details and instructions on configuring OData services on Windchill data, see the Windchill REST Services User’s Guide.
Windchill REST services are integrated with Windchill Audit logging. As of this PTC Windchill Extension release, the following events are logged:
View Properties
Read or Download Content
View Representation
Search
For the information you need to call REST services in your task, use these resources:
The ThingWorx Help has a comprehensive chapter on integration connectors such as WindchillSwaggerConnector. There, you’ll find background information, and how to use them. Start with the topic “Integration Connectors.”
Using WindchillSwaggerConnector” includes information on installing the required Windchill patch, and a list of the supported Windchill endpoints that you can use to retrieve data.
The Windchill documentation includes descriptions of the resources, endpoints, parameters, and representations and their structure. To access the documentation, click the customization icon in the Navigator, and then select Documentation.
The documentation is available when the Client Customization preference in the Windchill user interface is set to Yes:
For information on setting the preference, see “Customization Tools Overview” in the Windchill Help Center.
ServiceTimeout Property
The ServiceTimeout property controls the default time, in milliseconds, that ThingWorx waits for a REST call to Windchill to complete before Windchill returns an error to the mashup user interface. You can override this default value on an individual call by specifying the timeout argument on the call to Windchill. For example, the following code calls the Windchill REST endpoint to execute a saved search and specifies a timeout of 10 seconds. If this call does not specify the timeout argument, then the timeout specified in ServiceTimeout is used.
var params = {
queryParams: {
  '$select': 'name,number,version'
},
data: {
  keyword: undefined
},
type: 'POST',
url: me.getRestUrl() + "/search/saved-searches/" + encodeURIComponent(oid) + "/results",
timeout: 10000
};
var jsonResult = me.processJSONRequest(params);