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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

How to use Thingworx to get API data from VEC

JR_10569306
12-Amethyst

How to use Thingworx to get API data from VEC

I have the client org ID, x-api-key and x-api-key secret. I want to use a Thingworx service to get the VEC Data. 

 

How do I make this command work in a Thingworx service.

curl -X 'POST' 'https://vuforia.ptc.com/customer-events/<orgid>/report' \
-H 'accept: application/json' \
-H 'x-requested-with: fetch' \
-H 'x-api-key: <x-api-key secret> \
-H 'Content-Type: application/json'

 

https://support.ptc.com/help/vuforia/editor/en/index.html#page/vuforia_editor%2Fexample_0.html%23

ACCEPTED SOLUTION

Accepted Solutions

I figured it out:

 

Create a service on a thing

No inputs

Output: JSON

Code:

var headers= { "Content-Type": "application/json","x-requested-with": "fetch", "x-api-key": "<api key secret> "Accept": "application/json" }
//var params = {
//    headers: headers /* JSON */,
//    url: 'https://vuforia.ptc.com/customer-events/<org id>/report' /* STRING */
//};
 
var result = Resources["ContentLoaderFunctions"].PostJSON(params);

View solution in original post

1 REPLY 1

I figured it out:

 

Create a service on a thing

No inputs

Output: JSON

Code:

var headers= { "Content-Type": "application/json","x-requested-with": "fetch", "x-api-key": "<api key secret> "Accept": "application/json" }
//var params = {
//    headers: headers /* JSON */,
//    url: 'https://vuforia.ptc.com/customer-events/<org id>/report' /* STRING */
//};
 
var result = Resources["ContentLoaderFunctions"].PostJSON(params);
Announcements

Top Tags