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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Unable To Connect Over REST

tekktonic
6-Contributor

Unable To Connect Over REST

We have a Thingworx 8.1 server running, and I'm unable to perform any REST API calls on it. I've tried in both postman and curl at various URLs, starting from as simple as https://server.com/Thingworx/Things?appKey=[appkey] as well as on various things. No matter what, the response is a 401 with no body. The app key is valid and I've tried generating 3 or 4 different ones at this point just to make sure that they ARE valid. My user can, of course, view the things that I'm querying against (why I went for specific things instead of calling it at just /Thingworx/Things.) Anyone have pointers for what could be going wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
posipova
20-Turquoise
(To:tekktonic)

You have to enable the use of your appkey in the queary via Platform Settings subsystem.

 

Let me know if you need any help with that.

View solution in original post

3 REPLIES 3
posipova
20-Turquoise
(To:tekktonic)

You have to enable the use of your appkey in the queary via Platform Settings subsystem.

 

Let me know if you need any help with that.

tekktonic
6-Contributor
(To:posipova)

That worked, thanks. For others reference, you need to go to home / Subsystems / PlatformSubsystem / Configuration and enable "Allow Application Key As URL Parameter."

 

Do you happen to know why this requirement isn't mentioned in the "Create An Application Key" or "REST API Reference Guide" tutorials, especially given that URL parameters are the default in those tutorials. The fact that you can also use a request header instead of a query parameter is only given a passing mention and never used in examples in the REST Reference Guide. It never comes up at all in REST Core Concepts.

Allowing an appKey as a URL parameter was the default when the guides you mentioned were written, and allowing an appKey in a URL is set as the default for the 30 day hosted trial servers, we will update the guides to reflect the change.

 

This guide has a section on authentication:

https://developer.thingworx.com/resources/guides/thingworx-rest-api-quickstart/authentication-discussion

 

Top Tags