Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.

Incoming Webhook "Hello World" Example #105

Closed
pvzig opened this issue Jun 6, 2017 · 4 comments
Closed

Incoming Webhook "Hello World" Example #105

pvzig opened this issue Jun 6, 2017 · 4 comments

Comments

@pvzig
Copy link
Owner

pvzig commented Jun 6, 2017

@tjb
Copy link

tjb commented Aug 4, 2017

While this is being created, would you be able to point me in the direction of where in the source code I could look to set this up? To expand: I specifically want to listen to an incoming webhook. I see there is a IncomingWebhook.swift but not sure how it ties into everything else.

@pvzig
Copy link
Owner Author

pvzig commented Aug 6, 2017

Hey Tyler,

There isn't a convenience function built into SlackKit to simplify this yet, but you could follow the example linked above (https://api.slack.com/tutorials/slack-apps-hello-world). The only difference would be you'd be using NSURLSession or something similar to send the POST instead of curl.

@tjb
Copy link

tjb commented Aug 7, 2017

Hey pvzig,

Thanks for the response! I will try this then. Do you mind explaining (whenever you have the time -- no rush!) how IncomingWebhook.swift works in the SlackKit ecosystem?

@pvzig
Copy link
Owner Author

pvzig commented Aug 8, 2017

If you're authing your Slack app using OAuth, you get a response object back that can contain an "incoming_webhook" (https://github.com/SlackKit/SKServer/blob/41e7f310132e66ccd1bc239389d6c3b0fd2c35f1/Sources/SKServer/Model/OAuthResponse.swift#L41) key with some information about that webhook like the URL. Once you had this information, you could post to an authed incoming webhook without hardcoding the URL in advance.

@pvzig pvzig closed this as completed Jul 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants