Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hi guys,
Our company deployed a Thingworx platform, and provided with some dev accounts,
but when I tested using REST API to create a new thing, I received unauthorized error.
I could create a thing using browser GUI.
Here is request
Any help is highly appreciated ?
Solved! Go to Solution.
Just a few things to check
1) you are sending app key in the URL itself, if you want to follow this practice check your platform subsystem under subsystem in Thingworx. Subsystem->PlatformSubsystem->click on configuration tab there you can see "allow app key as URL parameter" . You need to enable this.
2) As a best practice you should send this app key in header of your REST call instead of in URL. If you send this in your header and pass the required inputs in body of rest call you don't need to enable the 1st option.
3) make sure the user associated with the app key must have permission to create things in the platform, otherwise you will always get unauthorized
Just a few things to check
1) you are sending app key in the URL itself, if you want to follow this practice check your platform subsystem under subsystem in Thingworx. Subsystem->PlatformSubsystem->click on configuration tab there you can see "allow app key as URL parameter" . You need to enable this.
2) As a best practice you should send this app key in header of your REST call instead of in URL. If you send this in your header and pass the required inputs in body of rest call you don't need to enable the 1st option.
3) make sure the user associated with the app key must have permission to create things in the platform, otherwise you will always get unauthorized