I tried adding an index N on one of the Identity Roles but received an error.
{
"messages": [
{
"localeOrigin": "REQUEST",
"locale": "en-US",
"text": "The request was syntactically correct but its content is semantically invalid."
},
{
"localeOrigin": "DEFAULT",
"locale": "en-US",
"text": "The request was syntactically correct but its content is semantically invalid."
}
],
"detailCode": "400.1 Bad request content",
"trackingId": "2213016e41524c70bec9e1cd4da285db"
}
And Content-type in Header should be application/json-patch+json
However, I noticed that this is still returning error (even when I used the body directly from SP document page) though it has worked several times in the past for me
{
"messages": [
{
"localeOrigin": "DEFAULT",
"locale": "en-US",
"text": "The request could not be parsed."
},
{
"localeOrigin": "REQUEST",
"locale": "en-US",
"text": "The request could not be parsed."
}
],
"detailCode": "400.0 Bad request syntax",
"trackingId": "2cbe449f8add46e0a7a2260763956fb6"
}
Not sure what am I missing and hoping someone in the community will be able to resolve this
The body you have provided is returning same error. However, you can use the below body to execute the patch operation successfully but the only catch is you have to provide the existing ids of the access profiles present in the role so that the new access profile will not overwrite the existing profiles.
Body:
The add operation requires you to specify an index where you want to add the item, and the value should be the single item you want to add. When you have an array of objects, the value should just be a single object with no array brackets. For example, this payload will add a single access profile to the end of the accessProfile array:
If you use the add operation and supply an array as the value, then it will behave the same as the replace operation. It will overwrite whatever array is already there. You can read more about the add operation here: