Logout in: 0 min and 0 sec

OneRoster Sample District

OneRoster is a district API. A unique Consumer Key and a Consumer Secret is issued for each vendor to have access to a specific district's data.

Use the OneRoster OAuth2 Host with the Consumer Key and Consumer Secret to retrieve an OAuth2 token.

Use the OAuth2 token when making calls to the OneRoster API Host for the OneRoster API.

DescriptionURL
OAuth2 Hosthttps://oneroster-oauth2.triand.com/oauth2/token
OneRoster Hosthttps://oneroster-api.triand.com

The Sample Distric is a medium sized school district with all the Personal Identifying Information (PII) masked.

To access the Sample District use the following credentials:

CredentialValue
Consumer KeyeiXL0llJYV0LALeUQIfHfvicRy
Consumer SecretmyoyVtA0ef0M0zslrLUalqtSChtalnpyaQyPgEiifXAWuDehGBtq

When requesting your OAuth2 token you are required to provide the scopes you would like to access. The scopes you provide determine the OneRoster API version you will use and the types and amounts of OneRoster data.

OneRoster ScopeVersionAllows
https://purl.imsglobal.org/spec/or/v1p1/scope/roster-core.readonlyv1.1Get object, or collection, calls
getSchool, getAllSchools
https://purl.imsglobal.org/spec/or/v1p1/scope/roster.readonlyv1.1Core above plus get collections for an object
getStudentsForSchool
https://purl.imsglobal.org/spec/or/v1p1/scope/roster-demographics.readonlyv1.1Get demographics
https://purl.imsglobal.org/spec/or/v1p2/scope/roster-core.readonlyv1.2Get object, or collection, calls
getSchool, getAllSchools
https://purl.imsglobal.org/spec/or/v1p2/scope/roster.readonlyv1.2Core above plus get collections for an object
getStudentsForSchool
https://purl.imsglobal.org/spec/or/v1p2/scope/roster-demographics.readonlyv1.2Get demographics
https://oneroster.triand.com/guardians.readonlybothInclude student guardians in user collection
https://oneroster.triand.com/guardians-metadata.readonlybothInclude additional guardian information with user object
https://oneroster.triand.com/students-metadata.readonlybothInclude additional student information with user object
https://oneroster.triand.com/demographic-metadata.readonlybothInclude additional demographic information with demographic model
https://oneroster.triand.com/orgs-metadata.readonlybothInclude additional org information with org model

To have full access to all OneRoster version 1.2 API calls, and full access to all available district data, the scope parameter would consisting of the following scopes concatenated and separated by spaces:

  • https://purl.imsglobal.org/spec/or/v1p2/scope/roster.readonly
  • https://purl.imsglobal.org/spec/or/v1p2/scope/roster-demographics.readonly
  • https://oneroster.triand.com/guardians.readonly
  • https://oneroster.triand.com/guardians-metadata.readonly
  • https://oneroster.triand.com/students-metadata.readonly
  • https://oneroster.triand.com/demographic-metadata.readonly
  • https://oneroster.triand.com/orgs-metadata.readonly

Example Usage

First get an OAuth2 access token

curl -X POST \
     -u eiXL0llJYV0LALeUQIfHfvicRy:myoyVtA0ef0M0zslrLUalqtSChtalnpyaQyPgEiifXAWuDehGBtq \
     -H 'Content-Type: application/x-www-form-urlencoded' \
     -d 'grant_type=client_credentials&scope=https://purl.imsglobal.org/spec/or/v1p2/scope/roster.readonly https://purl.imsglobal.org/spec/or/v1p2/scope/roster-demographics.readonly https://oneroster.triand.com/guardians.readonly https://oneroster.triand.com/guardians-metadata.readonly https://oneroster.triand.com/students-metadata.readonly https://oneroster.triand.com/demographic-metadata.readonly https://oneroster.triand.com/orgs-metadata.readonly' \
    'https://oneroster-oauth2.triand.com/oauth2/token'  
  
// Response: 
{ "access_token":"eyJ....really long string...ItCJA",
  "expires_in":3600,
  "token_type":"Bearer",
  "scope":"http://purl.imsglobal.org/spec/or/v1p2/scope/roster.readonly http://purl.imsglobal.org/spec/or/v1p2/scope/roster-demographics.readonly https://oneroster.triand.com/guardians.readonly https://oneroster.triand.com/guardians-metadata.readonly https://oneroster.triand.com/students-metadata.readonly https://oneroster.triand.com/demographic-metadata.readonly https://oneroster.triand.com/orgs-metadata.readonly"
}

Now, do a OneRoster request with the access_token from above

curl https://oneroster-api.triand.com/ims/oneroster/rostering/v1p2/users \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer {{token from above}}"

// Response: 
{"users": [
          { "username":"******",
            "orgs":[ {"type":"org",
                      "href":"https://oneroster-api.triand.com/ims/oneroster/rostering/v1p2/orgs/ar-9999703",
                      "sourcedId":"ar-9999703"
                      }
                    ],
            "enabledUser":"true",
            "givenName":"******",
            "familyName":"LastName_Z500537705",
            "middleName":"*****",
            "identifier":"Z500537705",
            "email":"**********",
            "agents":"",
            "grades":"09",
            "metadata": {   "addr1":"*********************",
                            "addr2":"",
                            "city":"*******",
                            "state":"AR",
                            "country":"***",
                            "zip":"*****",
                            "dob":"********",
                            "localid":"303015248"
                            },
            "sourcedId":"ar-9999000-z500537705",
            "status":"active",
            "dateLastModified":"2022-02-09T11:03:58.431Z",
            "roles":[ { "roleType":"primary",
                        "role":"student",
                        "org": {"type":"org",
                                "href":"https://oneroster-api.triand.com/ims/oneroster/rostering/v1p2/orgs/ar-9999703",
                                "sourcedId":"ar-9999703"
                                }
                      }
                    ]
          },
          // ...more users...
        ]
}