Creating thing hierarchy in Network using Postman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Creating thing hierarchy in Network using Postman
Hi All,
I am using Postman (calling RESt API) to create things and network. I was successful in doing so. Now I am trying to build the hierarchy in the network for the things that are created.
I have used API key for authentication, and in the body tab I am using POST and providing the below URL where TestNetwork is my network -
http://XXX.XXX.XXX.XXX:8080/Thingworx/Networks/TestNetwork/Services/AddConnection
I have selected "raw" in the radio button type as JSON
I have used the below code -
{ "from" : "SomeTestThing", "to" : "SomeTestThing1" , "connectionType" : "Contains" }
But I got error 500 - internal server error
I also tried with Javascript
var params = {
from: "SomeTestThing" ,
to: "SomeTestThing1" ,
connectionType: "Contains"
};
Networks["TestNetwork"].AddConnection(params);
got an error 403.
Can you please help me where am I going wrong? I am suspecting the URL but don't know what's the correct way.
Thanks In Advance
Swaraj
SO
Solved! Go to Solution.
- Labels:
-
Install-Upgrade
-
Troubleshooting
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello @SO_9699370,
If you want to build the hierarchy in the network for the things that are created in ThingWorx you can do that with Postman. You can use Javascript in Postman, you can try the following example:
Hope it helps,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello @SO_9699370 ,
Have you tried with the URL in the following format:
http://XXX.XXX.XXX.XXX:8080/Thingworx/Things/TestNetwork/Services/AddConnection
Hope it helps,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Your Postman request looks OK, given that there are no typos somewhere in your postman params http://localhost:8080/Thingworx/Networks/Net2/Services/AddConnection
At least, it works as expected on my side, I even copy&pasted the code from your message.
Very unlikely, but just in case, check the headers
Other than that... 500 is pretty generic error. What's there in the Application.log?
And, btw, which Thingworx version are you on?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello @SO_9699370,
If you want to build the hierarchy in the network for the things that are created in ThingWorx you can do that with Postman. You can use Javascript in Postman, you can try the following example:
Hope it helps,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you all.
I truthfully have no idea why it didn't work. I tried with the same URL and same JSON structure, it worked. Anyways thanks for all your input. I am closing this case but accepting the last comment as solution.
Kind Regards
Swaraj
SO
