question

Chad Corey avatar image
Chad Corey asked Phong Vu answered

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:\Users\cacarey\Documents\iface.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);
rest api
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Phong Vu avatar image
Phong Vu answered

Try

att.contentType = "image/jpeg";
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys