Sam Mullin answer is correct, it's the first point you need to look at.
But for me even that didn't work out. I didn't consider incoming webhook(https://api.slack.com/messaging/webhooks), because that's also an option, but not in my case.
The thing that got me progressing is that slack has "Tester" tab for testing requests in its api method f.e. https://api.slack.com/methods/chat.postMessage/test. When you fill out the data and submit, the request you see in url also consists "token" and "pretty" arguments. I've added token argument only to authorization header, which didn't work for me, so I've added it also as param. For pretty argument I set same as text message.
I'm not sure about security issues, when passing token directly,somebody could correct me on that. But that's a variant that worked out for me.