Skip to content

Update metadata #22

@timwis

Description

@timwis

Just noticed there's a create method and a get_metadata method using the same endpoint, but no update method. Here's some relevant info from Socrata on the /api/views.json endpoint:

PUT to /api/views/unique_id.json with a subset of what you want to update. For instance, if you want to add tags to the previously created dataset (currently this is the only way to add tags), you can simply PUT to the endpoint with:

{
  "tags": ["these", "words", "are", "tags"]
}

You'll probably also want to make this dataset public and publish it, so you'll want to perform the two following operations as well:
PUT /views/unique_id?method=setPermission&value=public.read
POST /api/views/unique_id/publication.json

One important thing to note about updates is that if you want to update something within the "custom metadata", you will have to copy the entire metadata object since it does a replace.

Note that I've heard over the year(s) that the views endpoint is/will be deprecated, but until there's a clear alternative it probably makes sense to continue to use it.

Anyway, I may get a chance to work on this, but wanted to post the details here in case anyone else is interested.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions