Image Upload API giving dishonest errors

meatcomputermeatcomputer Member Posts: 23
Hello, I am in the midst of writing a program which interfaces with the lightspeed api.
Everything has been going smoothly so far until today when I tried to use the image uploading functionality of the API as described here
Upon trying to test the system using the provided python code I get errors saying that my image exceeds 8MB, the image I was testing with is less than 10kb so I'm clearly getting an erroneous error message.
Here is my code

def upload_image_to_lightspeed():
    files = {'image': ('testimage.jpg', open("/home/meatcomputer/Desktop/avatar.jpg", "rb")
        , 'image/jpeg')}
    payload = {
        "description": "Test Image",
        "ordering": 1,

    r =, files=files, data=payload, headers=headers)
    return r

Why am I getting this error message and what can I do to address


Sign In or Register to comment.