Welcome to a short tutorial designed to get you connected to the Mendeley API for the first time. The tutorial is suitable for anyone new to the Mendeley API and should take around 45 minutes to complete. Some technical knowledge is required but you do not have to be a professional software developer. During this tutorial you will:
You will need a Mendeley user account to use the Mendeley API. If you do not have an account, follow the steps below to create a free account.
Your application must be registered for Mendeley API authorization to be granted. Application registration provides you with OAuth credentials required for user authorization. To register your application using the My Applications page in the Developer Portal:
See Application Registration for further information about application registration and guidance for each of the requested values.
Mendeley uses OAuth access tokens to provide authorization for API requests. A token is a long sequence of characters that contains security credentials. Each token has a limited lifetime and once expired, a replacement token must be generated. Normally tokens are generated using the Mendeley API OAuth authentication service but for this tutorial you will use the web browser to create a token.
If your access token expires, then click on the Obtain new token using the refresh token button in the Show Me Access Tokens web page to generate a replacement token. Access tokens currently have a lifetime of one hour but this may change.
With an access token, you can now use the API to fetch document metadata from the millions of documents available in the Mendeley catalog. In this tutorial, you will search for a document using the Digital Object Identifier (DOI). A DOI is an external unique reference that identifies a digital document regardless of publishing location.
You will use a utility called curl to send HTTP requests to the Mendeley API. curl is pre-installed on many operating systems and can be downloaded from curl.haxx.se/download.html. In further tutorials you will write programs to make API requests.
Now fetch metadata about the document "Laser cooling of atoms" using the DOI
10.1103/PhysRevA.20.1521. The command you will use to fetch the metadata is:
curl --request GET --header "Authorization: Bearer <TOKEN>" "https://api.mendeley.com/catalog?doi=10.1103/PhysRevA.20.1521"
curl --versionat the prompt and pressing return. If curl is installed correctly you will see version information displayed in the console.
<TOKEN>with the characters from your recently obtained access token.
Examine the JSON response data to identify useful attributes provided. The Mendeley API has included the title, authors, abstract and a web link among many other useful attributes.
If the response generates a token expiry error, simply create a new token and resend the request.
Now we will examine the curl command in more detail and see which parts affect the Mendeley API behavior. The command can be broken into separate components:
--header "Authorization: Bearer
The URL you used to request the catalog document has a particular structure and can also be examined as separate components:
Now that you understand how to search for and retrieve metadata from the Mendeley API, try changing the command to retrieve metadata about the document "Starch mobilization in leaves" with the DOI
Now that you have completed the tutorial you have learned how to:
Now that you have successfully made an API request to retrieve document metadata you may want to: