Mattermost, Inc.

Can't open Mattermost Interactive Dialog

Hi,

we are trying to open an interactive dialog, but we get the following error:

mattermostdriver.exceptions.InvalidOrMissingParameters: Ungültiger oder fehlender dialog in Anfrage.

(mattermostdriver.exceptions.InvalidOrMissingParameters: Invalid or missing dialog in request).

We are using Mattermost 5.14.1 Enterprise and we trigger the dialog with a slash command, as framework we are using Python 3.5 / uwsgi / Python-Mattermost-Driver (https://github.com/Vaelor/python-mattermost-driver)

Python Code:
# Mattermost Connector
mm.login()

payload = {
    'trigger_id' : request.form['trigger_id'],
    'url' : 'https://localhost/echo',
    'dialog' : {
        'callback_id' : 'cb-ver',
        'title' : 'Veranstaltung', 
        'elements' : [{'display_name' : 'Email',
                        'name' : 'email',
                        'type' : 'text'}],
        "submit_label":"Submit",
        "state":"somestate"
    }
}

jsonpayload=json.dumps(payload)
mm.client.make_request('post', '/actions/dialogs/open', options=jsonpayload, params=None, data=None, files=None, basepath=None)

payload = {'text': 'Output: ' + jsonpayload}
return jsonify(payload)

Appreciate your help,
Regards
Chris

@cee Wondering if this earlier thread might help in your case: Cannot open interactive dialog.

Hi,

thanks for your quick hint. But, sorry no. We have no lag time between the requests.
Is there any way to get more debug information from mattermost?

Regards,
Chris

Maybe this helps other people:

We solved the problem by using a direct python post request and not the python drivers make_request-Function:

r = requests.post("https://your-server.com/api/v4/actions/dialogs/open", data=jsonpayload);