I hope you won't mind my posting a question, because I'm not a programmer and need a "for dummies" explanation. Although I can use basic JavaScript, I've never used an API.
This is what I want to do:
I've made an HTML page on my hard-drive (which I ultimately want to package with something like PhoneGap into a mobile app so I can share with my colleagues).
Part of my page, I want to be populated with the contents of a folder of annotated citations that I have in the web-based Mendeley reference manager application.
At present, I'm populating my page with a JSON file (which I exported from Mendeley and re-formatted - just to get my citation formatting code right - that part is fine, it looks great).
But I'd like my page to populate not with a previously exported file, but with the up-to-date contents of my Mendeley folder automatically downloaded into my page when my app is opened.
I've laboured over the Mendeley api "documentation", checked out books, YouTube tutorials, searched the web - all the examples of using an api to download data that I can find, don't help me figure out how to use the Mendeley api. I can't even understand from the 'examples' in the Mendeley SDK!
This is all I've been able to understand (or perhaps mis-understand!) so far:
- Register with Mendeley and get a 'client-id' and a 'secret': I've done that
- Decide what kind of authentication flow I want: this will be 'implicit flow' since I need to access Mendeley directly from the browser. I understand 'implicit flow' doesn't need the 'secret', just the 'client-id'.
- Use the Mendeley JavaScript SDK: I'm using the 'standalone' version - I'm referencing it with a script tag in my page, as described in the Readme SDK file. I've also copied and pasted a required snippet of code for implicit flow into a file named 'oauth-config.js', as described in the SDK examples file: oauth-config.implicit-grant.js.dist
But now what?
- How exactly do I use the SDK to get my data? I can find no directions.
- Assuming I can get my data from Mendeley, how does my script which processes the JSON for display in my page access the response data?