As of March 2016 this API is deprecated and Mendeley are no longer supporting it.
The Web Importer API provides callbacks to third-party websites to improve integration with the Mendeley Web Importer bookmarklet.
As a website developer, you can leverage the Mendeley Web Importer to allow users to easily save academic references and full text PDFs from your website straight into their Mendeley libraries. The users do not have to have Mendeley Web Importer bookmarklet installed in their browsers for this API to work.
- include
importer-api.js
at the bottom of your html before the closing body tag - on page load, call
MendeleyImporterApi.registerHostId()
,MendeleyImporterApi.registerDataCallback()
and, optionally,MendeleyImporterApi.registerUserIdentityCallback()
to register the callbacks - if implementing a button to trigger the import, rather than relying on the users using their installed [Mendeley Importer bookmarklet][], call
MendeleyImporterApi.open()
to programmatically invoke the Mendeley Web Importer
hostId
is expected to be a string, which identifies the host site
Please use Java package-like naming convention, e.g. com.your-site. Note that this is purely for the purpose of identification.
callback
is expected to be a function, which returns json data representing the identity of the current user on your site
Upon initialisation, the Mendeley Web Importer javascript will invoke the callback with a boolean argument to indicate the current context: true if the importer is invoked as a bookmarklet action, and false if the importer is explicitly invoked via the .open()
call.
callback
is expected to be a function, which returns json data representing the articles (metadata) on the current page on your site
Upon initialisation, the Mendeley Web Importer javascript will invoke the callback with a boolean argument to indicate the current context: true if the importer is invoked as a bookmarklet action, and false if the importer is explicitly invoked via the .open()
call.
This will load the Mendeley Web Importer javascript via script tag injection, and calls its initialisation function to display the importer UI.
If Mendeley Web Importer javascript is already loaded, it will simply call its initialisation function without loading it again.
This will simply remove the importer UI element from the current page. This will not error even if it is called when the UI is not currently displayed.