Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

422 Unprocessable Entity for app_home_opened #10

Closed
GH-maggio opened this issue Apr 14, 2020 · 5 comments
Closed

422 Unprocessable Entity for app_home_opened #10

GH-maggio opened this issue Apr 14, 2020 · 5 comments

Comments

@GH-maggio
Copy link
Contributor

I am unable to process app_home_opened events, getting 422 errors. I am able to process 'message.im' events fine. Is there an issue with the incoming payloads on these two being different?

https://api.slack.com/events/message.im
{ "token": "one-long-verification-token", "team_id": "T061EG9R6", "api_app_id": "A0PNCHHK2", "event": { "type": "message", "channel": "D024BE91L", "user": "U2147483697", "text": "Hello hello can you hear me?", "ts": "1355517523.000005", "event_ts": "1355517523.000005", "channel_type": "im" }, "type": "event_callback", "authed_teams": [ "T061EG9R6" ], "event_id": "Ev0PV52K21", "event_time": 1355517523 }

https://api.slack.com/events/app_home_opened
{ "type": "app_home_opened", "user": "U061F7AUR", "channel": "D0LAN2Q65", "event_ts": "1515449522000016", "tab": "home", "view": { "id": "VPASKP233", "team_id": "T21312902", "type": "home", "blocks": [ ... ], "private_metadata": "", "callback_id": "", "state":{ ... }, "hash":"1231232323.12321312", "clear_on_close": false, "notify_on_close": false, "root_view_id": "VPASKP233", "app_id": "A21SDS90", "external_id": "", "app_installed_team_id": "T21312902", "bot_id": "BSDKSAO2" } }

@GH-maggio
Copy link
Contributor Author

Issue is the slack event app_home_opened does not have the authed_users field. Work around is to comment this out in model.py for now.

Per slack:

Aubrey (Slack)
Apr 16, 5:07 PM PDT
Hi Chris,
Thanks for getting in touch about this. I'm not sure we can answer this question since you're using a third-party library, and the validation in that library is what caused the event callback to get rejected.
Therefore, it seems like something the library author would need to answer, and it seems you've already sent that question (or a similar one) to them: #10
Hopefully they can confirm whether or not a future payload change will be an issue. Thanks for checking with them.
Aubrey

@GH-maggio
Copy link
Contributor Author

I'll generate a pull request for the following change to models.py:

authed_users: Optional[List[str]]

@uhavin
Copy link
Owner

uhavin commented Apr 30, 2020

@GH-maggio Thanks, I'll review the pull request.

@GH-maggio
Copy link
Contributor Author

GH-maggio commented Apr 30, 2020

Updated in PR #11

@uhavin
Copy link
Owner

uhavin commented Apr 30, 2020

Thanks for your contribution, @GH-maggio. Has been fixed in 0.4.4.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants