How to use REST Web services to delete a record

1 minute read time.

On one of the last blogs I had posted here, we discussed how to read and write a record using REST web services and a question was asked on how to delete a record using REST web services.

Before showing this example , if you search the online help for “SData web service for Delete” you will see below.




Below is an example of using the test representation you saw on the prier blog post and deleting a record.So in my ZCLIENT representation in Query Facet I have 3 records below, and I like to delete one, using Rest web services.




As the online help mentions I am going to send a DELETE HTTP Request and use below link.

http://Server:8124/api1/x3/erp/SEED/ZCLIENT('Ali')?representation=ZCLIENT.$edit

Which ZCLIENT is the name of my representation and class, and Ali is the key of the record.

When you sent the request , the response body would be like this if the deletion is successful.

Conclusion:

You can use REST web services with your Representation to delete records.