问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/44753454/getrestapiid-function-in-objects-from-office-js-for-onenote