adaptiveteam / adaptive

Umbrella repo for Adaptive library code
2 stars 0 forks source link

Slack does not send `APIAppID` #379

Open Primetalk opened 4 years ago

Primetalk commented 4 years ago

Here is the request that Slack sends to us:

{
    "type": "interactive_message",
    "actions": [
        {
            "name": "menu_list",
            "type": "select",
            "selected_options": [
                {
                    "value": "create_strategy_objective"
                }
            ]
        }
    ],
    "callback_id": "init_message",
    "team": {
        "id": "TLSQ8TA2E",
        "domain": "adaptive-demo-two"
    },
    "channel": {
        "id": "DLXNE5VFD",
        "name": "directmessage"
    },
    "user": {
        "id": "ULXSA5N9X",
        "name": "bharath.kumar"
    },
    "action_ts": "1590580114.474550",
    "message_ts": "1590580094.000300",
    "attachment_id": "1",
    "token": "6UOqkAb4aDbaf02nUvAHLrZQ",
    "is_app_unfurl": false,
    "original_message": {
        "bot_id": "BMB1TMP47",
        "type": "message",
        "text": "",
        "user": "UMB1TMP6K",
        "ts": "1590580094.000300",
        "team": "TLSQ8TA2E",
        "bot_profile": {
            "id": "BMB1TMP47",
            "deleted": false,
            "name": "adaptive",
            "updated": 1566309976,
            "app_id": "AMB9JC6DU",
            "icons": {
                "image_36": "https:\/\/avatars.slack-edge.com\/2019-08-20\/720737229570_33e618aa38dcc9823e3b_36.png",
                "image_48": "https:\/\/avatars.slack-edge.com\/2019-08-20\/720737229570_33e618aa38dcc9823e3b_48.png",
                "image_72": "https:\/\/avatars.slack-edge.com\/2019-08-20\/720737229570_33e618aa38dcc9823e3b_72.png"
            },
            "team_id": "TLSQ8TA2E"
        },
        "attachments": [
            {
                "callback_id": "init_message",
                "fallback": "Adaptive at your service",
                "title": "Hi! What can I help you with today?",
                "id": 1,
                "color": "3AA3E3",
                "actions": [
                    {
                        "id": "1",
                        "name": "menu_list",
                        "text": "Pick an option...",
                        "type": "select",
                        "data_source": "static",
                        "option_groups": [
                            {
                                "text": "Urgent Responsibilities",
                                "options": [
                                    {
                                        "text": "Update Objectives",
                                        "value": "stale_objectives_for_me"
                                    },
                                    {
                                        "text": "Update Initiatives",
                                        "value": "stale_initiatives_for_me"
                                    },
                                    {
                                        "text": "Create IDO",
                                        "value": "create_ido_now"
                                    }
                                ]
                            },
                            {
                                "text": "Responsibilities",
                                "options": [
                                    {
                                        "text": "All Objectives",
                                        "value": "view_advocacy_objectives"
                                    },
                                    {
                                        "text": "All Initiatives",
                                        "value": "view_advocacy_initiatives"
                                    },
                                    {
                                        "text": "Provide Feedback",
                                        "value": "give feedback"
                                    },
                                    {
                                        "text": "Request Feedback",
                                        "value": "request feedback"
                                    }
                                ]
                            },
                            {
                                "text": "View",
                                "options": [
                                    {
                                        "text": "Vision",
                                        "value": "view_edit_vision"
                                    },
                                    {
                                        "text": "Objectives",
                                        "value": "view_strategy_objectives"
                                    },
                                    {
                                        "text": "Initiatives",
                                        "value": "view_capability_community_initiatives"
                                    },
                                    {
                                        "text": "Competencies",
                                        "value": "adaptive_values:list"
                                    },
                                    {
                                        "text": "Current Quarter Events",
                                        "value": "current_quarter_schedule"
                                    },
                                    {
                                        "text": "Next Quarter Events",
                                        "value": "next_quarter_schedule"
                                    },
                                    {
                                        "text": "Advocates",
                                        "value": "view_advocates"
                                    }
                                ]
                            },
                            {
                                "text": "Create",
                                "options": [
                                    {
                                        "text": "Objectives",
                                        "value": "create_strategy_objective"
                                    },
                                    {
                                        "text": "Objective Communities",
                                        "value": "create_capability_community"
                                    },
                                    {
                                        "text": "Initiatives",
                                        "value": "create_initiative"
                                    },
                                    {
                                        "text": "Initiative Communities",
                                        "value": "create_initiative_community"
                                    }
                                ]
                            },
                            {
                                "text": "Settings",
                                "options": [
                                    {
                                        "text": "Update",
                                        "value": "update settings"
                                    }
                                ]
                            },
                            {
                                "text": "Reports",
                                "options": [
                                    {
                                        "text": "Strategy Performance",
                                        "value": "StrategyPerformanceReport"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "2",
                        "name": "cancel",
                        "text": "I am good for now, thank you!",
                        "type": "button",
                        "value": "init_message",
                        "style": ""
                    }
                ]
            }
        ]
    },
    "response_url": "https:\/\/hooks.slack.com\/actions\/TLSQ8TA2E\/1160332646849\/6HqkOn6ZvvSeBnc1luEnBV62",
    "trigger_id": "1147918313587.706824928082.fa145fa7f1eed4c63f8305e73d9bc379"
}

There is app_id buried in original_message. And there is no top-level APIAppID which is expected by slack-go library.

Primetalk commented 4 years ago