GraphAPI WorksheetProtection: unprotect function fails with: "The argument is invalid or missing or has an incorrect format.", but follows API specification?

Sean-2001 6 Reputation points
2021-05-05T11:09:33.477+00:00

When calling the unprotect function via the Graph Explorer, I'm getting an error: "The argument is invalid or missing or has an incorrect format.", but I believe I'm following everything that the api says it needs?

https://learn.microsoft.com/en-us/graph/api/worksheetprotection-unprotect?view=graph-rest-1.0&tabs=http#example

I've included a copy of the URL I'm using in Graph Explorer and pictures of the request, headers, body JSON, and an export of the request / response from Graph Explorer.

Any assistance is very much appreciated at this point as I can't seem to find anyone examples anywhere of a successful POST against this API.

Thanks in advance.

URL: https://graph.microsoft.com/v1.0/me/drive/root:/test/TC2.xlsx:/workbook/worksheets/{5A374F5A-FFF4-4602-96AB-67073C354218}/protection/unprotect

93936-newgraph.jpg

93916-body.jpg
{"log":{"version":"4.0","creator":{"name":"Graph Explorer","version":"4.0"},"entries":[{"startedDateTime":"2021-04-30T15:06:46.894Z","time":2153,"request":{"method":"POST","url":"https://graph.microsoft.com/v1.0/me/drive/root:/test/TC2.xlsx:/workbook/worksheets/{5A374F5A-FFF4-4602-96AB-67073C354218}/protection/unprotect","httpVersion":"HTTP/1.1","cookies":[],"headers":[{"name":"Athorization","value":"Bearer eyJ0eXAiOiJKV1QiLC................."},{"name":"accept","value":"application/json"},{"name":"Content-type","value":"application/json"}],"queryString":[{"name":"","value":""}],"postData":{"mimeType":"application/json","text":{"password":"XXXXXXXXX"}},"headersSize":-1,"bodySize":-1},

"response":{"status":400,"statusText":"Bad Request","httpVersion":"HTTP/1.1","cookies":[],"headers":{"cache-control":"no-cache","client-request-id":"cfe3aa70-d446-0877-82b6-4d46d6477f94","content-type":"application/json","request-id":"0c36de81-1bf5-4352-8107-701c0bd6e3f7"},"content":{"text":"{\"error\":{\"code\":\"InvalidArgument\",\"message\":\"The argument is invalid or missing or has an incorrect format.\",\"innerError\":{\"code\":\"invalidArgument\",\"message\":\"The argument is invalid or missing or has an incorrect format.\",\"date\":\"2021-04-30T15:06:49\",\"request-id\":\"0c36de81-1bf5-4352-8107-701c0bd6e3f7\",\"client-request-id\":\"cfe3aa70-d446-0877-82b6-4d46d6477f94\"}}}","size":366,"mimeType":"application/json"},"redirectURL":"","headersSize":-1,"bodySize":-1},"cache":{},"timings":{"send":0,"wait":0,"receive":0},"connection":""}]}}

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,375 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,282 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Saurabh Sharma 23,821 Reputation points Microsoft Employee
    2021-05-25T18:31:51.463+00:00

    Hi @Sean-2001 ,

    After further investigation it turns out to be a documentation issue as Excel Graph doesn't currently support the "password" parameter (as described by https://graph.microsoft.com/v1.0/$metadata), and unfortunately they don't yet have plan to release it. They are working internally to update the documentation on the same.

    Could you please us provide more information such as your scenario and the impact of the issue to his scenario, etc. so that I can take it forward with the products team.

    Thank you,
    Saurabh

    ----------

    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.