I'm using requests to make a POST request to GroupMe's image service that should return a URL of the hosted image that I can use to post to a GroupMe thread. The documentation mentions that I need my access token and the binary image data in the payload in order to do this.
Here is a very simple example of how my code to do this currently looks:
import requests
access_token = 'my_access_token'
img_path = 'picture_name.jpg'
img_service_url = 'https://image.groupme.com/pictures'
r = requests.post(img_service_url, files={'file': img_path})
EDIT:
I looked at the documentation and source for the groupy.api.endpoint module Groupy(https://groupy.readthedocs.io/en/v0.6.2/_modules/groupy/api/endpoint.html#Images) and updated my script (reflected above) to use the same requests function parameters, but to no avail. Now the code returns a 500.
This worked for me (avatar.jpeg is in the same folder as my testing.py code below)
OUTPUT