0

I have recently found out how to delete rows by ID with the SODA API, but all of them were done through HTTP POST requests.

Whenever I use DELETE requests, no matter what content is sent, it deletes the entire contents of my database. On the documentation page for direct Direct Row Manipulation, the sample request for HTTP DELETE (application/json) does not work:

[
  {
    "typ": "delete",
    "id": "row-evac~sxbs~gm8t"
  }
]

Is the DELETE part of the SODA API functioning correctly? Or is the POST request the preferred choice?

1 Answers1

1

As is described on http://dev.socrata.com/publishers/direct-row-manipulation.html, you just need to issue the following request, replacing <ROW IDENTIFIER HERE> with the row identifier of the row you wish to delete.

DELETE /resource/hgqn-vki9/<ROW IDENTIFIER HERE>.json HTTP/1.1
Host: soda.demo.socrata.com
Authorization: Basic [REDACTED]
X-App-Token: [REDACTED]

For example, to delete this row: soda.demo.socrata.com/id/4tka-6guv/00388609.json (the row identifier is "00388609") you would issue the DELETE request to: https://soda.demo.socrata.com/id/4tka-6guv/00388609.json

Adrian Laurenzi
  • 286
  • 1
  • 6