0

I'm trying to get sensitivityLabel list using graph API. I'm working on Graph Explorer to get proper REST url first.

https://learn.microsoft.com/en-us/graph/api/security-informationprotection-list-sensitivitylabels?view=graph-rest-beta&tabs=http

I look through this guid and tried several url but failed.

I got failed with these urls.

https://graph.microsoft.com/v1.0/security/informationProtection/sensitivityLabels
https://graph.microsoft.com/beta/users/me/security/informationProtection/sensitivityLabels

These are the error response

"error": {
    "code": "BadRequest",
    "message": "Resource not found for the segment 'informationProtection'.",
    "innerError": {
        "date": "2024-07-19T08:15:31",
        "request-id": "cb4a1134-b2af-4e74-9337-e65e142777c9",
        "client-request-id": "c7385ff6-bf4c-e989-3754-1b1a4e9bcba9"
    }
}
"error": {
    "code": "UnknownError",
    "message": "",
    "innerError": {
        "date": "2024-07-19T08:16:27",
        "request-id": "54ad97bd-8b45-44eb-a129-6a9a09e6eff7",
        "client-request-id": "7c3347bd-9dc6-ceca-9fd5-e12757890a3a"
    }
}

Please suggest.

3
  • Could you include more details like what error response you are getting when you ran above API calls? Commented Jul 19, 2024 at 8:03
  • I just included it! Commented Jul 19, 2024 at 8:17
  • Use beta endpoint, not v1.0. Maybe you will get another error :) Commented Jul 19, 2024 at 8:19

1 Answer 1

1

Initially, I too got errors when I ran those URLs in my environment like this:

GET https://graph.microsoft.com/v1.0/security/informationProtection/sensitivityLabels

enter image description here

GET https://graph.microsoft.com/beta/users/me/security/informationProtection/sensitivityLabels

enter image description here

To get sensitivityLabel list using graph API, the correct URLs should be

GET https://graph.microsoft.com/beta/me/security/informationProtection/sensitivityLabels

Response:

enter image description here

GET https://graph.microsoft.com/beta/users/userID/security/informationProtection/sensitivityLabels

Response:

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.