Skip to content

Instantly share code, notes, and snippets.

@amercader
Last active December 18, 2015 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amercader/5697832 to your computer and use it in GitHub Desktop.
Save amercader/5697832 to your computer and use it in GitHub Desktop.
# Example POST request from the command line with curl
# We can only perform an insert because the target table does not have a primary key defined
# See http://docs.ckan.org/en/latest/datastore.html#ckanext.datastore.logic.action.datastore_upsert for details
curl -d @payload.upsert.json -H "Authorization: XXXX" http://sandboxdw.pediacities.com/api/action/datastore_upsert
# Contents of payload.upsert.json:
#
# {
# "resource_id": "4f978bc5-fccd-4a74-85ef-f9f7bc05f38c",
# "records": [
# {"date": "1950-01-01", "price": "32.23"},
# {"date": "1950-01-02", "price": "32.24"}
# ],
# "method": "insert"
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment