-2

From what I have seen so far, the only types of data that can be deleted are rows that are set by the row identifier. There doesn't seem to be more information regarding this on the API documentation.

i.e, If I wanted to delete 10 rows, do I have to set the row identifier for each row on the Socrata Dataset Metadata page? Is there no way to do all deletions at once?

What if a certain row has null values (meaning it cannot be set as a row-identifier), how do we delete those rows?

Feedback appreciated, thank you.

rick.M863
  • 1
  • 1

1 Answers1

0

All datasets have an Internal identifier by default, as described here: http://dev.socrata.com/docs/row-identifiers.html

You can use the internal identifier to delete rows in the same way you would delete rows by a 'Publisher-Specified Identifier' (established using the Socrata Dataset Metadata page). Information on deleting a row by its identifier is here:
https://dev.socrata.com/publishers/direct-row-manipulation.html

You can delete rows one at a time or in bulk as described here:
dev.socrata.com/publishers/upsert.html

To find the internal identifiers simply use $select=:id in your SODA query. For example: https://soda.demo.socrata.com/resource/4tka-6guv.json?$select=:id,region

Adrian Laurenzi
  • 286
  • 1
  • 6
  • Is there a way to manually assign the internal identifier, or reset it (to 1)? Also, I am not seeing how deletion in _bulk_ is possible if both the publisher-specified identifiers and internal identifiers are unique (not a duplicate or null). – rick.M863 Apr 24 '14 at 14:52
  • Doing a bulk delete would look like this: POST to /resource/abcd-1234.json ``` [ { "row_id" : "1", ":deleted" : true }, { "row_id" : "2", ":deleted" : true } ] ``` For the "row_id", if you want to delete by internal identifier you would use ":id" instead. To use a publish-specified identifier you must create a column in the dataset (with unique values in each row) and set that as the Row Identifier (go to the red 'About' button on the dataset and then click 'Edit Metadata') Scroll down and find the row identifier field. – Adrian Laurenzi Apr 30 '14 at 08:47