Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Hi All, I am new to thingworx and trying to complete the Arduino Uno weather app from the tutorial provided on the following link:
Weather App with Arduino Uno | ThingWorx
I am using a developer account and ThingWorx Composer 6.0. I am stuck at the following part of tutorial:
This primarily deals with updating the temp and humid values using REST call in the thing properties. The structure of the REST call that I have even tried from REST clients is following:
POST /Thingworx/Things/DHT11Thing/Services/setTempAndHumid?appKey=8510MYAPPKEY-1918-4ad8-961f-475f22c50a02&method=post&x-thingworx-session=true<&Temp=32.04&Humid=12.17> HTTP/1.1
Host: geX-XXX.cloud.thingworx.com {This is my thingworx account link to composer}
Content-Type: text/html
Any pointers on what I may be doing wrong.
P.S. I amusing a DHT11 temperature sensor so my thing name is matching with the thing name I have created on ThingWorx.
Thanks,
Avinash
Solved! Go to Solution.
Hi,
On ThingWorx 6.0 REST calls need to be enabled by following these steps :
1. Click on Subsystems under SYSTEM within the left pane of Composer
2. Click on PlatformSubsystem
3. Click on Configuration
4. Check the box next to Allow Request Method Switch to allow all REST API calls through a browser URL
5. Uncheck Filter Content-Type
Let me know if this fixes the issue,
Veronica
Hi,
On ThingWorx 6.0 REST calls need to be enabled by following these steps :
1. Click on Subsystems under SYSTEM within the left pane of Composer
2. Click on PlatformSubsystem
3. Click on Configuration
4. Check the box next to Allow Request Method Switch to allow all REST API calls through a browser URL
5. Uncheck Filter Content-Type
Let me know if this fixes the issue,
Veronica
Thanks a lot Veronica, I was able to POST data using REST call.
I have another doubt regarding the Application Key based authentication, that I am using in my REST call.
To be precise I am using the following POST:
It seems like I am able to POST data without application key authentication. What settings I need to correct to put application key authentication for my thing?
Thanks,
Avinash
Hi Avinash,
Are you making the rest call in a browser ? Maybe you are already logged in and this is why you are no longer required to input an authentication key as alternative for log in. Use also the following parameter in your Rest call : x-thingworx-session=true. This will create a thingworx session for your rest call.
Veronica
Hi Veronica,
I closed browsers, cleared cache and now when I am trying to get the call:
This call is throwing me a 401 unauthorized error. I believe I am missing some setting linked with application key authentication process.
Just an additional pointer I am using browser extension for REST in chrome to make REST calls.
Thanks,
Avinash
Hi Ainash,
There shouldn't be any additional configuration to be done. Just make sure that you copied the entire app key It should be 36 characters long, including the little dashes. Also make sure that you have assigned the user you are logged in with as the owner of the key.
I hope this solves the issue.
Veronica
I have got it. thanks, never mind my question in other issue about this problem
Sure, no problem.