Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send files #1

Open
arysaj opened this issue Jan 5, 2019 · 1 comment
Open

Send files #1

arysaj opened this issue Jan 5, 2019 · 1 comment

Comments

@arysaj
Copy link

arysaj commented Jan 5, 2019

Hi! I do like this.

def send_msg(con_id, msg, document=None):
    params = {'msg': msg}
    files = None
    if document:
        with open(document, 'rb') as file:
            file_bytes = file.read()
        files = {
            'document': (document, file_bytes, 'image/jpeg'),
        }
    return conn.call('POST', '/api/contact_message_post/{}/'.format(con_id), params=params, files=files)

But in response.
{"error": {"message": "HMAC authentication key and signature was given, but they are invalid.", "error_code": 41}}

Help send file to chat

@Chuox
Copy link

Chuox commented Jul 7, 2019

make sure your API key has post "WRITE" scope

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

No branches or pull requests

2 participants