Skip to main content
1-Visitor
November 8, 2018
Solved

Unable To Connect Over REST

  • November 8, 2018
  • 3 replies
  • 2370 views

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?

Best answer by posipova

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.

3 replies

posipova20-TurquoiseAnswer
20-Turquoise
November 8, 2018

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.

tekktonic1-VisitorAuthor
1-Visitor
November 8, 2018

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.

5-Regular Member
November 8, 2018

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