Sync photo failed use the Microsoft Graph API

Wendy SH. Wang 21 Reputation points
2022-07-08T01:34:05.363+00:00

Hi Experts,

I have a integration that sync profile photo from Workday to Office. I used the ms graph API. From API doc, I know that there is a limitation that size <4m.

Below is my coding using C#. It always success.

Q1 When I sync pic like the goat(1300k). It returned 400 error. Would you please help me out? Is there any limitation in office profile photo?
Q2 When I sync a pic (size great than 4m height:3993 width:6016) , API returned 400 error instead of 413(file size too large). why and would you please help me out?

218719-coding.jpg

![218757-sheep-1822137.jpg]2

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,715 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bhanu Kiran 3,526 Reputation points
    2022-07-11T11:47:07.507+00:00

    Hi @Wendy SH. Wang ,

    With respect to your first question, I tried replicating this issue using the same Image (with 1.3mb file size) on Postman and I got the same 400 error with following message:

    "error": {  
            "code": "ValidationWidthTooLarge",  
            "message": "Exception of type 'Microsoft.Fast.Profile.Core.Exception.ProfileBadRequestException' was thrown."  
    

    However, after changing the dimensions manually to height:3993 and width:3993, I was able to change the profile successfully. I would recommend you to make sure the dimensions are set correctly[1:1] as per the instructions provided in the document.

    With respect to your second question, I am not able to replicate this issue. So please allow me some time to investigate further on this.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful