{"action":"created","issue":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/4353","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/4353/labels{/name}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/4353/comments","events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/4353/events","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/4353","id":108205495,"number":4353,"title":"[Ready to Review] API Bulk Modification","user":{"login":"pattisdr","id":9755598,"avatar_url":"https://avatars.githubusercontent.com/u/9755598?v=3","gravatar_id":"","url":"https://api.github.com/users/pattisdr","html_url":"https://github.com/pattisdr","followers_url":"https://api.github.com/users/pattisdr/followers","following_url":"https://api.github.com/users/pattisdr/following{/other_user}","gists_url":"https://api.github.com/users/pattisdr/gists{/gist_id}","starred_url":"https://api.github.com/users/pattisdr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pattisdr/subscriptions","organizations_url":"https://api.github.com/users/pattisdr/orgs","repos_url":"https://api.github.com/users/pattisdr/repos","events_url":"https://api.github.com/users/pattisdr/events{/privacy}","received_events_url":"https://api.github.com/users/pattisdr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-09-24T20:14:44Z","updated_at":"2015-10-13T13:52:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/4353","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/4353","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/4353.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/4353.patch"},"body":"# Purpose\r\n\r\nAllows bulk modifications of nodes, contributors, children, and node-links.  You can:\r\n- Create/update/delete multiple nodes /v2/nodes/\r\n- Create/update/delete multiple contributors /v2/nodes/{node_id}/contributors/\r\n- Create multiple children /v2/nodes/{node_id}/children/\r\n- Create/delete multiple node-links /v2/nodes/{node_id}/node_links/\r\n\r\nIssue: https://openscience.atlassian.net/browse/OSF-4234\r\n\r\nComplies with json-api bulk extension: \r\nhttp://jsonapi.org/extensions/bulk/\r\n\r\n**Note:** `application/vnd.api+json; supported-ext=\"bulk\"` is **not** in Content-Type header.  The negotiation mechanism is very likely to change http://discuss.jsonapi.org/t/bulk-extension-how-much-is-expected-to-change-prior-to-v1-1/121\r\n\r\n# Changes\r\n1) To **create** multiple nodes, send POST request to /v2/nodes/ with array of resource objects.  Each object needs a `type` and `attributes` field.\r\n```\r\nPOST /v2/nodes/\r\n        {\r\n            \"data\": [{\r\n                \"type\": \"nodes\",\r\n                \"attributes\": {\r\n                    \"title\": \"New title\", \r\n                    \"category\": \"project\"\r\n                }\r\n            },\r\n                {\r\n                \"type\": \"nodes\",\r\n                \"attributes\": {\r\n                    \"title\": \"Better title\", \r\n                    \"category\": \"project\"\r\n                }\r\n            }]\r\n        }\r\n\r\n```\r\n2) To **update** multiple nodes, sent PUT or PATCH request to /v2/nodes/ with array of resource objects. Each object must have `type` and `id`.\r\n```\r\nPATCH /v2/nodes/\r\n        {\r\n            \"data\": [{\r\n                \"id\": \"fdxfr\",\r\n                \"type\": \"nodes\",\r\n                \"attributes\": {\r\n                    \"title\": \"New title\", \r\n                    \"category\": \"instrumentation\"\r\n                }\r\n            },\r\n                {\r\n                \"id\": \"dsfsa\",\r\n                \"type\": \"nodes\",\r\n                \"attributes\": {\r\n                    \"title\": \"Better title\", \r\n                    \"category\": \"hypothesis\"\r\n                }\r\n            }]\r\n        }\r\n```\r\n3) To **delete** multiple nodes, send DELETE request to /v2/nodes/ with array of resource objects. Each object must have `type` and `id`.\r\n```\r\nDELETE /v2/nodes/\r\n\r\n        {\r\n            \"data\": [{\r\n                \"id\": \"fdxfr\",\r\n                \"type\": \"nodes\",\r\n            },\r\n                {\r\n                \"id\": \"dsfsa\",\r\n                \"type\": \"nodes\",\r\n            }]\r\n        }\r\n```"},"comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/comments/147721791","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/4353#issuecomment-147721791","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/4353","id":147721791,"user":{"login":"brianjgeiger","id":6599111,"avatar_url":"https://avatars.githubusercontent.com/u/6599111?v=3","gravatar_id":"","url":"https://api.github.com/users/brianjgeiger","html_url":"https://github.com/brianjgeiger","followers_url":"https://api.github.com/users/brianjgeiger/followers","following_url":"https://api.github.com/users/brianjgeiger/following{/other_user}","gists_url":"https://api.github.com/users/brianjgeiger/gists{/gist_id}","starred_url":"https://api.github.com/users/brianjgeiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianjgeiger/subscriptions","organizations_url":"https://api.github.com/users/brianjgeiger/orgs","repos_url":"https://api.github.com/users/brianjgeiger/repos","events_url":"https://api.github.com/users/brianjgeiger/events{/privacy}","received_events_url":"https://api.github.com/users/brianjgeiger/received_events","type":"User","site_admin":false},"created_at":"2015-10-13T13:52:08Z","updated_at":"2015-10-13T13:52:08Z","body":"Gotcha. I see what you're saying, and that works if they keep with their promise and don't break compatibility. But if they decide they have to do something different, then it just breaks in a different way. It only really matters either way if we put it in the public docs.\r\n\r\nDo we know which options are currently on the table for extension negotiation? I haven't read through that closely yet. Maybe it just doesn't matter that much."}}