Installation | Swagger Documentation | Client Uploads | OData Support | Available Endpoints | Authentication | Additional Information
Installation
Using the Ares API requires Ares version 5.0.
Certain Microsoft .NET components must also be installed on the Ares Server to use the Ares API. These components are provided by Microsoft and will need to be installed separately as they are not included in the default Ares installation:
- Ares 5.0: The Ares API requires the Microsoft ASP.NET Core 8.0 Runtime Hosting Bundle (download from Microsoft's website). This installer is provided by Microsoft and must be run separately.
Note: The latest installer for the Ares Web API is installed along with the Ares 5.0 server installer. However, the .NET Core components are not part of the default Ares install and will still need to be installed separately.
Customization Key Configuration
When configuring the API, confirm that the following customization keys have correct values:
- APIUploadTempPath - The location on the server where temporary documents can be stored.
- AresCopyrightPhysicalDocPath - The location on the server where copyright documents are stored.
-
APIConfig Table - The Web API URL specified in the APIConfig table. The record in the APIConfig table is created automatically by the Ares Updater for new installs. https://servername/ares/webapi/ is the Web API URL used for standard Ares installations. This path may differ if your Web API is installed in a non-standard location. For example, if your Web API is installed in a 'nonshib' folder, your URL would be https://servername/nonshib/webapi/.
If you are unsure which path to use for your API URL, please contact Atlas Support at support@atlas-sys.com if Atlas-hosted or your local Ares server administrator if self-hosted.
The Ares Updater attempts to set reasonable values for these keys based on existing values; however, in some cases, this may not be possible resulting in an empty string value.
Swagger Documentation
The Ares API has developer-oriented documentation built-in. You can get to the API Swagger documentation at https://servername/ares/webapi/swagger/.
*Replace 'servername' with the IP address or DNS.
Client Uploads
To use the Ares API instead of FTP or FileShare for uploading and downloading files within the Ares Client, please see Uploading Electronic Files to the Web for configuration instructions.
OData Support
OData query options are available to help filter result data for Ares API endpoints that return a list of objects. OData is currently supported for the LoanPeriods, Semesters, Sites, and Users endpoints.
Filtering
The $filter option allows filtering results by applying a Boolean expression. The filter expressions include logical and arithmetic operators, and string functions.
When using these operators, strings should be single-quoted, while dates and numbers must not be quoted. Multiple conditions can be combined with 'and' or 'or' (see examples below).
Filter Operators
eq | Equal |
---|---|
ne | Not equal to |
gt | Greater than |
ge | Greater than or equal to |
lt | Less than |
le | Less than or equal to |
and | Logical and |
or | Logical or |
startswith(property, substring) | The property starts with the substring value |
endswith(property, substring) | The property ends with the substring value |
substringof(property, substring) | The property contains the substring value |
Examples
Return semesters starting between January 1st, 2020 and January 1st, 2022:
GET /<API URL>/Semesters?$filter=startDate gt 2020-01-01 and endDate lt 2022-01-01
Return loan periods for a given site (replace ALL in the example with the site code):
GET /<API URL>/LoanPeriods?$filter=site eq 'ALL'
Return sites that are valid pickup locations:
GET /<API URL>/Sites?$filter=availableForPickup eq true
Return users with email addresses ending in "gmail.com":
GET /<API URL>/Users?$filter=endswith(eMailAddress, '@gmail.com')
Available Endpoints
Failed API Call | Courses | Users | Loan Periods | Sites | Items | Shared Lists | Semesters | Token
The syntax for the Ares API is in the following format: https://{your-ares-api-url}/{endpoint}. Please replace '{your-ares-api-url}' with your Web API URL as described below and 'endpoint' with one of the following endpoints listed below. For example, https://atlas-sys.com/ares/webapi/loanperiods.
Ares Web API URL
For standard Ares installations, the default URL for the Ares Web API is https://servername/ares/webapi where servername is the IP address or DNS of your server. However, your path to the Web API may differ if using a non-standard installation path for the Ares API on your server.
Failed API Call
If any of the criteria are not met, the API will generate an HTTP status code error message. There are several possible error codes (e.g., 400 Bad Request, 401 Unauthorized, 404 Not Found, etc.) For example, when performing a Get Users/{username} call, if a user doesn't exist in Ares and there is not a UserValidation record for the user, the API will fail to locate the user and generate a 404 error.
Courses
The Courses endpoints can be used for retrieving information on course records.
Retrieves enrolled users for a given course | Retrieves course information | Retrieves items for a given course | Updates course information | Creates new courses
Retrieves enrolled users for a given course
GET | /Courses/{course id}/enrollment |
---|---|
API Call:
Response:
Example Response:
|
Retrieves course information
GET | /Courses/{course id} |
---|---|
API Call:
Response:
Example Response:
|
Retrieves items for a given course
GET | /Courses/{course id}/items |
---|---|
Used to retrieve a list of items associated with the specified course. API Call:
Available Query Parameters:
Response:
Example Response:
|
Updates course information
PATCH | /Courses/{course id} |
---|---|
Used to update information for a specific course record in Ares. API Call:
Note: The path property must specify an Ares course field name using camelcase, e.g. 'fieldName'
Example Call: The following example will update the enrollment number for a course to 60 students and also clear out any values from its CourseInfo1 field:
Additional Notes:
Response: The endpoint can return the following responses:
The 400 Bad Request code will be returned in the following circumstances:
|
Creates new courses
POST | /Courses |
---|---|
Used to create a new course record in Ares. API Call:
Example Call:
Additional Behavior:
Response:
The 400 Bad Request code will be returned in the following circumstances:
|
Users
The Users endpoints can be used for retrieving information on user records.
Retrieves user details for a given username | Retrieves user details for a given external user ID | Retrieves courses associated with a given username
Retrieves user details for a given username
GET | /Users/{username} |
---|---|
Retrieves user details for a given external user ID |
|
GET | /Users/ExternalUserId/{id} |
API Call:
The ApiConfig table contains a new column, ExternalUserIdMapping, that includes a list of all of the registered API users (identified by their unique API key guide). When a user makes a call through the Ares API with a given key, Ares will retrieve the matching record from ApiConfig file. The ApiConfig will define what field to match by checking the ExternalUserIdMapping in the Config file.
Response:
Retrieves courses associated with a given username |
|
GET
|
/Users/{username}/courses — or — /Users/{username}/courses?activeCourses=true |
API Call:
Response:
|
Loan Periods
The Loan Period endpoints can be used for retrieving information on loan periods.
Retrieves a list of configured loan periods | Retrieves loan period details
Retrieves a list of configured loan periods
GET | /loanperiods |
---|---|
Used to return a list of all configured loan periods.
Retrieves loan period details |
|
GET | /loanperiods/{loanperiodid} |
Used to return details on a specific loan period designated in the API call. |
Sites
The Site Code endpoints can be used for retrieving information on pickup and processing locations.
Retrieves a list of configured sites | Retrieves site details
Retrieves a list of configured sites
GET | /sites |
---|---|
Used to return a list of all configured sites.
Retrieves site details |
|
GET | /sites/{sitecode} |
Used to return details on a specific site designated in the API call. Details include:
|
Items
The Item endpoints can be used for creating, uploading, and routing new items.
Creates new items | Retrieves item information | Route items | Downloads item files | Deletes items | Small file uploads | Large file uploads | Creates session ID | Append to an upload session | Commits each part of the file to the session ID | Updates items | Retrieves item notes
Creates new items
POST | /Items |
---|---|
Used to create new item records in Ares.
API Call:
*If a valid CourseID is supplied, the endpoint will use the course information to locate and pre-populate other required fields (i.e., ActiveDate, InactiveDate, and ProcessingLocation) if values are not specified for these fields in the API call. For example, ActiveDate and InactiveDate will be set to the semester start and end date for the course if values for these fields are not specified in the call. Example Call:
Response:
|
Retrieves item information
GET | /Items/{item id} |
---|---|
Used to retrieve details for an item in Ares.
API Call:
Response:
Example Response:
|
Route items
POST | /Items/{id}/Route |
---|---|
Used to route items to new statuses.
API Call:
Response:
|
Downloads item files
GET
|
/items/{item id}/downloadfile?FileType={Item or PermissionsDocument} |
---|---|
Used to download files.
API Call:
Response:
|
Deletes items
DELETE | /items/{item id}/delete |
---|---|
Used to delete files.
API Call:
Response:
Small file uploads **Files smaller than 150MB** |
|
POST
|
/Items/{item id}/upload |
Used for uploading files.
This endpoint supports the upload of one (1) file attachment up to 150MB. Files and their associated items will be uploaded utilizing the same process as the Client:
The Internet Information Services (IIS) limits file uploads to 30MB by default - to permit uploads larger than this limit, your IT department will need to change the IIS configuration or use the large file upload request below.
Large file uploads **Files larger than 150MB**Files too large to upload in a single POST request can be uploaded in multiple parts using an upload session. This involves three endpoints: Create Upload Session, Append, and Commit. The max file permitted for uploads, in MB, is controlled by the value of the MaxUploadSize Customization Key. Default value: 150MB. |
Creates session ID
POST | /items/{item id}/sessionupload |
---|---|
Used to create an upload session. The first upload session will create a file and each subsequent upload will need to be done using the append endpoint to add additional data to the file. Part 1 of 3 calls required to upload large files.
API Call:
Response: The response may include one or more of the following:
|
Append to an upload session
PUT | /items/{upload session id}/append |
---|---|
Used to append. Part 2 of 3 calls required to upload large files.
API Call:
Response:
|
Commits each part of the file to the session ID
POST
|
/items/{upload session id}/commit |
---|---|
Used to commit the appended data to the upload session. Part 3 of 3 calls required to upload large files.
Response:
|
Updates items
PATCH | /Items/{item id} |
---|---|
Used to update information for a specific item record in Ares.
API Call:
Note: The path property must specify an Ares course field name using camelcase, e.g. 'fieldName'
Example Call: The following example will update an item's DOI field to 123, the ESPNumber field to 456, the ArticleTitle field to null, and the ItemInfo5 field to ItemInfo:
Additional Notes:
Response: The endpoint can return the following responses:
|
Retrieves item notes
GET
|
/items/{item id}/notes |
---|---|
Used to retrieve a list of notes for a specified item record.
API Call:
Response:
|
Shared Lists
The Shared Lists endpoints can be used for retrieving information and deleting course items in shared lists. These endpoints work similarly to the endpoints for Items, except they don't accept a FileType parameter because shared list items have only one file type (e.g., no permissions documents).
Retrieves shared list items | Downloads items from shared lists | Deletes items from shared lists
Retrieves shared list items
GET | /sharedlistitems/{item id} |
---|---|
Used to return shared list item records, in JSON format.
Downloads items from shared lists |
|
GET | /sharedlistitemsitems/{item id}/downloadfile |
Used to download the item file associated with this shared list item.
Deletes items from shared lists |
|
DELETE | /sharedlistitems/{item id}/deletefile |
Used to delete the item file that is associated with the shared list item.
|
Semesters
The Semesters endpoint can be used for retrieving information about semesters defined in Ares.
Retrieves semesters
GET | /semesters |
---|---|
Used to return semester records in JSON format with the following properties:
|
Token
Retrieve authentication token
Post | /api/Token |
---|---|
Retrieves an authentication token for the provided staff credentials.
|
Authentication
Most of the actions will require authentication. There are 2 ways to authenticate in the Ares API: Ares API Key or staff tokens.
API Key
You can create an API key in the Ares Customization Manager's APIConfig table, if necessary. A default record in the APIConfig table is created automatically by the Ares Updater for new installs (see Installation section above).
Testing the Authentication
To test in the swagger interface, you can click on Authorize in the top right corner of the swagger interface. A pop-up like an image shown below will appear.
- The first option (Name: X-ARES-API-KEY) is for the API Key; Just paste the API key directly into the value and click authorize and you should be good.
- For the staff token authentication, note that it currently has a 5-minute timeout. You would need to POST to the Token operation to get a JWTvalue. In the swagger interface, you would enter BEARER <JWT value from Token response>
Additional Information
If there is specific functionality that you are looking to use to integrate with your services, we encourage you to submit enhancements & ideas to UserVoice at https://uservoice.atlas-sys.com/. Thanks!