{"action":"created","issue":{"url":"https://api.github.com/repos/Seldaek/monolog/issues/743","repository_url":"https://api.github.com/repos/Seldaek/monolog","labels_url":"https://api.github.com/repos/Seldaek/monolog/issues/743/labels{/name}","comments_url":"https://api.github.com/repos/Seldaek/monolog/issues/743/comments","events_url":"https://api.github.com/repos/Seldaek/monolog/issues/743/events","html_url":"https://github.com/Seldaek/monolog/issues/743","id":140710488,"number":743,"title":"Getting token to use Monolog with Slack","user":{"login":"nisbeti","id":13681779,"avatar_url":"https://avatars.githubusercontent.com/u/13681779?v=3","gravatar_id":"","url":"https://api.github.com/users/nisbeti","html_url":"https://github.com/nisbeti","followers_url":"https://api.github.com/users/nisbeti/followers","following_url":"https://api.github.com/users/nisbeti/following{/other_user}","gists_url":"https://api.github.com/users/nisbeti/gists{/gist_id}","starred_url":"https://api.github.com/users/nisbeti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nisbeti/subscriptions","organizations_url":"https://api.github.com/users/nisbeti/orgs","repos_url":"https://api.github.com/users/nisbeti/repos","events_url":"https://api.github.com/users/nisbeti/events{/privacy}","received_events_url":"https://api.github.com/users/nisbeti/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Seldaek/monolog/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/Seldaek/monolog/labels/Documentation","name":"Documentation","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-03-14T15:38:57Z","updated_at":"2016-08-28T19:26:07Z","closed_at":null,"body":"It is not straight forward to get a token to use monolog with Slack. The expectation is that you write an OAuth client to get the token, but it is possible to get it manually. These are the steps I followed today:\r\n\r\nYou should already have an account and a channel set up that you want to send error messages to.\r\n1. Create a new Slack App - https://api.slack.com/applications/new which will give you a client_id and a client_secret which you need for step two. You will need to enter a redirect URI, which can be any page for this purpose.\r\n2. Got to https://slack.com/oauth/authorize?client_id=[client_id]&scope=chat:write:bot\r\n3. Authorise App on the page that is returned.\r\n4. From the URI copy the code that is returned.\r\n5. Go to https://slack.com/api/oauth.access?client_id=[client_id]&client_secret=[client_secret]&code=[code]\r\n6. Your token is in the JSON that is displayed.\r\n\r\nTO debug errors insert echo fread($this->resource, 1000); at the end of the writeToSocket method of Monolog/Handler/SocketHandler (see https://github.com/Seldaek/monolog/issues/514)"},"comment":{"url":"https://api.github.com/repos/Seldaek/monolog/issues/comments/242994019","html_url":"https://github.com/Seldaek/monolog/issues/743#issuecomment-242994019","issue_url":"https://api.github.com/repos/Seldaek/monolog/issues/743","id":242994019,"user":{"login":"hkdobrev","id":506129,"avatar_url":"https://avatars.githubusercontent.com/u/506129?v=3","gravatar_id":"","url":"https://api.github.com/users/hkdobrev","html_url":"https://github.com/hkdobrev","followers_url":"https://api.github.com/users/hkdobrev/followers","following_url":"https://api.github.com/users/hkdobrev/following{/other_user}","gists_url":"https://api.github.com/users/hkdobrev/gists{/gist_id}","starred_url":"https://api.github.com/users/hkdobrev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hkdobrev/subscriptions","organizations_url":"https://api.github.com/users/hkdobrev/orgs","repos_url":"https://api.github.com/users/hkdobrev/repos","events_url":"https://api.github.com/users/hkdobrev/events{/privacy}","received_events_url":"https://api.github.com/users/hkdobrev/received_events","type":"User","site_admin":false},"created_at":"2016-08-28T19:26:07Z","updated_at":"2016-08-28T19:26:07Z","body":"I also think that this is not about documentation. The Slack handler should use incoming webhooks. They are made for things like that and are quite simpler to configure. The Slack OAuth apps get published and you describe how other users could install them. I'm sure almost all cases for the Monolog Slack handler are about logging something to your team Slack.\r\n\r\nWe could change the way the Slack handler works in a backward-compatible manner as the tokens for webhooks and OAuth apps are structured differently and webhooks also need the team slug. If we don't want to support both cases, then this should be a BC break and it would be great if that could be decided before 2.0 is out so we could get it in that release if needed.\r\n\r\n@Seldaek What do you think?"}}
{"actor":{"display_login":"hkdobrev"}}