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
Is there an appkey-based REST API that will accept user credentials (username/password) and essentially return a boolean (valid/not-valid)?
Hi David,
Currently we do not have a best practice method for
this specific call. If this is a requirement, please do create a support
ticket (or I can create one for you if needed) and we can add the
functionality in one of the forthcoming releases.
-
Aanjan
OK, then, is there a REST API to "login" (passing username & password)?
The form-based login is sorta like this (POSTing form data rather than the exact twx rest syntax), but I haven't gotten it to work (see separate community post on 2/2/15 which no one ever replied to)
Thanks,
-Dave
Hi David! Hope all is well.
I found that item in the FAQ, and tried both the suggest URLs:
http://localhost:8080/Thingworx/Things/NameOfThing/Properties?userid=Administrator&password=admin&x-thingworx-session=true
http://localhost:8080/Thingworx/Things/NameOfThing/Properties?method=get&userid=Administrator&password=admin&x-thingworx-session=true
with a valid server, userid, password, but the server always returns a 404 with page content saying
Could you try the URL against your server and see if you can get it to work, and if you need to adjust the URL syntax please post the syntax you got to work?
in place of "NameOfThing" you are supposed to replace this with the name of the entity you are trying to access.
Hi David,
Please make sure whether your Tomcat instance is running on port 80 or 8080 and modify the REST call based on that. Also, NameOfThing represents the actual name of the Thing you are trying to access. For example, I have an Edge thing called MyEdgeThing, so in order to access it's properties, I'd use the following call:
http://localhost/Thingworx/Things/MyEdgeThing/Properties?userid=Administrator&password=admin&x-thingworx-session=true