{"action":"created","issue":{"url":"https://api.github.com/repos/json-api/json-api/issues/935","labels_url":"https://api.github.com/repos/json-api/json-api/issues/935/labels{/name}","comments_url":"https://api.github.com/repos/json-api/json-api/issues/935/comments","events_url":"https://api.github.com/repos/json-api/json-api/issues/935/events","html_url":"https://github.com/json-api/json-api/issues/935","id":120246156,"number":935,"title":"Question: What would be the JSON API way of permforming actions?","user":{"login":"abrykajlo","id":1366204,"avatar_url":"https://avatars.githubusercontent.com/u/1366204?v=3","gravatar_id":"","url":"https://api.github.com/users/abrykajlo","html_url":"https://github.com/abrykajlo","followers_url":"https://api.github.com/users/abrykajlo/followers","following_url":"https://api.github.com/users/abrykajlo/following{/other_user}","gists_url":"https://api.github.com/users/abrykajlo/gists{/gist_id}","starred_url":"https://api.github.com/users/abrykajlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrykajlo/subscriptions","organizations_url":"https://api.github.com/users/abrykajlo/orgs","repos_url":"https://api.github.com/users/abrykajlo/repos","events_url":"https://api.github.com/users/abrykajlo/events{/privacy}","received_events_url":"https://api.github.com/users/abrykajlo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-03T19:10:23Z","updated_at":"2015-12-19T12:35:42Z","closed_at":null,"body":"The intention of actions in this case is providing a way to do things like duplicating models or activating models, things that require extra logic behind the curtains. This would be some form of extension. For our use case we have a model that the user can duplicate which has many other relations that need to be duplicated as well. We have all the logic planned out and implemented just haven't tied it in to our API. We were planning on doing something like a `POST` or `PATCH` to `/v2/:model/:id/duplicate` but I am thinking there might be a better more JSON API way of doing things. Like a `POST` to `/v2/:model` with body \r\n\r\n```\r\n{\r\n    \"data\": {\r\n        \"actions\": {\r\n              \"duplicate\": {\r\n                     \"id\": \"2\"\r\n              }\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nAlso should there be a conformity to how to go about extending JSON API? Should the extensions extend the style of urls or body of the request or are both okay. "},"comment":{"url":"https://api.github.com/repos/json-api/json-api/issues/comments/165981761","html_url":"https://github.com/json-api/json-api/issues/935#issuecomment-165981761","issue_url":"https://api.github.com/repos/json-api/json-api/issues/935","id":165981761,"user":{"login":"ethanresnick","id":471894,"avatar_url":"https://avatars.githubusercontent.com/u/471894?v=3","gravatar_id":"","url":"https://api.github.com/users/ethanresnick","html_url":"https://github.com/ethanresnick","followers_url":"https://api.github.com/users/ethanresnick/followers","following_url":"https://api.github.com/users/ethanresnick/following{/other_user}","gists_url":"https://api.github.com/users/ethanresnick/gists{/gist_id}","starred_url":"https://api.github.com/users/ethanresnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethanresnick/subscriptions","organizations_url":"https://api.github.com/users/ethanresnick/orgs","repos_url":"https://api.github.com/users/ethanresnick/repos","events_url":"https://api.github.com/users/ethanresnick/events{/privacy}","received_events_url":"https://api.github.com/users/ethanresnick/received_events","type":"User","site_admin":false},"created_at":"2015-12-19T12:35:42Z","updated_at":"2015-12-19T12:35:42Z","body":"There's been some talk about how to do this, but nothing official yet. For now, I'd suggest `POST`ing to `/v2/:model/:id` with a custom (i.e. non JSON API) body, and just sending that request as plain `Content-Type: application/json`, rather than using the JSON API media type. Then, once JSON API supports this, you can switch that POST endpoint over to accepting both the custom JSON form and the standard JSON API one, and gradually transition your clients over to the latter."}}