cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to delete Things with a specific tag from REST Api

emadar
5-Regular Member

How to delete Things with a specific tag from REST Api

My question is in the title !

I've been using REST Api in order to delete a specific entity, but I need to delete a group of things with the same tag, so how could I do that?

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
AdamR
12-Amethyst
(To:emadar)

Hi Elie,

The best way to do this is to create a custom service that you call from the REST Api and pass in the value of the tag (this can be a string value in the rest call).  You can convert this to a tag in the service, then search for things with that tag using the SearchThings service in the SearchFunctions resource.  Loop through the resulting infotable and delete the things.

Adam

View solution in original post

2 REPLIES 2
AdamR
12-Amethyst
(To:emadar)

Hi Elie,

The best way to do this is to create a custom service that you call from the REST Api and pass in the value of the tag (this can be a string value in the rest call).  You can convert this to a tag in the service, then search for things with that tag using the SearchThings service in the SearchFunctions resource.  Loop through the resulting infotable and delete the things.

Adam

emadar
5-Regular Member
(To:AdamR)

That is actually a really good idea! I'm not sure that this was what I was looking for but it should really help me anyways.

Thank you!

Top Tags