Reviewer.ly uses an HTTP service that accepts JSON objects as input and output. To document our APIs, we use Swagger, which can be accessed via this Swagger URL.
The Swagger documentation provides the following functionality:
- It organizes different API categories.
- For each service, it provides detailed descriptions, including input/output models and field-specific documentation for each model.
- It provides options for calling services directly from the browser.
Authentication methods
1. Basic authentication
- Learn more about basic authentication here.
- Use the format
accountName/username
for the username.
The following is an example cURL command for finding reviewers for the term “COVID-19” under the testAccount
with the username testUser
and password testPassword
:
curl -X POST "https://www.reviewer.ly/api/v1/experts/findReviewers" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-u testAccount/testUser:testPassword \
-d "{ \"pagination\": { \"itemsPerPage\": 50, \"page\": 1 }, \"queryFields\": { \"abstract\": \"covid-19\" } }"
2. Session-based authentication
In this type of authentication, if login is successful, authentication will return the session ID as a cookie. The following calls including this session ID cookie will be authenticated. The session will timeout after 60 minutes.
To use this type of authentication, you need to make an HTTP POST call to endpoint /api/v1/user/login
with the following JSON payload:
{
"account": "testAccount",
"username": "testUser",
"password": "testPassword"
}
This is equivalent to following curl call:
curl -X POST "https://www.reviewer.ly/api/v1/user/login" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"account\": \"testAccount\", \"username\": \"testPassword\", \"password\": \"testUser\"}"
If the login is successful, a cookie is set on the response in the following format:
JSESSIONID=786F927F55FA272033389EEDCA04222D;
This cookie should be sent as a part of each request to authenticate. The following is an example for the cURL command for finding reviewers using the session ID:
curl -X POST "https://www.reviewer.ly/api/v1/experts/findReviewers" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H 'Cookie: JSESSIONID=786F927F55FA272033389EEDCA04231D' \
-d "{ \"pagination\": { \"itemsPerPage\": 50, \"page\": 1 }, \"queryFields\": { \"abstract\": \"covid-19\" } }"