GLB upload: response 200, but not appearing.

BeamJokerFavor
Tourist
6 0 0

I am trying to upload a gbl to one of my six variants. I am mixing the python api and REST api. It seems to be uploading, and it returns a 200 code, but the GBL does not appear. There are no errors. Does it matter that this account is still in trial?

 

 

 

response = requests.post('http://specialsnowflake.myshopify.com/admin/api/2021-01/products/{}/images.json'.format(this_item.id), json=my_request)

 

 

 

  This is how I make my request:

 

 

glb = fetch_glb(title)
    #assign the glb to the first image.
    filename='{}.glb'.format(title)
    my_request = {
        "image": {
            "variant_ids": [first_variant.id],
            "position": 1,
            "attachment": glb,
            "filename" : filename
        }

 

 
#This is how I load the glb.

 

def fetch_glb(title):
    filename1 = title + '.glb'
    glb_path = root / 'assets' / 'ready_glbs' / filename1
    with open(glb_path, "rb") as image:
        f = image.read()
        encoded = b64encode(f)
        decoded = encoded.decode('ascii')
        return decoded

 

#This returns a value in ascii bytes, it is not null.
0 Likes