Skip to main content
1-Visitor
August 1, 2017
Question

How to pass application key in headers for Thingworx 8 version

  • August 1, 2017
  • 2 replies
  • 6306 views

Hi,

can anyone please tell me how to pass application key in headers as parameters, can you post the sample headers.

I tried application key string in headers in many formats, but still I am facing the same issue(cors).

I tried below cases:

headers:{

appKey: <application key>,

ApplicationKey: <application key>,

Application Key: <application key>,

Application-Key: <application key>,

application-key: <application key>,

KEY:<application key>,

}

Thanks in advance .

2 replies

20-Turquoise
August 1, 2017

Have you tried, for example:

"headers": {
    "accept": "application/json",
    "content-type": "application/json",
    "appkey": "your-app-key-here",
    "cache-control": "no-cache",
    "postman-token": "postman-token-here"
  },

PGayathri1-VisitorAuthor
1-Visitor
August 1, 2017

Hi Polina,

Actually I am consuming thingworx apis from react app.

I am passing the below headers while api calling. correct me if I am doing wrong.

const HEADERS = {

  'Content-Type': 'application/json',

  'Accept': 'application/json',

  'appkey': '73cd42e2-fa9b-4896-b7c4-39780aa0c6d7',

  'cache-control': 'no-cache'

};

do I need to pass postman token also, if yes can you please tell me how to get the postmantoken.

Thanks.

13-Aquamarine
November 20, 2017

appkey needs to be spelled like this - appKey

const HEADERS = {

  'Content-Type': 'application/json',

  'Accept': 'application/json',

  'appKey': '73cd42e2-fa9b-4896-b7c4-39780aa0c6d7',

  'cache-control': 'no-cache'

};

1-Visitor
February 1, 2018