SmarterApp Logo

NOTE: Development on a new site for SmarterApp content is underway! With the new site, we will begin transitioning SmarterApp resources into an easier-to-use, accessible interface.

Only SmarterApp content updated in 2020 and after should be considered current and accurate. If you plan to use, are looking for specific information, or have any questions about content on this site, please contact us at support@smarterbalanced.org.

API

Intended Audience: this document describes the programming interface for the ingest and reporting services of the Reporting Data Warehouse (RDW). Operations and system adminstration will find it useful for the configuration data loading end-points and the diagnostic and task service end-points. Third party providers of test results will find it useful for the data loading end-points.

This document describes the service end-points for the ingest and reporting services. *Note: there are many more end-points in the reporting services but most are intended to be consumed by the reporting UI, so are not documented here.

Quick Links:

  1. Authentication and Authorization
  2. Import Endpoints
  3. Exam Endpoints
  4. Groups Endpoints

Authentication and Authorization

The import service requires an OAuth2 access token for the data loading end-points. This is a password grant token requested from the OAuth2 server by a trusted client for a user of the system (the permissions are associated with the user). During the first couple years, the OAuth2 server was an OpenAM server. Recently it was migrated to an Okta server. There are instructions for both.

Fetch Password Grant Access Token - OpenAM

Accepts x-www-form-urlencoded data including client and user credentials and returns an access token.

curl -s -X POST --data "grant_type=password&username=user@example.com&password=password&client_id=client&client_secret=secret" https://openam/auth/oauth2/access_token?realm=/sbac

ACCESS_TOKEN=curl -s -X POST --data "grant_type=password&username=user@example.com&password=password&client_id=client&client_secret=secret" https://openam/auth/oauth2/access_token?realm=/sbac | jq -r '.access_token'

The resulting environment variable may be used in subsequent calls. Where the samples have {access_token} substitute ${ACCESS_TOKEN}.

Fetch Password Grant Access Token - Okta

Accepts x-www-form-urlencoded data including client and user credentials and returns an access token.

curl -s -X POST --data "grant_type=password&scope=openid profile&username=user@example.com&password=password&client_id=client&client_secret=secret" https://okta/oauth2/auslw2qcsmsUgzsqr0h7/v1/token

ACCESS_TOKEN=curl -s -X POST \ --data "grant_type=password&scope=openid profile&username=user@example.com&password=password&client_id=client&client_secret=secret" \ https://okta/oauth2/auslw2qcsmsUgzsqr0h7/v1/token | jq -r '.access_token'

The resulting environment variable may be used in subsequent calls. Where the samples have {access_token} substitute ${ACCESS_TOKEN}.

Test Access Token - OpenAM

Although not needed during normal operations, this call can be used to check an access token.

curl https://openam/auth/oauth2/tokeninfo?access_token=20b55fc2-1b84-4412-8149-88cfa622db01

Test Access Token - Okta

Although not needed during normal operations, this curl call can be used to check an access token:

curl -X POST --data 'client_id=<client-id>&client_secret=<client-secret>' 'https://smarterbalanced.oktapreview.com/oauth2/auslw2qcsmsUgzsqr0h7/v1/introspect?token=<full-text-of-access-token>&token_type_hint=access_token'

Import Endpoints

The import service provides the end-points for submitting data to the system. All end-points require a valid token, the examples use {access_token} as a placeholder. The token must provide appropriate permissions. For most content, this is the ASMTDATALOAD role at the client or state level but refer to individual content end-point documentation for specific permissions. There is one diagnostic end-point provided that helps debug permissions issues:

Get User

This end-point may be used to get the credentials of the current user. This is provided for diagnostic purposes.

curl --header "Authorization:Bearer {access_token}" https://import-service/imports/user

The import requests are processed and migrated to the reporting data mart. Import payloads are hashed and duplicate content is detected, returning any previous import request for the given content. Thus, for most content, submitting a payload a second time will safely no-op and return the current status of the previous import. The one exception to this rule is for Student Groups: because other factors such as permissions and organizations affect the processing of groups, duplicate import requests are reprocessed.

All data submissions result in an import being created. Thus a POST to /exams/imports will create an import resource which can be accessed at /imports/{id} (note that exams is not in the path). These are the end-points for querying imports.

Get Import Request

This end-point may be used to get the current status of an import request.

curl --header "Authorization:Bearer {access_token}" https://import-service/imports/19529

Get Import Payload

This end-point may be used to get the payload for an import request.

curl --header "Authorization:Bearer {access_token}" https://import-service/imports/19529/payload

Get Import Payload Properties

This end-point may be used to get the payload properties for an import request. This can be useful because not all the properties for an import are stored in the data warehouse, some are archived only with the payload.

curl --header "Authorization:Bearer {access_token}" https://import-service/imports/19529/payload/properties

Exam Endpoints

End-points for submitting exams aka test results.

These require the ASMTDATALOAD role.

Create Exam Import Request

Accepts payloads in Test Result Transmission (TRT) format, creating new exam import requests. Based on the data in the TRT this may result in an exam being created, updated or deleted. Exams are identified using the opportunity id and assessment id. If an incoming exam is not found in the system one will be added. If a matching exam already exists, it will be updated or, if the new status is reset, it will be deleted.

There are two ways of posting exam content: with a raw body of type application/xml or form-data (file upload).

curl -X POST --header "Authorization:Bearer {access_token}" --header "Content-Type:application/xml" --data-binary "<TDSReport><Test..." https://import-service/exams/imports?batch=WinterICA&filename=winterICA.1.xml

curl -X POST --header "Authorization:Bearer {access_token}" -F file=@winterICA.1.xml -F batch=WinterICA https://import-service/exams/imports

Groups Endpoints

End-point for submitting student group data in the Smarter Balanced Student Group CSV format.

These require the GROUP_ADMIN permission for the schools involved.

Create Groups Import Request

Accepts payloads in the Smarter Balanced Student Group CSV format. This end point can be used to import new groups or update existing ones.

There are two ways of posting content: with a raw body of type application/csv or form-data file upload in CSV format.

curl -X POST --header "Authorization:Bearer {access_token}" --header "Content-Type:application/csv" --data-binary "group_name,school_natural_id,..." https://import-service/groups/imports?filename=mygroups.csv

curl -X POST --header "Authorization:Bearer {access_token}" -F "file=@mygroups.csv;type=text/csv" https://import-service/groups/imports

Norms Endpoints

End-point for submitting norms percentile tables in the Smarter Balanced Norms CSV format. This end point can be used to import new norms or update existing ones. When norms are created, the following data elements are required and comprise the unique identifier for the norms percentile table:

When an existing norms percentile table matches the above three data elements on import it is updated.

These require the ASMTDATALOAD role.

Create Norms Import Request

Accepts payloads in the Smarter Balanced Norms CSV format.

There are two ways of posting content: with a raw body of type application/csv or form-data file upload in CSV format.

curl -X POST --header "Authorization:Bearer {access_token}" --header "Content-Type:application/csv" --data-binary "assessment_id,start_date,..." https://import-service/norms/imports?filename=2017-norms.csv

curl -X POST --header "Authorization:Bearer {access_token}" -F "file=@2017-norms.csv;type=text/csv" https://import-service/norms/imports

As of Fall 2018 the Smarter Balanced Test Delivery System (TDS) is no longer supported.

The code base and documentation for the TDS is available within the Smarter Balanced GitHub repository.

Creative Commons License Unless stated otherwise, all content on SmarterApp.org is licensed under a Creative Commons Attribution 4.0 International License.