2

I can successfully post a message in yammer but when itry to post an image

import yampy
access_token = 'access_token_id'
attachment = 'C:\\Users\\userdir\\Desktop\\picture.png'
yammer = yampy.Yammer(access_token=access_token)
yammer.client.post('/messages', body="testing_please_ignore", group_id=123233, broadcast=True, attachment1=attachment)

i got following error

Traceback (most recent call last):
  File "C:\Users\userdir\workspace_new\challenges\yammer.py", line 30, in <module>
    attachment1='C:\\Users\\userdir\\Desktop\\Desktop\\logo.png')
  File "C:\Python27\lib\site-packages\yampy\client.py", line 51, in post
    return self._request("post", path, **kwargs)
  File "C:\Python27\lib\site-packages\yampy\client.py", line 77, in _request
    return self._parse_response(response)
  File "C:\Python27\lib\site-packages\yampy\client.py", line 94, in _parse_response
    raise self._exception_for_response(response)
yampy.errors.ResponseError: 500 error: Internal Server Error

i am going through following documentation https://developer.yammer.com/docs/messages-json-post

Can any one help ?

duck
  • 2,483
  • 1
  • 24
  • 34
  • I'll try and look at this over the next couple of days. Having worked through this with the HttpClient library in C# the endpoint is particular about how the request is encoded. Can you follow http://stackoverflow.com/questions/10588644/how-can-i-see-the-entire-http-request-thats-being-sent-by-my-python-application/16630836#16630836 and post more output at the HTTP level from your app? – Brian Lyttle Aug 04 '15 at 08:50
  • yesterday after spending hours on yampy, i gave up on it. To solve the problem i have to use "request" library which works. The problem is with the content-type, yampy does not provide any option to change that. Anyway thanks – duck Aug 04 '15 at 10:16
  • Anybody ever found any solution for this one? – S4nd33p Dec 04 '16 at 00:20

0 Answers0