What does SPO required mean for Azure Graph API / OneDrive API access to read files (list and download)
Asked Answered
N

1

0

I had assumed that OneDrive offers a free personal storage tier, so that API accesss to OneDrive should not require that the user has an Office 365 subscription...

However, after hours of debugging, and just going straight to Postman, after trying to call: https://graph.microsoft.com/v1.0/me/drive/root/search(q='.obj')?select=name,id,@content.downloadUrl using the token, the error returned seems to be that the user does not have SPO, which seems to mean Office365 subscription is required?

{
  "error": {
    "code": "BadRequest",
    "message": "Tenant does not have a SPO license.",
    "innerError": {
      "request-id": "270808a8-4763-4ada-a878-e5ff34571c2f",
      "date": "2020-02-20T06:08:52"
    }
  }
}

Is there a way to access OneDrive by API without needing Office?

Update, just bought Office 365 ... this error still occurs... What does SPO license mean exactly?

Najera answered 20/2, 2020 at 6:21 Comment(3)
There already is a question regarding this topic: #46802555Silda
This doesn't have to do with that one, as in the other case, they used Excel (an Office 365) app. In this case I did not use any Office 365 app - just OneDrive.Najera
Errors doesn't say "user" doesn't have a license, it says your "tenant" doesn't have a license. That means you have not enabled the service in your tenant.Violence
L
0

What user context are you using to connect to the Microsoft Graph OneDrive API? Is that user licensed correctly in https://admin.microsoft.com/?

To eliminate issues with user access tokens, can you go to Graph Explorer https://aka.ms/ge and sign in on the left hand side with the user account. Then run this exact query. You will need to consent the correct permissions to call this API as per the API docs.

Because you are using SharePoint search capabilities here, this is not just OneDrive, this is SharePoint that will be required. I believe this comes with E3 and E5, but i'm not a licensing expert.

Can that user access the root SharePoint product within your tenant in a web browser?

Lifer answered 21/2, 2020 at 18:18 Comment(3)
Hi! I was able to get that to go through in graph explorer, but through API and postman was receiving the error above. I ended up resolving this by authenticating in through common instead of tenant. It led to receiving a token that doesn't work with jwt.ms ...Najera
Interesting. I'm glad you got this sorted.Lifer
@Najera - can you provide more details how did you solved this with authenticating in through common instead of tenant?Isidor

© 2022 - 2025 — McMap. All rights reserved.