The Aeries API is a REST API. Current endpoints use primarily the HTTP GET verb. The POST, PUT, and DELETE verbs are supported for certain APIs, with more expected in the future.
Request Header
You will use the Request Header to tell the Aeries API what format you want the response (JSON or XML) and also what your certificate is. For the response format, include the following:
- XML
- Accept: text/xml, text/html, application/xhtml+xml, */*
- JSON
- Accept: application/json, text/html, application/xhtml+xml, */*
To give the system your certificate with each request:
- AERIES-CERT: 477abe9e7d27439681d62f4e0de1f5e1
The certificate is case sensitive!
Query String Filters
All API end points support a query string parameter named DatabaseYear to retrieve data from a specific school year’s database. The DatabaseYear parameter should be in the format of “YYYY”, using the year at the start of the school year (e.g., ?DatabaseYear=2020 for the 2020-2021 school year). If the DatabaseYear parameter is omitted, invalid, or does not match an available school year in the customer’s configuration, then the API will connect to the customer’s Default Year instead, which in most cases is the current school year.
Certain API end points, such as Student Information and Programs, support query string parameters to filter the records returned. These parameters are documented with each applicable end point.
Error Messages
As much as possible, human-readable errors will be returned by the endpoints described below. If the HTTP status code in the response indicates an error (code 400 or above), the response body should be parsed for the detailed error message.
Errors may occur for several reasons. Attempting to retrieve a single object that does not exist will result in a 404 Not Found error. A violation of other business rules or key constraints in a POST or PUT request will result in a 400 Bad Request error. For example, attempting to create a new staff job assignment with a non-existent Staff ID will generate an error.
Error Example (JSON):
{ "Message": "Invalid Staff ID" }
Sample Code
C# - This will return the list of schools using the V5 API:
using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace AeriesWebAPI_Test { public class School { public int SchoolCode { get; set; } public string Name { get; set; } public string InactiveStatusCode { get; set; } public string Address { get; set; } public string AddressCity { get; set; } public string AddressState { get; set; } public string AddressZipCode { get; set; } public string AddressZipExt { get; set; } public bool DoNotReport { get; set; } public string StateCountyID { get; set; } public string StateDistrictID { get; set; } public string StateSchoolID { get; set; } public int LowGradeLevel { get; set; } public int HighGradeLevel { get; set; } public Term[] Terms { get; set; } public string PrincipalName { get; set; } public string PrincipalEmailAddress { get; set; } public int AttendancePeriod { get; set; } public int Tracks { get; set; } public string ScheduleType { get; set; } public string SessionType { get; set; } public string AttendanceType { get; set; } public string AttendanceReporting { get; set; } public string ScheduleBasis { get; set; } } public class Term { public string TermCode { get; set; } public string TermDescription { get; set; } public DateTime StartDate { get; set; } public DateTime EndDate { get; set; } } public partial class Form1 : Form { private static HttpClient client = new HttpClient(); public Form1() { InitializeComponent(); } private void btnCallAeries_Click(object sender, EventArgs e) { ProcessNew(); } static void ProcessNew() { using (client) { try { client = new HttpClient(); client.BaseAddress = new Uri(@"https://demo.aeries.net/aeries"); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Add("AERIES-CERT", "477abe9e7d27439681d62f4e0de1f5e1"); var response = client.GetAsync("https://demo.aeries.net/aeries/api/v5/schools/").Result; string resultSchools = response.Content.ReadAsStringAsync().Result; School[] objSchools = JsonConvert.DeserializeObject<School[]>(resultSchools); foreach (var item in objSchools.ToList()) { MessageBox.Show(item.Name); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } } } }
Other Notes
Dates that contain NULL values will use the following format in XML:
<FieldName i:nil="true"/>
In previous versions of the API, this same information would have been output like:
<FieldName>0001-01-01T00:00:00</FieldName>