Webhooks Setup

Slack V2 Webhook

23min
through pathfix automation, you can enable user webhook listening for all your user that have connected their slack accounts (v2) via pathfix oauth the following documentation will guide you on how you can setup your slack account and setup slack webhook listening for all your connected users setup in pathfix oauth before proceeding, make sure you have setup your slack v2 integration in pathfix oauth and have added the connect button for your users to be able to connect their slack accounts configure your slack v2 integration in pathfix oauth add the script tag in your application to allow your users to authenticate their slack accounts (detailed documentation for pathfix oauth setup can be found here ) setup in pathfix automation (part 1) create a blank automation by clicking on design and selecting new design give your first task a name to save the automation (autosave) click on the test and publish tab and click on test to run a test on the automation on successful completion, click on publish to live click on endpoints and copy the endpoint url for use in the webhook setup live endpoint is for live environments and dev endpoint is for testing/development click on webhooks from the top navigation and click on create new select slack v2 from the list of provider webhooks paste the endpoint url copied from the automation into the callback url section click on the pathfix oauth tab and enter your pathfix oauth public key and private key generate your webhook uri by clicking on the webhook uri section copy the generated uri for use in slack later do not click on save yet, we will need to complete the setup in slack, get the token for use in the webhook setup before saving setup in slack (part 1) in order to complete your slack webhook setup, you will need to add the callback url generated by the pathfix automation webhook and generate a token from your slack developer account generate slack token go to your slack developer app and select the app you want to setup the webhook against under basic information , scroll down to the verification token and copy it for use in the pathfix automation webhook setup setup in pathfix automation (part 2) paste the verification token received from slack into the verify tokens section of the pathfix automation webhook setup switch to the pathfix oauth tab and copy the webhook uri for use in slack click on save to save the setting on the webhooks page, click on activate against slack to activate your webhook the webhook activation will take a few seconds and will happen in the background (click on refresh on the top navigation to refresh the page) once activated, the webhook status will turn green setup in slack (part 2) in your slack app, click on event subscriptions enable the subscription event listening paste the copied pathfix automation webhook uri unto the request url section slack will automatically try to verify the webhook uri scroll down the page and select the type of events you would like to be notified for you can choose from bot events, events on behalf of users or app unfurl domains once you have made your selection, click on save changes your webhook has been setup testing your webhook setup we recommend running a test on your webhook setup to make sure the setup is right to do this go to your pathfix oauth account and click on test connection for slack v2 click on connect/re connect and connect a slack account on successful connection, the automation will start listening for changes in the connected slack account for the connected user (depending on what event you have chosen to listen to) you will see the webhook user count increase (if it doesnt increase at first, click on refresh on the top navigation) go to your slack app and create a test entry (depending on what event you selected to listen for) go to your pathfix automation account, click on monitor and select the automation from the list you should see the test event created would have triggered a webhook response your test is successful configure your automation now that your webhook has been setup successfully, you will need to copy the payload sent by slack and captured by pathfix automation to create your automation here are the few initial steps to get you going copy the request received from our test event go to the automation created and paste the request into the call data (json) section of the first task from here, you can call an api, run a condition or process the data as you please through the automation important any changes made to the automation will need to be done in the dev environment once changes are made, you will first have to test the automation and on successful completion then publish to live please note, without publishing to live, the changes will not go into effect few points to note on the json the pathfix user id is the same user id that is sent via the pathfix oauth system this generally is the current users unique id the data section of the json is the exact data that is sent by the provider need help? reach out to our support via support\@pathfix com or live chat through your pathfix dashboard