Customize ThingWorx Navigate > Create Custom Tasks > Use Windchill REST Web Services to Access Data for Your Task
Use Windchill REST Web Services to Access Data for 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.
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 ODataConnector. There, you’ll find background information, and how to use them. Start with the topic Integration Connectors.
The Windchill documentation includes descriptions of the resources, endpoints, parameters, and representations and their structure.
The documentation is available when the Client Customization preference in the Windchill user interface is set to Yes:
To access the documentation, click the customization icon in the Navigator, and then select Documentation.
For information on setting the preference, see Customization Tools Overview in the Windchill Help Center.
For more details and instructions on configuring OData services on Windchill data, see the Windchill REST Services 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);
Was this helpful?