Search code examples
emailoutlookmicrosoft-graph-api

Microsoft Graph Api {"code":"ErrorInvalidPropertySet","message":"Set action is invalid for property."}


We use

PATCH https://graph.microsoft.com/v1.0/users/{userId}/{messageId}/ 

to update the just created email draft in order to send it later.

During the call we get 400 error with the next text -> '{"error":{"code":"ErrorInvalidPropertySet","message":"Set action is invalid for property."}}'

We get it only for several mailboxes. What could be the possible reason? Is it related to the mailbox configuration? What should we pay attention to?


Solution

  • The issue was in internetMessageHeaders field. We used this field in our PATCH payload, but it is not presented in PATCH method at all and sometimes Microsoft Graph API returns 400, but sometimes not.(even in case of no error this field is ignored) So if you face this issue - just check whether you send the internetMessageHeaders field in your payload or not.

    I guess it could be applied to all other readonly fields.