3 Replies Latest reply on Jan 15, 2018 9:44 PM by mberber-2 RSS
    mberber-2 Newbie

    REST API Authentication problem on Thingworx 8

    Hello eveyone;

     

    I recently discovered that in ThingWorx 8 , adding appKey to url for authentication has ben removed for security reasons.

     

    I cant find working HTTP Requests examples which includes necessary headers with proper syntax.

     

    I am using NodeMCU with MicroPython Flash. I can successfully make HTTP requests to any REST testing site. eg. https://httpbin.org/.

     

    I also test my Url in Postman. which it also work properly.

     

    http://<server>/Thingworx/Things/NodemcuTest/Properties/input


    Here is my code.


    Note : I use urequests library as requests.


    url = 'http://<server>/Thingworx/Things/NodemcuTest/Properties/input'  
    headers = {'appkey': 'xxxx-xxxx-xxx-xxxx-xxxx-xxx' 
              'Accept': 'application/json'} 
    getreq = requests.get(url, headers=headers).json() 
    s = getreq["rows"][0]["cont"] 
    print(s) 
    

     

    I hope i made myself clear about the issue.

     

    Thank you.

    Murat Can