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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

[message: Execution error in service script [ThingName] :: api.objenious.com]

Diveye
6-Contributor

[message: Execution error in service script [ThingName] :: api.objenious.com]

Hello!

 

I'm trying to access a URL using the ContentLoaderFunctions snippets GetJSON. The URL I am providing is functional (checked using Postman) and the api key is defined in the header correctly. The Error Log is not providing additional information than that which is provided in the title. 

Can anyone help me understand what is going on here?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Diveye
6-Contributor
(To:Diveye)

Looks like I solved my own problem! Turns out I hadn't configured the right parameters concerning the proxy I was using. Everything works now!

View solution in original post

3 REPLIES 3
ckaminski
13-Aquamarine
(To:Diveye)

Diveye:

 

   Is it possible for you to paste the snippet to the call here with the parameters you are passing to GetJSON() ?

 

   You can private message me if it's sensitive.

 

   I assume you have permissions to access ThingName?

 

Regards,

-Chris Kaminski

PTC Technical Support

 

Diveye
6-Contributor
(To:ckaminski)

Hello ckaminski,

 

Here's the full snipped I am trying to implement:

 

 

var params = {
	proxyScheme: undefined /* STRING */,
	headers: {apikey: "MyAPIKey"} /* JSON */,
	ignoreSSLErrors: undefined /* BOOLEAN */,
	useNTLM: undefined /* BOOLEAN */,
	workstation: undefined /* STRING */,
	useProxy: undefined /* BOOLEAN */,
	withCookies: undefined /* BOOLEAN */,
	proxyHost: undefined /* STRING */,
	url: "https://api.objenious.com/v1/devices/lora:000000000000/messages?type=uplink&limit=1" /* STRING */,
	timeout: 30000 /* NUMBER */,
	proxyPort: undefined /* INTEGER */,
	password: undefined /* STRING */,
	domain: undefined /* STRING */,
	username: undefined /* STRING */
};

// result: JSON
var result = Resources["ContentLoaderFunctions"].GetJSON(params);

 

 

I changed the device ID and the API Key for confidentiality reasons. Concerning the permissions to access ThingName, I'm the creator of the project, shouldn't that guarantee me full access to it? If not, where would I need to go to get the full access? 

 

Thanks!

 

Diveye
6-Contributor
(To:Diveye)

Looks like I solved my own problem! Turns out I hadn't configured the right parameters concerning the proxy I was using. Everything works now!

Top Tags