dongseok0
dongseok0

Reputation: 757

getRestApiId function in objects from office-js for OneNote

I'm developing add-in for OneNote and I've had trouble use OneNote REST APIs, as office-js doesn't give ID compatible with REST APIs. StackOverflow UserVoice
And as I know that the ID from office-js is not unique, I had to retrieve data from REST API using clientUrl to get the unique ID and it took around 5-6 secs per each call. It was our big issue and couldn't find any workaround for this.

But after a few months, I just found there is a function named getRestApiId in objects from office-js and surprisingly it works perfect in my tests. I'm not sure this is added recently and maybe not ready to use, or it was there. I can't find any information about this.
Could anyone confirm whether it's good to use or still under developing?
enter image description here

Upvotes: 2

Views: 72

Answers (1)

Jorge Aguirre
Jorge Aguirre

Reputation: 2857

EDIT: We now support "GetRestApi" and it have documented it

https://github.com/OfficeDev/office-js-docs/blob/master/reference/onenote/page.md#getRestApiId


OLD: You'll find that it doesn't work for all types of accounts (only Office365 accounts) - which is why this isn't publicly documented. We do plan to make it work for all types of accounts soon.

Upvotes: 1

Related Questions