0 Replies Latest reply on Dec 5, 2016 2:05 AM by bkanipakam-2 RSS
    bkanipakam-2 Explorer

    Combining the Thing creation and enabling in using rest API.

    Hello All,

     

    I am trying out things with Rest API. I am following the link mentioned below ThingWorx REST API Cheat Sheet and http://support.ptc.com/cs/help/thingworx_hc/thingworx_7.0_hc/ .

     

    1. I have created the thing using the following API

              Method= POST

              http://localhost:8080/Thingworx/Resources/EntityServices/Services/CreateThing , authorization is basic auth, content-type and accept are application/json.

    Json Format:

     

    {

    "name": "TestThing",

    "description":"TestThingDescription",

    "thingTemplateName":"TT_Test_API"

    }

     

    Response is 200k

          2. I have enabled the thing using the following API

              Method= PUT

              http://localhost:8080/Thingworx/Things/TestThing/Services/EnableThing

                   Response is 200k

          3. I am sending the following properties to the thing

              Method= POST

                   http://localhost:8080/Thingworx/Things/TestThing/Services/addDetails?method=post&input=register

     

    {

    "register":{

    "Unique_ID":"2002",

    "Address":"Bangalore, India",

    "Contact_Mobile_No":"8897388034",

    "Contact_Name":"YOGESH"

    }

    }

     

         In TT_Test_API(which is my template) and have written a service that fetch the data from the json what we are sending.I am able to do all these steps if i do them individually.

     

            Can we merge all the steps mentioned above and create a consolodated API so that we can Create the thing,Enable the thing & send the data in a single shot???

     

    Best Regards,

    Babu Yogesh,

    Dell