Skip to content

Commit

Permalink
Implement slack url_verification responce
Browse files Browse the repository at this point in the history
  • Loading branch information
asus4 committed Jun 24, 2022
1 parent fbbf842 commit 5ff96ab
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@ def respond(err, res=None):

def lambda_handler(event, context):
logger.info(f"Received event: {json.dumps(event)}")

body = json.loads(event['body'])

# https://api.slack.com/events/url_verification
# Just return the challenge for url_verification
if body['type'] == 'url_verification':
return {
'statusCode': '200',
'body': body['challenge'],
'headers': { 'Content-Type': 'text/plain' },
}
return respond(None, body)


Expand Down

0 comments on commit 5ff96ab

Please sign in to comment.