Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

The PTC Community email address has changed to Learn more.

Adding a Custom header in Thingworx Connector

100% helpful (1/1)

NOTE: Even though I have tried on ODataConnector and SwaggerConnector, these steps below should be working for all the Thingworx Integration Connectors viz. GenericConnector, HTTPConnector, ODataConnector, SAPODataConnector, SwaggerConnector, WindchillSwaggerConnector.


This document guides you to add a custom header in any Thingworx Integration connector.

Step 1. Create a Datashape say "CustomHeadersDataShape" and add a string field with Name the same as the header name you want to add. In this case, I want to add a header called "Prefer" so it will look something like 








Step 2: Go to the Integration Connector which you want to add this custom header. Navigate to "Services". Under the "Inherited Services", edit/overwrite the "GetCustomHeaderParameters" service by clicking on the edit (pencil) icon.

Step 3: In the JavaScript Code sniped section add below code snipped


var params = {
      infoTableName : "InfoTable",
      dataShapeName : "CustomHeadersDataShape"
var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
var preferValue = "odata.maxpagesize=50";
var newRow = {"Prefer"  : preferValue };


Step 4: Save the service and execute "GetCustomHeaderParameters". You should see something like






Now your custom header "Prefer: odata.maxpagesize=50" is set. further execution of your connector services will consider this header until it is reset.

Version history
Last update:
‎Feb 04, 2020 04:08 PM
Updated by:
Labels (1)
Tags (1)