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?

ina
  • 19,167
  • 39
  • 122
  • 201
  • There already is a question regarding this topic: https://stackoverflow.com/questions/46802055/tenant-does-not-have-a-spo-license – Marc Feb 20 '20 at 08:21
  • 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. – ina Feb 20 '20 at 09:47
  • 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. – willman Feb 20 '20 at 20:25

1 Answers1

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?

Jeremy Thake MSFT
  • 2,058
  • 2
  • 13
  • 11
  • 1
    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 ... – ina Feb 21 '20 at 21:30
  • Interesting. I'm glad you got this sorted. – Jeremy Thake MSFT Feb 21 '20 at 23:54
  • @ina - can you provide more details how did you solved this with authenticating in through common instead of tenant? – Toniq Oct 31 '21 at 16:18