0

Months ago I integrated Office365 sign on on my website. (I used office365 account to sign in to my website).

Now I want to include Onenote API feature like create page, create section etc.

I research that is possible with office365 login you have access to the Onenote API.

First of all I modified the app which we use before on azure (include onenote in app).

Login with office365 works fine, but when I try to communicate with onenote I always get unauthorized code (401).

I used this library https://github.com/ankitsam/office365-api-php-client/blob/master/src/Office365_Client.php for office365 client. And when I try to access
the scope is:

stdClass Object
(
    [token_type] => Bearer
    [expires_in] => 3599
    [scope] => Contacts.Read Mail.Read User.Read User.Read.All
    [expires_on] => 1444251788
    [not_before] => 1444247888
    [resource] => https://graph.microsoft.com/
    [access_token] => access_token here
    [refresh_token] => refresh_token here
    [id_token] => id_token here
)

I don't see on scope Onenote scope (I include on azure app).

Thanks

Nerxhan
  • 311
  • 2
  • 10
  • You might find it more useful to reach out the library's author for help. Such as opening an issue on their github repo – xiamx Oct 07 '15 at 21:37

2 Answers2

2

The problem was at [resource] url. To communicate with onenote we need to use [resource] => https://onenote.com/

Thanks

Nerxhan
  • 311
  • 2
  • 10
0

Try to use Microsoft OneNote API for php in github. it is up to date to the recent changes in o365 api.

https://github.com/OneNoteDev/OneNoteAPISamplePHP

Also, you can test out your code using this console: https://apigee.com/onenote/embed/console/onenote/?apig_cc=1

Here is a tutorial on how to use this console:

https://msdn.microsoft.com/en-us/library/office/dn575419.aspx

Hope this helps.

Mostafa
  • 3,296
  • 2
  • 26
  • 43