Skip to main content
The First Step
Sep 30, 2021 3:08 PM UTC
Question

Creating/Updating profile image.

Your API documentation only shows this as a form submission but we are trying to do this without user interaction.


I think what I may be missing is the content type for the CreateUserProfileImageRequest attachment.

using C# this is what I tried. Error was "the format of value 'image' is invalid.

byte[] b = System.IO.File.ReadAllBytes(@"C:UserscacareyDocumentsiface.jpg");


            CreateUserProfileImageRequest cp = new CreateUserProfileImageRequest();
            RingCentral.Attachment att = new Attachment();
            att.filename = "iface.jpg";
            att.content = b;
            att.contentType = "image";
            cp.image = att;


            
            var rr = await restClient.Restapi().Account(accountID).Extension(extID).ProfileImage().Post(cp);

    3 replies

    PhongVu
    Community Manager
    Community Manager
    Sep 30, 2021 4:16 PM UTC

    Try

    att.contentType = "image/jpeg";
    The First Step
    Jul 28, 2022 5:27 PM UTC

    What is the best image size to use for this or how does the scaling option work?

    PhongVu
    Community Manager
    Community Manager
    Jul 28, 2022 6:04 PM UTC

    These are the 3 scaled sizes. So I recommend using the max size 584x584

    90x90

    195x195

    584x584