python-rtkit icon indicating copy to clipboard operation
python-rtkit copied to clipboard

Comment API with attachment

Open rashed2014 opened this issue 7 years ago • 0 comments

Hello, it seems there are some issues with the comment API with Attachment. I am able to send .txt file but nothing else. Not even .JPG. I keep getting [ERROR] 'ascii' codec can't decode byte 0xef in position 407: ordinal not in range(128). Here is my code:

file_open = file(full_filename) content = {

                "content": {
                    'id': _ticket,
                    'Action': 'comment',
                    'Text': comment_text,
                    'Attachment': uploaded_filename
                },
                'attachment_1': file_open
            }

resource = RTResource(uri, username, password, CookieAuthenticator)

response = resource.post(path='ticket/' + _ticket + '/comment', payload=content, )

Any suggestion?

rashed2014 avatar Sep 13 '17 18:09 rashed2014