Oct 18 2022 04:04 AM
Hello,
How can we delete a term from a term store using PnP JS (v2 or v3) in a SPFx solution?
I looked at https://pnp.github.io/pnpjs/sp/taxonomy/ and found nothing,
Can you help?
If it is not possible, what is the alternative? Call SharePoint REST API? Call old SOAP web services from javascript?
Thanks
Oct 18 2022 11:42 PM
@Miguel Lopes Isidoro Try SharePoint REST API if it works for you:
Endpoint : https://testinglala.sharepoint.com/_api/v2.1/termStore/groups/122d92ab-d7a8-479f-9888-8d4421f8218f/sets/8ed8c9ea-7052-4c1d-a4d7-b9c10bffea6f/terms/b8b3e828-cdf7-46b2-889e-f5f797a05aa3
Method : DELETE
Headers : {"Content-Type": "application/json",
"Authorization": "Bearer <Bearer Token>"}
References:
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
Oct 19 2022 12:47 AM
@ganeshsanap thanks. I will use graph api: https://learn.microsoft.com/en-us/graph/api/termstore-term-delete?view=graph-rest-1.0&tabs=http