{"action":"created","issue":{"url":"https://api.github.com/repos/facetoe/zenpy/issues/146","repository_url":"https://api.github.com/repos/facetoe/zenpy","labels_url":"https://api.github.com/repos/facetoe/zenpy/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/facetoe/zenpy/issues/146/comments","events_url":"https://api.github.com/repos/facetoe/zenpy/issues/146/events","html_url":"https://github.com/facetoe/zenpy/issues/146","id":253013451,"number":146,"title":"Support bulk `external_id` routes for Organizations","user":{"login":"onecrayon","id":33501,"avatar_url":"https://avatars3.githubusercontent.com/u/33501?v=4","gravatar_id":"","url":"https://api.github.com/users/onecrayon","html_url":"https://github.com/onecrayon","followers_url":"https://api.github.com/users/onecrayon/followers","following_url":"https://api.github.com/users/onecrayon/following{/other_user}","gists_url":"https://api.github.com/users/onecrayon/gists{/gist_id}","starred_url":"https://api.github.com/users/onecrayon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onecrayon/subscriptions","organizations_url":"https://api.github.com/users/onecrayon/orgs","repos_url":"https://api.github.com/users/onecrayon/repos","events_url":"https://api.github.com/users/onecrayon/events{/privacy}","received_events_url":"https://api.github.com/users/onecrayon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-25T20:45:14Z","updated_at":"2017-08-26T06:47:14Z","closed_at":null,"body":"Currently to bulk fetch or delete Organizations you have use their Zendesk IDs. However, there are routes for using the `external_id` to handle these tasks, which is preferable when doing something like mirroring data from a site/app/whatever to Zendesk.\r\n\r\nIt would be lovely if we could do things like the following:\r\n\r\n```python\r\n# Assume local_orgs is a list containing local organization objects\r\norgs = zenpy_client.organizations(external_ids=[i.id for i in local_orgs])\r\nzenpy_client.organizations.delete([Organization(external_id=i.id) for i in local_orgs])\r\n```\r\n\r\nI started implementing support for this here:\r\n\r\nhttps://github.com/facetoe/zenpy/compare/master...onecrayon:query-external-ids\r\n\r\nBut have not had a chance to test it yet (so wasn't comfortable submitting a PR). I will hopefully have a chance to test this out once I'm off work, but would love to hear if you have a better idea for how to implement support for this. :)"},"comment":{"url":"https://api.github.com/repos/facetoe/zenpy/issues/comments/325094854","html_url":"https://github.com/facetoe/zenpy/issues/146#issuecomment-325094854","issue_url":"https://api.github.com/repos/facetoe/zenpy/issues/146","id":325094854,"user":{"login":"facetoe","id":1366896,"avatar_url":"https://avatars2.githubusercontent.com/u/1366896?v=4","gravatar_id":"","url":"https://api.github.com/users/facetoe","html_url":"https://github.com/facetoe","followers_url":"https://api.github.com/users/facetoe/followers","following_url":"https://api.github.com/users/facetoe/following{/other_user}","gists_url":"https://api.github.com/users/facetoe/gists{/gist_id}","starred_url":"https://api.github.com/users/facetoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facetoe/subscriptions","organizations_url":"https://api.github.com/users/facetoe/orgs","repos_url":"https://api.github.com/users/facetoe/repos","events_url":"https://api.github.com/users/facetoe/events{/privacy}","received_events_url":"https://api.github.com/users/facetoe/received_events","type":"User","site_admin":false},"created_at":"2017-08-26T06:47:14Z","updated_at":"2017-08-26T06:47:14Z","body":"I can see how this would be very useful, but we need to be careful with the implementation to ensure that people don't accidentally delete the wrong objects. Adding support for external_ids introduces some ambiguity in how an object is identified, which could in the worse case lead to people deleting the wrong objects accidentally, which would be bad. \r\n\r\nI wonder if it would be better to add methods that explicitly operate on external_id for those endpoints that support them. That way there is no ambiguity. \r\n\r\nWhat do you think?\r\n\r\n"}}
{"actor":{"display_login":"facetoe"}}