Upload Logo for Bookmark Apps via API with Python

Is it possible to upload the lo for Bookmark Apps via API?
We have tried several things with Phyton with no success, this script will not error out but the logo is not uploaded.

import asyncio
from okta.client import Client as OktaClient
from okta import models

config = {
‘orgUrl’: ‘ourOktaOrgUrl’,
‘token’: ‘api token’

client = OktaClient(config)
async def main():
app_id = “the bookmark app ID”
OKTA_DOMAIN = “our okta domain”

        app, _ = await client.upload_application_logo(app_id, 'logo.png')
        errors = []
    print("App Updated")

loop = asyncio.get_event_loop()


Have you tried doing this operation with the API Directly?

This should make the same API call as the SDK,

Can you verify the file you are uploading conforms to,

The file must be in PNG, JPG, SVG, or GIF format, and less than 1 MB in size. For best results, use an image with a transparent background and a square dimension of 200px by 200px to prevent upscaling.

If so and no error is returned, even when using the API directly do you see any messages in the Orgs System log.

If all of the above seems to succeed and there are no errors in the logs let us know.

thank you,

1 Like

We tried to the API call directly and are getting a 400 bad request error

import requests

headers = {
    'Accept': 'application/json',
    'Authorization': 'ourAPIKey',

files = {
    'file': open('logo.png', 'rb'),

response = requests.post('https://org.oktapreview.com/api/v1/apps/ourAppID/logo', headers=headers, files=files)