Uploading Images Via App Store Connect API Not Working

Hello, I'm trying to upload assets using the app store connect api, I have successfully created a screenshot set, and created a screenshot reservation and got back the following response:

    "data": {
        "type": "appScreenshots",
        "id": "...",
        "attributes": {
            "fileSize": 4833,
            "fileName": "Untitled.png",
            "sourceFileChecksum": null,
            "imageAsset": null,
            "assetToken": "...",
            "assetType": "SCREENSHOT",
            "uploadOperations": [
                {
                    "method": "PUT",
                    "url": "...",
                    "length": 4833,
                    "offset": 0,
                    "requestHeaders": [
                        {
                            "name": "Content-Type",
                            "value": "image/png"
                        }
                    ]
                }
            ],
            "assetDeliveryState": {
                "errors": [],
                "warnings": null,
                "state": "AWAITING_UPLOAD"
            }
        },
        "links": {
            "self": "..."
        }
    },
    "links": {
        "self": "https://api.appstoreconnect.apple.com/v1/appScreenshots"
    }
}

The documentation states that I should use the "UploadOperations" to upload the image using the "put" method and using the url provided in the response under "UploadOperations", however I am not sure what to send in the body of the put request.

I have tried the following but it is returning an empty response:

headers = {
     "name": "Content-Type",
      "value": "image/png"
}
urlUpload = response.json()["data"]["attributes"]["uploadOperations"][0]["url"]

response = requests.put(urlUploadTo,image=image, headers=headers)

What exactly am I doing wrong here? Is there something I'm missing?

The following link is the link to the documentation explaining how to upload assets.

Replies

I don't know the direct solution to your issue, but I'm using appstoreconnect-swift-sdk on GitHub to interact with the API. I found it quite easy to upload images, but feel free to ask if you're having problems.