The ClassLink Developer Center

Welcome to the ClassLink developer center! Our platform consists of a set of open APIs to bring ClassLink's identity and data to your application. Jump right in and get started!

Get Started

What is OneRoster?

 

ClassLink Roster Server builds upon the OneRoster specification from IMS Global. ClassLink can provide vendors access to rosters via a REST API or CSV files for any district that uses the ClassLink Roster Server. We do not charge any fees to access the OneRoster data. Yes, it's really free and the school district has full control over the data.

The OneRoster™ standard is a subset of the Learning Information Services standard that focuses on the school’s needs to exchange roster information and grades. The standard includes both SOAP and REST-based bindings to make it quicker and easier to implement the exchange of information about people, membership, courses and outcomes. In addition to the standard, OneRoster™ includes a format for CSV files that are typically exchanged between the school and the vendor to populate the roster information needed to gain access to learning tools, portals and learning environments.

To view more information on the OneRoster specification, go to the IMS Global website.
http://www.oneroster.org

Getting Started with OneRoster

 

OneRoster SandBox

After you create your OneRoster application, click "Request Sandbox Access" in the OneRoster section of the Dev Console to receive credentials for our developer Sandbox.

Before you can access data from a ClassLink Roster Server enabled district, you must create a OneRoster application. This gives districts the ability to quickly identify and provision access to your application. If you have multiple applications with different roster requirements, you may want to create an application for different rosters you need access to.

Districts will have the option to give you programmatic access to the class rosters via the REST API or upload OneRoster CSV files to you.

Create the application from Manage Applications in the developer console.

Branding

Make sure to upload a logo for your applications. Districts will see your logo when they provision access to your application.

/applications

 

Header Auth

 Authentication is required for this endpoint.
gethttps://api.oneroster.com/applications
curl --request GET \
  --url https://api.oneroster.com/applications
var request = require("request");

var options = { method: 'GET', url: 'https://api.oneroster.com/applications' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.oneroster.com/applications")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.oneroster.com/applications");

xhr.send(data);
import requests

url = "https://api.oneroster.com/applications"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
"status": 1
"applications": 
{
"id": 1176
"tenant_name": "ClassLink Demo"
"tenant_id": 2
"application_id": 57
"bearer": null
"name": "ClassLink"
"oneroster_application_id": "MoYPlyQWmG0%3D"
}
}
 

Obtaining a List of Applications

 

Authorization Header

Use the API Key found in the OneRoster module.

There are 2 endpoints you can access with a developer API Key found under the OneRoster module. A list of the districts that have given you access to their OneRoster server and the server details for connecting to that server.

Get Applications

Let's fetch a list of applications with your access token!

Simply do a GET request with Authorization : Bearer {access_token} as a header to https://api.oneroster.com/applications

This will return a list of districts that have provisioned details for your application if you intend to use the OneRoster proxy.

{
"status": 1
"applications":
{
"id": 1176
"tenant_name": "ClassLink Demo"
"tenant_id": 2
"application_id": 57
"bearer": null
"name": "ClassLink"
"oneroster_application_id": "MoYPlyQWmG0%3D"
}
}

Get Advanced Server Details

Now that you have a list of applications per district, use their oneroster_application_id to fetch the connection details for that server to connect directly to the districts OneRoster server instead of using the ClassLink OneRoster proxy.

Simply do a GET request with Authorization : Bearer {access_token} as a header to https://api.oneroster.com/applications/{oneroster_application_id}/server

{
  "status": 1,
  "server": {
    "client_id": "b008b35ac38bccb56a910e2323f66049",
    "client_secret": "",
    "endpoint_url": "https://server.example.com"
  },
  "message": ""
}

/applications/{oneroster_application_id}/server

 

Header Auth

 Authentication is required for this endpoint.
gethttps://api.oneroster.com/applications/oneroster_application_id/server
curl --request GET \
  --url https://api.oneroster.com/applications/oneroster_application_id/server
var request = require("request");

var options = { method: 'GET',
  url:
   'https://api.oneroster.com/applications/oneroster_application_id/server' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.oneroster.com/applications/oneroster_application_id/server")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.oneroster.com/applications/oneroster_application_id/server");

xhr.send(data);
import requests

url = "https://api.oneroster.com/applications/oneroster_application_id/server"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "status": 1,
  "server": {
    "client_id": "b008b35ac38bccb56a910e2323f66049",
    "client_secret": "",
    "endpoint_url": "https://server.example.com"
  },
  "message": ""
}

Path Params

oneroster_application_id
string
required
 

L

Accessing Data

 

Developers have 2 ways of accessing data from a OneRoster server. OneRoster is hosted by each school district and you can connect to the server directly using OAuth1 or using the ClassLink OAuth2 Proxy.

IMS OneRoster v1.1 Specification uses OAuth1

If you want to be 100% compliant to the IMS spec, you must use OAuth1.

Accessing OneRoster using OAuth1 (Direct)

After a district has granted you access to their OneRoster server, you can connect to it directly using OAuth1 signatures. Open the ClassLink developer console and go to the OneRoster module. Click on the key next to your school to see the direct access credentials.

This will give you the server url, client secret and id.

Twitter has great documentation on generating OAuth1 signatures. We highly recommend you use a library for generating sigatures. They must be sent in each REST API request as an Authorization Header.

https://dev.twitter.com/oauth/overview/creating-signatures

Each OneRoster server will have a documentation page where you can test your API KEY and secret.

Accessing OneRoster using OAuth2 (ClassLink Proxy)

The second method for accessing OneRoster data is through the ClassLink OneRoster proxy. The ClassLink OneRoster proxy will automatically direct requests to the proper OneRoster server and sign the request using OAuth1 signatures.

After a district has granted you access to their OneRoster data, all you have do to is make your request to a valid OneRoster endpoint.

(e.g. https://api.oneroster.com/{YOURAPPID}/ims/oneroster/v1p1/schools)

You can get your application id from the developer console under OneRoster. This has an access token which is used in the API request as a bearer token.

Accessing Schools Using OneRoster Proxy

Here is an example where you use your application id for the district and you will call the endpoint as you normally would.

Use the access_token found in the Developer Console as the Bearer token.

DO NOT SHARE YOUR TOKEN

Your access token does not expire so keep it safe! If you ever need to refresh your token, you can refresh it from the console.

/v2/my/info

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://nodeapi.classlink.com/v2/my/info
curl --request GET \
  --url https://nodeapi.classlink.com/v2/my/info
var request = require("request");

var options = { method: 'GET',
  url: 'https://nodeapi.classlink.com/v2/my/info' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://nodeapi.classlink.com/v2/my/info")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://nodeapi.classlink.com/v2/my/info");

xhr.send(data);
import requests

url = "https://nodeapi.classlink.com/v2/my/info"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results

Headers

Authorization
string

Bearer Token

 

Sample Result

{
UserId: 1516492
TenantId: 2
BuildingId: 1
AuthenticationType: 2
DisplayName: "Reading Student"
FirstName: "Reading"
LastName: "Student"
Email: "480150801709112015161127962@demo.local"
LoginId: "4801508017"
ImagePath: ""
LanguageId: 1
DefaultTimeFormat: 0
Profile: "Developer Student Profile"
ProfileId: 3280
Tenant: "ClassLink Demo"
Building: "CL Demo Building1"
Role: "Student"
LastAccessTime: "2015-11-12T19:25:32.000Z"
SourcedId: "4801508017"
}
Name
Description

UserId

Unique ID assigned to the user within ClassLink

TenantId

ID assigned to the school district. Ensure you are working with users in the proper Tenant ID.

LoginId

AD username if it exists. Most school districts use Active Directory and this will be populated with their AD username.

Tenant

Name of the school district the user is from.

Building

Name of the domain. Most districts usually just have one building/domain configured.

Role

available roles are Student, Teacher, Tenant Administrator

SourcedId

If the district has OneRoster enabled, this will have the sourcedId of the user from OneRoster.

/v2/my/profiles

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://nodeapi.classlink.com/v2/my/profiles
curl --request GET \
  --url https://nodeapi.classlink.com/v2/my/profiles
var request = require("request");

var options = { method: 'GET',
  url: 'https://nodeapi.classlink.com/v2/my/profiles' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://nodeapi.classlink.com/v2/my/profiles")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://nodeapi.classlink.com/v2/my/profiles");

xhr.send(data);
import requests

url = "https://nodeapi.classlink.com/v2/my/profiles"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results

Headers

Authorization
string

Bearer Token

 

Sample Result

{
Priority: 3280
ProfileId: 3280
ProfileName: "Developer Student Profile"
RoleId: 3
RoleName: "Student"
GroupId: 13596
GroupName: "Developer Student"
Level: 4
IsCurrentProfile: 1
}
Name
Description

ProfileId

ID assigned to the profile

/v2/my/district

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://nodeapi.classlink.com/v2/my/district
curl --request GET \
  --url https://nodeapi.classlink.com/v2/my/district
var request = require("request");

var options = { method: 'GET',
  url: 'https://nodeapi.classlink.com/v2/my/district' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://nodeapi.classlink.com/v2/my/district")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://nodeapi.classlink.com/v2/my/district");

xhr.send(data);
import requests

url = "https://nodeapi.classlink.com/v2/my/district"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results

Headers

Authorization
string

Bearer Token

 

Sample Result

{
  "tenantId":466,
  "name":"Orange County Public Schools",
 "stateId":12,"state":"Florida",
  "ncesId":"1201440",
  "ncesName":"Orange"
}

/v2/oneroster/my/info

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://nodeapi.classlink.com/v2/oneroster/my/info
curl --request GET \
  --url https://nodeapi.classlink.com/v2/oneroster/my/info
var request = require("request");

var options = { method: 'GET',
  url: 'https://nodeapi.classlink.com/v2/oneroster/my/info' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://nodeapi.classlink.com/v2/oneroster/my/info")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://nodeapi.classlink.com/v2/oneroster/my/info");

xhr.send(data);
import requests

url = "https://nodeapi.classlink.com/v2/oneroster/my/info"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results

Headers

Authorization
string
 

Alert

The OneRoster endpoints are only available for districts with OneRoster enabled.

OneRoster Endpoints

All OneRoster endpoints conform to the IMS Global specification, which can be found here http://www.imsglobal.org/lis/imsonerosterv1p0/imsOneRoster-v1p0.html

Sample Result

{
status: 1
User: {
sourcedId: "4801508017"
status: "active"
dateLastModified: "2015-10-27T05:46:08.647Z"
username: "4801508017"
userId: ""
givenName: "b3e36c548cb8ee25971ae534ed15a6"
familyName: "e95f770ac4fb91ac2e4873e4b2dfc0"
role: "student"
identifier: ""
email: ""
sms: ""
phone: ""
demographics: {
href: "http://betaapi.oneroster.com/learningdata/v1/demographics/4801508017"
sourcedId: "4801508017"
type: "demographics"
}-
metadata: {
grade: "10"
}-
orgs: [1]
0:  {
href: "http://betaapi.oneroster.com/learningdata/v1/orgs/671"
sourcedId: "671"
type: "org"
}

/v2/oneroster/my/classes

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://nodeapi.classlink.com/v2/oneroster/my/classes
curl --request GET \
  --url https://nodeapi.classlink.com/v2/oneroster/my/classes
var request = require("request");

var options = { method: 'GET',
  url: 'https://nodeapi.classlink.com/v2/oneroster/my/classes' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://nodeapi.classlink.com/v2/oneroster/my/classes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://nodeapi.classlink.com/v2/oneroster/my/classes");

xhr.send(data);
import requests

url = "https://nodeapi.classlink.com/v2/oneroster/my/classes"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results
 

OneRoster Endpoints

All OneRoster endpoints conform to the IMS Global specification, which can be found here http://www.imsglobal.org/lis/imsonerosterv1p0/imsOneRoster-v1p0.html

Sample Result

{
status: 1
classes: [7]
0:  {
sourcedId: "671-8212110-1-102127-FY"
status: "active"
dateLastModified: "2015-10-12T10:09:34.469Z"
title: "ADMIMISTRATIVE OFFICE TECHNOLOGY 1/LEVEL 2"
classCode: "ADM OFF TECH 1-PERIOD 2"
classType: "scheduled"
location: ""
grade: ""
subjects: ""
course: {
href: "http://betaapi.oneroster.com/learningdata/v1/courses/8212110"
sourcedId: "8212110"
type: "course"
}-
school: {
href: "http://betaapi.oneroster.com/learningdata/v1/orgs/671"
sourcedId: "671"
type: "org"
}-
terms: [1]
0:  {
href: "http://betaapi.oneroster.com/learningdata/v1/academicSessions/FY"
sourcedId: "FY"
type: "academicSession"
}-
-
userSourcedId: "4801508017"
teachers: "7f15f1ad99c489dc0314952535e424 56c052be7cc218dbc1a4092a9db64c"
}

/v2/oneroster/my/classes/:class_id/teachers

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://nodeapi.classlink.com/v2/oneroster/my/classes/class_id/teachers
curl --request GET \
  --url https://nodeapi.classlink.com/v2/oneroster/my/classes/class_id/teachers
var request = require("request");

var options = { method: 'GET',
  url:
   'https://nodeapi.classlink.com/v2/oneroster/my/classes/class_id/teachers' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://nodeapi.classlink.com/v2/oneroster/my/classes/class_id/teachers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://nodeapi.classlink.com/v2/oneroster/my/classes/class_id/teachers");

xhr.send(data);
import requests

url = "https://nodeapi.classlink.com/v2/oneroster/my/classes/class_id/teachers"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results

Path Params

class_id
string
required

ID of the class

Headers

Authorization
string
 

OneRoster Endpoints

All OneRoster endpoints conform to the IMS Global specification, which can be found here http://www.imsglobal.org/lis/imsonerosterv1p0/imsOneRoster-v1p0.html

/v2/oneroster/my/classes/:class_id/students

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://nodeapi.classlink.com/v2/oneroster/my/classes/class_id/students
curl --request GET \
  --url https://nodeapi.classlink.com/v2/oneroster/my/classes/class_id/students
var request = require("request");

var options = { method: 'GET',
  url:
   'https://nodeapi.classlink.com/v2/oneroster/my/classes/class_id/students' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://nodeapi.classlink.com/v2/oneroster/my/classes/class_id/students")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://nodeapi.classlink.com/v2/oneroster/my/classes/class_id/students");

xhr.send(data);
import requests

url = "https://nodeapi.classlink.com/v2/oneroster/my/classes/class_id/students"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results

Path Params

class_id
string
required

ID of the class

 

OneRoster Endoints

All OneRoster endpoints conform to the IMS Global specification, which can be found here http://www.imsglobal.org/lis/imsonerosterv1p0/imsOneRoster-v1p0.html

/v2/my/students

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://nodeapi.classlink.com/v2/my/students
curl --request GET \
  --url https://nodeapi.classlink.com/v2/my/students
var request = require("request");

var options = { method: 'GET',
  url: 'https://nodeapi.classlink.com/v2/my/students' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://nodeapi.classlink.com/v2/my/students")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://nodeapi.classlink.com/v2/my/students");

xhr.send(data);
import requests

url = "https://nodeapi.classlink.com/v2/my/students"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results
 

Shows Linked Students

If a parent registers for ClassLink, this endpoint will display a list of any linked student accounts.

Sample Result

 
{
   "status":1,
   "response":[
      {
         "UserId":1797039,
         "DisplayName":"_Dev Template",
         "FirstName":"_Dev",
         "LastName":"Template",
         "Email":"devtemplate14042016190420601@Demo.local",
         "UserName":"devtemplate",
         "ParentRedeemCode":"DEM-9b9485e5-3d42-4be2-b7a7-b744",
         "IsDefault":1
      },
      {
         "UserId":1505509,
         "DisplayName":"1234567890123456789012345",
         "FirstName":"1234567890123456789012345",
         "LastName":"",
         "Email":"123456789012345678901234527102015061058353@Demo.local",
         "UserName":"1234567890123456789012345",
         "ParentRedeemCode":"DEM-28988cab1f13-b744-b7a7-b744-053655459845",
         "IsDefault":0
      }
   ]
}

/my/groups

 

OAuth2 Auth

Bearer
 Authentication is required for this endpoint.
gethttps://nodeapi.classlink.com/my/groups
curl --request GET \
  --url https://nodeapi.classlink.com/my/groups
var request = require("request");

var options = { method: 'GET',
  url: 'https://nodeapi.classlink.com/my/groups' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://nodeapi.classlink.com/my/groups")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://nodeapi.classlink.com/my/groups");

xhr.send(data);
import requests

url = "https://nodeapi.classlink.com/my/groups"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

Your OAuth2 token is incorrect or has expired

Try the API to see results
 

Sample Result

[
    {
        "name": "DemoStudents",
        "groupid": 9269,
        "buildingid": 1
    },
    {
        "name": "StudentA",
        "groupid": 12586,
        "buildingid": 1
    },
    {
        "name": "DemoTeachers",
        "groupid": 9268,
        "buildingid": 1
    }
]
Name
Description

Name

Name of the group

GroupId

Globally unique ID of the group

BuildingId

Globally unique ID of the building to which the group belongs

/v3/apps

Get the list of apps for the tenant.

 
gethttps://analyticsapi.classlink.io/v3/apps
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/apps
var request = require("request");

var options = { method: 'GET',
  url: 'https://analyticsapi.classlink.io/v3/apps' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/apps")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/apps");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/apps"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
    "AppId": 33192,
    "Count": "1",
    "IconPath": "//dp3vjvsy1r9i0.cloudfront.net/resources/icons/default/webpage-option4.png",
    "HireIconPath": "//dp3vjvsy1r9i0.cloudfront.net/resources/icons/hires/webpage-option4@2x.png",
    "AppName": "AR"
  },
  {
    "AppId": 1985,
    "Count": "1",
    "IconPath": "//dp3vjvsy1r9i0.cloudfront.net/resources/icons/default/generic_art.png",
    "HireIconPath": "//dp3vjvsy1r9i0.cloudfront.net/resources/icons/hires/generic_art@2x.png",
    "AppName": "Jackson Pollack"
  }

Query Params

startDate
date

Start Date for the range. Will default to the start of the current month.

endDate
date

End Date for the range. Will default to the end of the current month.

order
string

The result column by which the response is sorted. Can be AppId, Count, or AppName.

sort
string

Sorts the response in ascending order (ASC) or descending order (DESC).

limit
int32

How many results are sent. If left blank will send all results.

offset
int32

How many results are skipped before output is shown. Used for easy pagination, Default 0.

filter
string

A text match filter for the school's name, tenant id, or state.

groupId
array of integers

The group or list of groups to get app usage for.

orgSourcedId
array of strings

The org or list of orgs to get app usage for.

createCSV
boolean

To return a CSV or not to return a CSV, that is the question.

Headers

Authorization
string

Bearer Token.

 
Name
Description

AppId

Unique ID of each applicationin ClassLink's servers.

Count

Counts the number of times the application is in our system.

IconPath

The path on the ClassLink server to the image icon for the app's logo.

HireIconPath

A higher res version of the image at IconPath.

AppName

The name of the application.

/v3/apps/:appId/unique

Get unique app launches for the given app.

 
gethttps://analyticsapi.classlink.io/v3/apps/appId/unique
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/apps/appId/unique
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/apps/appId/unique' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/apps/appId/unique")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/apps/appId/unique");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/apps/appId/unique"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "month": "2017-12-01",
    "AppId": 31,
    "RoleLevel": 3,
    "Launches": "2",
    "dLaunches": "1"
  },
  {
    "month": "2017-07-01",
    "AppId": 31,
    "RoleLevel": 3,
    "Launches": "1",
    "dLaunches": "1"
  }
]

Path Params

appId
int32
required

The unique integer application ID of the tenant's app.

Query Params

startDate
date

Start Date for the range. Will default to the start of the current month.

endDate
date

End Date for the range. Will default to the end of the current month.

order
string

The result column by which the response is sorted

sort
string

Sorts the response in ascending order (ASC) or descending order (DESC).

Headers

Authorization
string

Bearer Token.

 
Name
Description

month

The month in which the launches took place.

AppId

The unique integer application ID of the tenant's app.

RoleLevel

The role level of the users that launched the application. Determines whether the user is an admin teacher, or student.

Launches

The number of times that the application was launched in "month".

dLaunches

The number of distinct users that launched the application in "month".

/v3/apps/:appId/usage

Get daily app usage by roll level.

 
gethttps://analyticsapi.classlink.io/v3/apps/appId/usage
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/apps/appId/usage
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/apps/appId/usage' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/apps/appId/usage")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/apps/appId/usage");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/apps/appId/usage"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "AppId": 31,
    "RoleLevel": 1,
    "Count": "5"
  }
]

Path Params

appId
string
required

The unique integer application ID of the tenant's app.

Query Params

startDate
date

Start Date for the range. Will default to the start of the current month.

endDate
date

End Date for the range. Will default to the end of the current month.

order
string

The result column by which the response is sorted

sort
string

Sorts the response in ascending order (ASC) or descending order (DESC).

limit
int32

How many results are sent. If left blank will send all results.

offset
int32

How many results are skipped before output is shown.

createCSV
boolean

To return a CSV or not to return a CSV, that is the question.

Headers

Authorization
string

Bearer Token.

 
Name
Description

AppId

The unique integer application ID of the tenant's app.

RoleLevel

The role level of the users that launched the application. Determines whether the user is an admin teacher, or student.

Count

The number of times the app was used by the tenant in the date range

/v3/apps/:appId/usage/daily

Get total app usage by day.

 
gethttps://analyticsapi.classlink.io/v3/apps/appId/usage/daily
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/apps/appId/usage/daily
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/apps/appId/usage/daily' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/apps/appId/usage/daily")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/apps/appId/usage/daily");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/apps/appId/usage/daily"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "AppId": 31,
    "Date": "2018-01-16",
    "Launches": 1
  },
  {
    "AppId": 31,
    "Date": "2018-02-01",
    "Launches": 1
  },
  {
    "AppId": 31,
    "Date": "2018-03-01",
    "Launches": 3
  }
]

Path Params

appId
int32
required

The unique integer application ID of the tenant's app.

Query Params

startDate
date

Start Date for the range. Will default to the start of the current month.

endDate
date

End Date for the range. Will default to the end of the current month.

Headers

Authorization
string

Bearer Token.

 
Name
Description

AppId

The unique integer application ID of the tenant's app.

Date

The day that the application was launched.

Launches

How many times the application was launched on "Date".

/v3/apps/:appId/users

Get the list of recent users for an app.

 
gethttps://analyticsapi.classlink.io/v3/apps/appId/users
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/apps/appId/users
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/apps/appId/users' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/apps/appId/users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/apps/appId/users");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/apps/appId/users"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "Date": 1519887149000,
    "UserId": 135574,
    "LoginId": "qaadmin",
    "DisplayName": "QA Admin"
  },
  {
    "Date": 1519878815000,
    "UserId": 135574,
    "LoginId": "qaadmin",
    "DisplayName": "QA Admin"
  },
  {
    "Date": 1519878369000,
    "UserId": 135574,
    "LoginId": "qaadmin",
    "DisplayName": "QA Admin"
  }
]

Path Params

appId
int32
required

The unique integer application ID of the tenant's app.

Query Params

startDate
date

Start Date for the range. Will default to the start of the current month.

endDate
date

End Date for the range. Will default to the end of the current month.

order
string

The result column by which the response is sorted

sort
string

Sorts the response in ascending order (ASC) or descending order (DESC).

Headers

Authorization
string

Bearer Token.

 
Name
Description

Date

The date and time where the user logged in.

UserId

The unique integer ID of the user.

LoginId

The username of the person that logged in.

DisplayName

The proper name of the person that logged in.

/v3/groups

Get the list of the tenants groups.

 
gethttps://analyticsapi.classlink.io/v3/groups
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/groups
var request = require("request");

var options = { method: 'GET',
  url: 'https://analyticsapi.classlink.io/v3/groups' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/groups")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/groups");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/groups"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "data": [
    {
      "GroupId": 112150,
      "Name": "Group49"
    },
    {
      "GroupId": 105830,
      "Name": "~TildeParent"
    },
    {
      "GroupId": 105831,
      "Name": "~TildeNested1"
    }
  ]
}

Query Params

order
string

The result column by which the response is sorted

sort
string

Sorts the response in ascending order (ASC) or descending order (DESC).

createCSV
boolean

To return a CSV or not to return a CSV, that is the question.

Headers

Authorization
string

Bearer Token.

 
Name
Description

GroupId

The unique integer ID the group.

Name

The name of the group

/v3/groups/:groupId

Get info about the specified group.

 
gethttps://analyticsapi.classlink.io/v3/groups/groupId
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/groups/groupId
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/groups/groupId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/groups/groupId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/groups/groupId");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/groups/groupId"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "GroupId": 29,
    "Name": "Tenant Admins",
    "RoleLevel": 1
  }
]

Path Params

groupId
int32
required

The unique integer ID of the group the user is in.

Headers

Authorization
string

Bearer Token.

 
Name
Description

GroupId

The unique integer ID the group.

Name

The name of the group

IconPath

The path on the ClassLink server to the image icon for the app's logo.

/v3/groups/:groupId/logins

Get the amount of logins for the specified group.

 
gethttps://analyticsapi.classlink.io/v3/groups/groupId/logins
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/groups/groupId/logins
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/groups/groupId/logins' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/groups/groupId/logins")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/groups/groupId/logins");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/groups/groupId/logins"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "Logins": 24601
  }
]

Path Params

groupId
int32
required

The unique integer ID of the group the user is in.

Query Params

startDate
date

Start of the date range to count logins.

endDate
date

End Date for the range. Will default to the end of the current month.

Headers

Authorization
string

Bearer Token.

 
Name
Description

Logins

The number of non-unique logins from the given group.

/v3/groups/:groupId/users

Get the users in the specified group.

 
gethttps://analyticsapi.classlink.io/v3/groups/groupId/users
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/groups/groupId/users
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/groups/groupId/users' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/groups/groupId/users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/groups/groupId/users");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/groups/groupId/users"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "UserId": 82605,
    "LoginId": null,
    "DisplayName": "Tadmin classlinkdemo",
    "Email": "tadmin@classlinkdemo.com",
    "ImagePath": null,
    "GroupId": 29,
    "OrgSourcedId": null,
    "RoleLevel": 1
  },
  {
    "UserId": 34469,
    "LoginId": null,
    "DisplayName": "Classlink newadmin1",
    "Email": "tadmin@classlink.com",
    "ImagePath": "clouddrive/2016/09/28/t1475058067-893505a11dc11cae7372296eb6d94e3e/1475058067.png",
    "GroupId": 2910,
    "OrgSourcedId": null,
    "RoleLevel": 4
  },
  {
    "UserId": 2,
    "LoginId": null,
    "DisplayName": "Brian Smith",
    "Email": "bsmith@classlink.com",
    "ImagePath": "clouddrive/2018/01/29/t1517207930-11864f4b09159f45189aba1fb005f828/1517207930.png",
    "GroupId": 2912,
    "OrgSourcedId": null,
    "RoleLevel": 4
  },
  {
    "UserId": 79693,
    "LoginId": null,
    "DisplayName": "Berj Admin",
    "Email": "berjadmin@classlink.com",
    "ImagePath": "2/1/79693/My Documents/My Pictures/1381608069.png",
    "GroupId": 3111,
    "OrgSourcedId": null,
    "RoleLevel": 3
  }
]

Path Params

groupId
int32
required

The unique integer ID of the group the user is in.

Query Params

order
string

The result column by which the response is sorted. Can be AppId, Count, or AppName.

sort
string

Sorts the response in ascending order (ASC) or descending order (DESC).

limit
int32

How many results are sent. If left blank will send all results.

offset
int32

How many results are skipped before output is shown. Used for easy pagination, Default 0.

createCSV
boolean

To return a CSV or not to return a CSV, that is the question.

Headers

Authorization
string

Bearer Token.

 
Name
Description

UserId

The unique integer ID of the user.

LoginId

The username of the user that logged in.

DisplayName

The name of the user as displayed on their profile.

Email

The user's email address.

ImagePath

If the user has an picute on classlink's servers this will be that image.

GroupId

The unique integer ID of the group the user is in.

OrgSourcedId

The unique integer ID of the school that the user is a part of in their district.

RoleLevel

The role level of the user. Determines whether the user is an admin teacher, or student.

/v3/groups/top

Get the users in the specified group.

 
gethttps://analyticsapi.classlink.io/v3/groups/top
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/groups/top
var request = require("request");

var options = { method: 'GET',
  url: 'https://analyticsapi.classlink.io/v3/groups/top' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/groups/top")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/groups/top");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/groups/top"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "GroupId": 29,
    "Name": "Tenant Admins",
    "Logins": "29"
  },
  {
    "GroupId": 2916,
    "Name": "Domain Admins",
    "Logins": "18"
  },
  {
    "GroupId": 2912,
    "Name": "DemoStudents",
    "Logins": "13"
  },
  {
    "GroupId": 2911,
    "Name": "DemoTeachers",
    "Logins": "3"
  }
]

Path Params

groupId
int32
required

Query Params

startDate
date

Start Date for the range. Will default to the start of the current month.

endDate
string

End Date for the range. Will default to the end of the current month.

limit
int32

How many results are sent. If left blank will send all results.

offset
int32

How many results are skipped before output is shown. Used for easy pagination, Default 0.

Headers

Authorization
string

Bearer Token.

 
Name
Description

GroupId

The unique integer ID of the group.

Name

The name of the group.

Logins

The number of times that users in the group logged in.

/v3/logins/weekly

Get total logins by week.

 
gethttps://analyticsapi.classlink.io/v3/logins/weekly
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/logins/weekly
var request = require("request");

var options = { method: 'GET',
  url: 'https://analyticsapi.classlink.io/v3/logins/weekly' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/logins/weekly")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/logins/weekly");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/logins/weekly"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "Id": 851426,
    "Week": 1,
    "Year": 2018,
    "Type": 0,
    "Logins": 24
  },
  {
    "Id": 851450,
    "Week": 2,
    "Year": 2018,
    "Type": 0,
    "Logins": 41
  },
  {
    "Id": 851575,
    "Week": 3,
    "Year": 2018,
    "Type": 0,
    "Logins": 14
  },
  {
    "Id": 851962,
    "Week": 6,
    "Year": 2018,
    "Type": 0,
    "Logins": 99
  },
  {
    "Id": 852061,
    "Week": 7,
    "Year": 2018,
    "Type": 0,
    "Logins": 117
  },
  {
    "Id": 852178,
    "Week": 8,
    "Year": 2018,
    "Type": 0,
    "Logins": 13
  }
]

Query Params

startDate
date

Start of the date range to count logins.

endDate
date

End Date for the range. Will default to the end of the current month.

order
string

The result column by which the response is sorted. Can be Id, Week, Year, Type, or Logins.

sort
string

Sorts the response in ascending order (ASC) or descending order (DESC).

Headers

Authorization
string

Bearer Token.

 
Name
Description

Id

A numerical key representing that entry in the table.

Week

The week of the "Year" (out of 52).

Year

The year of the statistic.

Type

The type of login.

Logins

The number of logins from "Week" in "Year".

/v3/logins/record

Get the gate with the highest logins for the given date range.

 
gethttps://analyticsapi.classlink.io/v3/logins/record
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/logins/record
var request = require("request");

var options = { method: 'GET',
  url: 'https://analyticsapi.classlink.io/v3/logins/record' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/logins/record")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/logins/record");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/logins/record"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "Id": 845948,
    "Date": "2018-02-08T00:00:00.000Z",
    "Type": 0,
    "Count": 61
  },
  {
    "Id": 846356,
    "Date": "2018-02-28T00:00:00.000Z",
    "Type": 2,
    "Count": 33
  },
  {
    "Id": 846120,
    "Date": "2018-02-16T00:00:00.000Z",
    "Type": 0,
    "Count": 32
  },
  {
    "Id": 846088,
    "Date": "2018-02-15T00:00:00.000Z",
    "Type": 0,
    "Count": 32
  },
  {
    "Id": 845633,
    "Date": "2018-01-18T00:00:00.000Z",
    "Type": 1,
    "Count": 29
  },
  {
    "Id": 846009,
    "Date": "2018-02-09T00:00:00.000Z",
    "Type": 0,
    "Count": 27
  },
  {
    "Id": 845586,
    "Date": "2018-01-17T00:00:00.000Z",
    "Type": 2,
    "Count": 26
  }
]

Query Params

startDate
date

Start of the date range to count logins.

endDate
date

End Date for the range. Will default to the end of the current month.

order
string
sort
string
limit
int32
offset
int32

Headers

Authorization
string

Bearer Token.

 
Name
Description

Id

A numerical key representing that entry in the table.

Date

The date of the statistic.

Type

The type of login.

Count

The number of logins on "Date".

/v3/logins/daily

Get total logins by day.

 
gethttps://analyticsapi.classlink.io/v3/logins/daily
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/logins/daily
var request = require("request");

var options = { method: 'GET',
  url: 'https://analyticsapi.classlink.io/v3/logins/daily' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/logins/daily")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/logins/daily");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/logins/daily"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "Date": "2018-03-04",
    "Logins": "1"
  },
  {
    "Date": "2018-03-05",
    "Logins": "22"
  },
  {
    "Date": "2018-03-06",
    "Logins": "36"
  },
  {
    "Date": "2018-03-07",
    "Logins": "10"
  }
]

Query Params

startDate
date

Start of the date range to count logins.

endDate
date

End Date for the range. Will default to the end of the current month.

order
string

The result column by which the response is sorted. Can be date or Logins.

sort
string

Sorts the response in ascending order (ASC) or descending order (DESC).

Headers

Authorization
string

Bearer Token.

 
Name
Description

Date

The date relevant to the statistic.

Logins

The number of logins that happened on "Date".

/v3/reports/permissions/schools/:userId

Update the school permissions of the specified user.

 
posthttps://analyticsapi.classlink.io/v3/reports/permissions/schools/userId
curl --request POST \
  --url https://analyticsapi.classlink.io/v3/reports/permissions/schools/userId
var request = require("request");

var options = { method: 'POST',
  url:
   'https://analyticsapi.classlink.io/v3/reports/permissions/schools/userId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/reports/permissions/schools/userId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://analyticsapi.classlink.io/v3/reports/permissions/schools/userId");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/reports/permissions/schools/userId"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "UserId": 665,
  "DisplayName": "Demo Teacher",
  "Email": "demoteacher08112016121130321@demo.local",
  "ImagePath": "clouddrive/2015/01/23/t1422016251-24e08400fc7ac23bc6d955fa07a12f1a/1422016251.png",
  "GroupId": "29",
  "OrgSourcedId": "0000"
}

Path Params

userId
int32
required

The unique integer ID of the user.

Form Data

orgs
string

Headers

Authorization
string

Bearer Token.

 
Name
Description

UserId

The unique integer ID of the user.

DisplayName

The name of the user as displayed on their profile.

Email

The user's email address.

ImagePath

The path on the ClassLink server to the image icon for the app's logo.

GroupId

The unique integer ID of the group the user is in.

OrgSourcedId

The unique integer ID of the school that the user is a part of in their district.

/v3/reports/permissions/schools/:userId

Ger the school permissions of the specified user.

 
gethttps://analyticsapi.classlink.io/v3/reports/permissions/schools/userId
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/reports/permissions/schools/userId
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/reports/permissions/schools/userId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/reports/permissions/schools/userId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/reports/permissions/schools/userId");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/reports/permissions/schools/userId"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "UserId": 665,
  "DisplayName": "Demo Teacher",
  "Email": "demoteacher08112016121130321@demo.local",
  "ImagePath": "clouddrive/2015/01/23/t1422016251-24e08400fc7ac23bc6d955fa07a12f1a/1422016251.png",
  "GroupId": "29",
  "OrgSourcedId": "0000"
}

Path Params

userId
int32
required

The unique integer ID of the user.

Headers

Authorization
string

Bearer Token.

 
Name
Description

UserId

The unique integer ID of the user.

DisplayName

The name of the user as displayed on their profile.

Email

The user's email address.

ImagePath

The path on the ClassLink server to the image icon for the app's logo.

GroupId

The unique integer ID of the group the user is in.

OrgSourcedId

The unique integer ID of the school that the user is a part of in their district.

/v3/schools

Get the list of schools in the tenant

 
gethttps://analyticsapi.classlink.io/v3/schools
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/schools
var request = require("request");

var options = { method: 'GET',
  url: 'https://analyticsapi.classlink.io/v3/schools' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/schools")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/schools");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/schools"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "OrgSourcedId": "0342",
    "Name": "Adams Middle School"
  },
  {
    "OrgSourcedId": "0901",
    "Name": "Allenby Elementary School"
  },
  {
    "OrgSourcedId": "0251",
    "Name": "Armstrong Elementary School"
  },
  {
    "OrgSourcedId": "0321",
    "Name": "Arthur Middle School"
  },
  {
    "OrgSourcedId": "0072",
    "Name": "Bach Elementary School"
  },
  {
    "OrgSourcedId": "0501",
    "Name": "Bajorek Elementary School"
  },
  {
    "OrgSourcedId": "0471",
    "Name": "Barbarito High School"
  }
]

Path Params

orgSourcedId
int32
required

The unique integer ID of the school that the user is a part of in their district.

Query Params

order
string

The result column by which the response is sorted. Can be OrgSourcedId or Name.

sort
string

Sorts the response in ascending order (ASC) or descending order (DESC).

Headers

Authorization
string

Bearer Token.

 
Name
Description

OrgSourcedId

The unique integer ID of the school that the user is a part of in their district.

Name

The name of the Org.

/v3/schools/:OrgSourcedId/appusage

Get all the app usage at the specified school

 
gethttps://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "AppId": 33156,
    "Launches": "12",
    "IconPath": "//dp3vjvsy1r9i0.cloudfront.net/resources/icons/default/Dynamic-Recycling.png",
    "HireIconPath": "//dp3vjvsy1r9i0.cloudfront.net/resources/icons/hires/Dynamic-Recycling@2x.png",
    "AppName": "Dynamic Recycling"
  },
  {
    "AppId": 1599,
    "Launches": "5",
    "IconPath": "//dp3vjvsy1r9i0.cloudfront.net/resources/icons/default/microsoftlive_edu.png",
    "HireIconPath": "//dp3vjvsy1r9i0.cloudfront.net/resources/icons/hires/microsoftlive_edu@2x.png",
    "AppName": "Office 365 Extension SSO"
  },
  {
    "AppId": 31,
    "Launches": "1",
    "IconPath": "//dp3vjvsy1r9i0.cloudfront.net/resources/icons/default/mydocuments.png",
    "HireIconPath": "//dp3vjvsy1r9i0.cloudfront.net/resources/icons/hires/mydocuments@2x.png",
    "AppName": "My Documents"
  },
  {
    "AppId": 33174,
    "Launches": "1",
    "IconPath": "//dp3vjvsy1r9i0.cloudfront.net/resources/icons/default/soccer_ball09202013.png",
    "HireIconPath": "//dp3vjvsy1r9i0.cloudfront.net/resources/icons/hires/soccer_ball09202013@2x.png",
    "AppName": "west woods website"
  },
  {
    "AppId": 1216,
    "Launches": "1",
    "IconPath": "//dp3vjvsy1r9i0.cloudfront.net/resources/icons/default/brainhoney.png",
    "HireIconPath": "//dp3vjvsy1r9i0.cloudfront.net/resources/icons/hires/brainhoney@2x.png",
    "AppName": "BrainHoney"
  },
  {
    "AppId": 33165,
    "Launches": "1",
    "IconPath": "//dp3vjvsy1r9i0.cloudfront.net/resources/icons/default/minecraft.png",
    "HireIconPath": "//dp3vjvsy1r9i0.cloudfront.net/resources/icons/hires/minecraft@2x.png",
    "AppName": "west woods website"
  }
]

Path Params

orgSourcedId
int32
required

The unique integer ID of the school that the user is a part of in their district.

Query Params

startDate
date

Start Date for the range. Will default to the start of the current month.

endDate
date

End Date for the range. Will default to the end of the current month.

Headers

Authorization
string

Bearer Token.

 
Name
Description

AppId

The unique integer application ID of the tenant's app.

Launches

The number of times the app was launched.

IconPath

The location of an image of he apps logo.

HireIconPath

A higher res version of the image at IconPath.

AppName

The name of the application.

/v3/schools/:OrgSourcedId/appusage/:AppId

Get the specified app usage at the specified school

 
gethttps://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage/AppId
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage/AppId
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage/AppId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage/AppId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage/AppId");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage/AppId"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "Launches": "318",
    "RoleLevel": 1
  }
]

Path Params

orgSourcedId
int32
required

The unique integer ID of the school that the user is a part of in their district.

AppId
int32
required

The unique integer application ID of the tenant's app.

Query Params

startDate
date

Start Date for the range. Will default to the start of the current month.

endDate
date

End Date for the range. Will default to the end of the current month.

Headers

Authorization
string

Bearer Token.

 
Name
Description

Launches

The number of times that the app was launched in the given date range.

RoleLevel

The role level of the user. Determines whether the user is an admin teacher, or student.

/v3/schools/:OrgSourcedId/appusage/:AppId/monthly

Get the specified app usage by month at the specified school

 
gethttps://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage/AppId/monthly
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage/AppId/monthly
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage/AppId/monthly' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage/AppId/monthly")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage/AppId/monthly");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/appusage/AppId/monthly"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "Month": "2017-05-01",
    "Launches": "1"
  },
  {
    "Month": "2017-06-01",
    "Launches": "13"
  },
  {
    "Month": "2017-09-01",
    "Launches": "1"
  },
  {
    "Month": "2017-11-01",
    "Launches": "441"
  },
  {
    "Month": "2017-12-01",
    "Launches": "256"
  },
  {
    "Month": "2018-01-01",
    "Launches": "317"
  },
  {
    "Month": "2018-02-01",
    "Launches": "5"
  }
]

Path Params

orgSourcedId
int32
required

The unique integer ID of the school that the user is a part of in their district.

AppId
int32
required

The unique integer application ID of the tenant's app.

Query Params

startDate
date

Start Date for the range. Will default to the start of the current month.

endDate
date

End Date for the range. Will default to the end of the current month.

Headers

Authorization
string

Bearer Token.

 
Name
Description

Month

The month in which the application represented by "AppId" launched "Launches" times by users in the organization/school represented by "orgSourcedId"

Launches

The number of times the application was opened through the ClassLink launchpad.

/v3/schools/:OrgSourcedId/logins/daily

Get the distinct logins for the given school by day

 
gethttps://analyticsapi.classlink.io/v3/schools/OrgSourcedId/logins/daily
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/logins/daily
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/logins/daily' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/logins/daily")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/logins/daily");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/logins/daily"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "date": "2018-01-05",
    "Logins": "8"
  },
  {
    "date": "2018-01-08",
    "Logins": "1"
  },
  {
    "date": "2018-01-11",
    "Logins": "6"
  },
  {
    "date": "2018-01-12",
    "Logins": "27"
  },
  {
    "date": "2018-01-15",
    "Logins": "18"
  },
  {
    "date": "2018-01-16",
    "Logins": "8"
  },
  {
    "date": "2018-01-17",
    "Logins": "14"
  }
]

Path Params

orgSourcedId
int32
required

The unique integer ID of the school that the user is a part of in their district.

Query Params

startDate
date

Start Date for the range. Will default to the start of the current month.

endDate
date

End Date for the range. Will default to the end of the current month.

Headers

Authorization
string

Bearer Token.

 
Name
Description

date

The date relevant to the statistic.

Logins

The number of logins that happened on "date".

/v3/schools/:OrgSourcedId/dlogins/monthly

Get the distinct logins for the given school by month

 
gethttps://analyticsapi.classlink.io/v3/schools/OrgSourcedId/dlogins/monthly
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/dlogins/monthly
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/dlogins/monthly' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/dlogins/monthly")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/dlogins/monthly");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/dlogins/monthly"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "month": "2018-01-01T00:00:00.000Z",
    "OrgSourcedId": "0000",
    "dlogins": 1,
    "Logins": 203,
    "RoleLevel": 1
  },
  {
    "month": "2018-02-01T00:00:00.000Z",
    "OrgSourcedId": "0000",
    "dlogins": 1,
    "Logins": 49,
    "RoleLevel": 1
  }
]

Path Params

orgSourcedId
int32
required

The unique integer ID of the school that the user is a part of in their district.

Query Params

startDate
date

Start Date for the range. Will default to the start of the current month.

endDate
date

End Date for the range. Will default to the end of the current month.

Headers

Authorization
string

Bearer Token.

 
Name
Description

month

The month of the given statistic.

OrgSourcedId

The unique integer ID of the school that the user is a part of in their district.

dlogins

The number of different users that logged in in "month".

Logins

The total number of logins for "month".

RoleLevel

The role level of the user. Determines whether the user is an admin teacher, or student.

/v3/schools/:OrgSourcedId/logins

Get the daily logins at the school by Role Level

 
gethttps://analyticsapi.classlink.io/v3/schools/OrgSourcedId/logins
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/logins
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/logins' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/logins")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/logins");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/logins"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "Logins": "252",
    "RoleLevel": 1
  }
]

Path Params

orgSourcedId
int32
required

The unique integer ID of the school that the user is a part of in their district.

Query Params

startDate
date

Start Date for the range. Will default to the start of the current month.

endDate
date

End Date for the range. Will default to the end of the current month.

Headers

Authorization
string

Bearer Token.

 
Name
Description

Logins

The number of logins in the given date range.

RoleLevel

The role level of the user. Determines whether the user is an admin teacher, or student.

/v3/schools/:OrgSourcedId/users

Get the users in the specified school

 
gethttps://analyticsapi.classlink.io/v3/schools/OrgSourcedId/users
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/users
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/users' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/users");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/schools/OrgSourcedId/users"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "date": "2018-01-05T00:00:00.000Z",
    "OrgSourcedId": "0000",
    "dlogins": 1,
    "Logins": 8,
    "RoleLevel": 1
  },
  {
    "date": "2018-01-08T00:00:00.000Z",
    "OrgSourcedId": "0000",
    "dlogins": 1,
    "Logins": 1,
    "RoleLevel": 1
  },
  {
    "date": "2018-01-11T00:00:00.000Z",
    "OrgSourcedId": "0000",
    "dlogins": 1,
    "Logins": 6,
    "RoleLevel": 1
  },
  {
    "date": "2018-01-12T00:00:00.000Z",
    "OrgSourcedId": "0000",
    "dlogins": 1,
    "Logins": 27,
    "RoleLevel": 1
  },
  {
    "date": "2018-01-15T00:00:00.000Z",
    "OrgSourcedId": "0000",
    "dlogins": 1,
    "Logins": 18,
    "RoleLevel": 1
  },
  {
    "date": "2018-01-16T00:00:00.000Z",
    "OrgSourcedId": "0000",
    "dlogins": 1,
    "Logins": 8,
    "RoleLevel": 1
  }
]

Path Params

orgSourcedId
int32
required

The unique integer ID of the school that the user is a part of in their district.

Query Params

startDate
date

Start Date for the range. Will default to the start of the current month.

endDate
date

End Date for the range. Will default to the end of the current month.

order
string

The result column by which the response is sorted. Can be date, OrgSourcedId, dlogins, Logins, or RoleLevel.

sort
string

Sorts the response in ascending order (ASC) or descending order (DESC).

limit
int32

How many results are sent. If left blank will send all results.

offset
int32

How many results are skipped before output is shown. Used for easy pagination, Default 0.

Headers

Authorization
string

Bearer Token.

 
Name
Description

date

The day which "Logins" logins from "dlogins" distinct users from the given date range.

OrgSourcedId

The unique integer ID of the school that the user is a part of in their district.

dlogins

The number of distinct users that logged in on "date".

Logins

The total number of logins on "date".

RoleLevel

The role level of the user. Determines whether the user is an admin teacher, or student.

/v3/schools/logins

Get logins by school

 
gethttps://analyticsapi.classlink.io/v3/schools/logins
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/schools/logins
var request = require("request");

var options = { method: 'GET',
  url: 'https://analyticsapi.classlink.io/v3/schools/logins' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/schools/logins")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/schools/logins");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/schools/logins"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "OrgSourcedId": "0000",
    "OrgName": "ClassLink School District",
    "Logins": "252"
  },
  {
    "OrgSourcedId": "0801",
    "OrgName": "Eisenhower High School",
    "Logins": "56"
  },
  {
    "OrgSourcedId": "8991",
    "OrgName": "Hughes Academy",
    "Logins": "44"
  },
  {
    "OrgSourcedId": "0421",
    "OrgName": "Ridgway Elementary School",
    "Logins": "38"
  },
  {
    "OrgSourcedId": "0472",
    "OrgName": "Washington High School",
    "Logins": "34"
  },
  {
    "OrgSourcedId": "0114",
    "OrgName": "Redwood High School",
    "Logins": "3"
  }
]

Query Params

startDate
date

Start Date for the range. Will default to the start of the current month.

endDate
date

End Date for the range. Will default to the end of the current month.

filter
string

An string representing the list of relevant OrgSourcedIds to get data about. Can be a number, "All", or "None".

orgs
array of integers

An array of OrgSourcedIds.

Headers

Authorization
string

Bearer Token.

 
Name
Description

OrgSourcedId

The unique integer ID of the school that the user is a part of in their district.

OrgName

The name of the organization or school.

Logins

The number of logins from that organization in the given date range.

/v3/schools/logins/monthly

Get monthly logins by school.

 
gethttps://analyticsapi.classlink.io/v3/schools/logins/monthly
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/schools/logins/monthly
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/schools/logins/monthly' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/schools/logins/monthly")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/schools/logins/monthly");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/schools/logins/monthly"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "Month": "2018-01-01",
    "OrgSourcedId": "0000",
    "OrgName": "ClassLink School District",
    "Logins": "203"
  },
  {
    "Month": "2018-02-01",
    "OrgSourcedId": "0000",
    "OrgName": "ClassLink School District",
    "Logins": "49"
  },
  {
    "Month": "2018-01-01",
    "OrgSourcedId": "0801",
    "OrgName": "Eisenhower High School",
    "Logins": "16"
  },
  {
    "Month": "2018-02-01",
    "OrgSourcedId": "0801",
    "OrgName": "Eisenhower High School",
    "Logins": "40"
  },
  {
    "Month": "2018-01-01",
    "OrgSourcedId": "8991",
    "OrgName": "Hughes Academy",
    "Logins": "21"
  }
]

Query Params

startDate
date

Start Date for the range. Will default to the start of the current month.

endDate
date

End Date for the range. Will default to the end of the current month.

filter
string

An string representing the list of relevant OrgSourcedIds to get data about. Can be a number, "All", or "None".

orgs
array of integers

An array of OrgSourcedIds.

Headers

Authorization
string

Bearer Token.

 
Name
Description

Month

The Month of the Given statistic.

OrgSourcedId

The unique integer ID of the school that the user is a part of in their district.

OrgName

The name of the organization or school.

Logins

The number of logins from that organization in the given date range.

/v3/users

Get the list off all users.

 
gethttps://analyticsapi.classlink.io/v3/users
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/users
var request = require("request");

var options = { method: 'GET',
  url: 'https://analyticsapi.classlink.io/v3/users' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/users");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/users"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "UserId": 1329471,
    "LoginId": "012345",
    "DisplayName": "0 test",
    "Email": "01234509092015010930328@demo",
    "ImagePath": "clouddrive/2017/04/26/t1493212008-cfeb2b332b3d6eb804119990ac96170d/1493212008.png",
    "GroupId": 12586,
    "OrgSourcedId": null,
    "RoleLevel": 0
  },
  {
    "UserId": 5826983,
    "LoginId": "012345",
    "DisplayName": "0 test",
    "Email": "01234507022018130204965@Demo.local",
    "ImagePath": null,
    "GroupId": 12586,
    "OrgSourcedId": "",
    "RoleLevel": 5
  },
  {
    "UserId": 1848444,
    "LoginId": null,
    "DisplayName": "0as h",
    "Email": "s@h.com",
    "ImagePath": null,
    "GroupId": 548,
    "OrgSourcedId": null,
    "RoleLevel": 0
  },
  {
    "UserId": 1511698,
    "LoginId": "1202070",
    "DisplayName": "1202070",
    "Email": "120207031102015121050161@demo.local",
    "ImagePath": "clouddrive/2017/04/13/t1492064092-1802bc150e51e31b854a501515cd985e/1492064092.png",
    "GroupId": 11940,
    "OrgSourcedId": null,
    "RoleLevel": 0
  },
  {
    "UserId": 1231201,
    "LoginId": "12345",
    "DisplayName": "12345",
    "Email": "12345@Demo",
    "ImagePath": null,
    "GroupId": 9269,
    "OrgSourcedId": null,
    "RoleLevel": 0
  }
]

Query Params

order
string

The result column by which the response is sorted. Can be UserId, LoginId, DisplayName, Email, GroupId, OrgSourcedId, or RoleLevel.

sort
string

Sorts the response in ascending order (ASC) or descending order (DESC).

limit
int32

How many results are sent. If left blank will send all results.

offset
int32

How many results are skipped before output is shown. Used for easy pagination, Default 0.

nameFileter
string

Will only return names similar to this filter. If left blank will return everything.

roleFilter
array of strings

A list of roles to include in the results. Can be inverted by putting "!" infront of the number e.g. "!5"

Headers

Authorization
string

Bearer Token.

 
Name
Description

UserId

The unique integer ID of the user.

LoginId

The username of the user that logged in.

DisplayName

The name of the user as displayed on their profile.

Email

The user's email address.

ImagePath

If the user has an picute on classlink's servers this will be that image.

GroupId

The unique integer ID of the group the user is in.

OrgSourcedId

The unique integer ID of the school that the user is a part of in their district.

RoleLevel

The role level of the user. Determines whether the user is an admin teacher, or student.

/v3/users/:userId

Get the specific user details.

 
gethttps://analyticsapi.classlink.io/v3/users/userId
curl --request GET \
  --url https://analyticsapi.classlink.io/v3/users/userId
var request = require("request");

var options = { method: 'GET',
  url:
   'https://analyticsapi.classlink.io/v3/users/userId' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://analyticsapi.classlink.io/v3/users/userId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://analyticsapi.classlink.io/v3/users/userId");

xhr.send(data);
import requests

url = "https://analyticsapi.classlink.io/v3/users/userId"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "UserId": 78983,
    "LoginId": null,
    "DisplayName": "A.J. Tobia (Teacher)",
    "OrgSourcedId": null,
    "OrgName": null,
    "GroupId": 547,
    "GroupName": "CL Demo Teacher Instant Access",
    "RoleLevel": 3,
    "Email": "atobia@sboe.us",
    "ImagePath": null
  }
]

Path Params

userId
int32
required

The unique integer ID of the user.

Query Params

order
string

The result column by which the response is sorted. Can be UserId, LoginId, DisplayName, OrgSourcedId, OrgName, GroupId, GroupName, RoleLevel, Email, and ImagePath.

sort
string

Sorts the response in ascending order (ASC) or descending order (DESC).

limit
int32

How many results are sent. If left blank will send all results.

offset
int32

How many results are skipped before output is shown. Used for easy pagination, Default 0.

nameFileter
string

A string filter for the name of the user.

roleFilter
array of integers

An integer filter for the users role level. 1: Tenant Administrator, 2: School Administrator, 3: Teacher, 4: Student, and 6: Parent

Headers

Authorization
string

Bearer Token.

 
Name
Description

UserId

The unique integer ID of the user.

LoginId

The username of the user that logged in.

DisplayName

The name of the user as displayed on their profile.

OrgSourcedId

The unique integer ID of the school that the user is a part of in their district.

OrgName

The name of the organization or school.

GroupId

The unique integer ID of the group the user is in.

GroupName

The name of the group the user is in.

RoleLevel

The role level of the user. 1: Tenant Administrator, 2: School Administrator, 3: Teacher, 4: Student, and 6: Parent

Email

The user's email address.

ImagePath

If the user has an picute on classlink's servers this will be that image.

Request Libraries

 

RosterServer

RosterServer is a set of libraries for .NET, Python, Node, PHP, Java, Go, and Ruby that makes requests to the ClassLink RosterServer. The purpose of RosterServer is to make these requests easy, taking care of the OAuth 1.0a authentication for you.
It takes in the client_id and client_secret that you provide and allows you to make requests to any of the various RosterServer endpoints by entering the URL,
which can include query parameters. It will return the status code and JSON response.

OneClick

OneClick is a set of libraries for .Net, Python, Node, PHP, Java, Go, and Ruby that makes request to ClassLink OneClick. These libraries make requests to OneClick significantly easier, taking care of much of the OAuth 2 authentication. The libraries have methods that make requests to specific OneClick endpoints, depending on what information is needed. They return a JSON representation of the information.

RosterServer: .NET

 

Setup

To use RosterServer, you need to download the DLL and add a reference to it in your project. To do this in Visual Studio 2017, right click Dependencies -> Add References -> Browse -> Select DLL -> Add.

Usage

First, you need to import ClassLink.OneRoster.

using ClassLink.OneRoster;

Next, create a new instance of the OneRoster object, which takes in two strings,
the client_id and client_secret.

OneRoster oneRoster = new OneRoster("XXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXX");

You are now able to make requests to a specified URL. This is done using the method MakeRosterRequest(url), which takes in the URL and returns a OneRosterResponse object containing the status code and the JSON response.

OneRoster oneRoster = new OneRoster("XXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXX");
OneRosterResponse response = oneRoster.MakeRosterRequest("https://example.com/users");

The response is made up of StatusCode, which contains the status code as an int, and Response, which contains the JSON response as a string.

Console.WriteLine(response.StatusCode); // The status code
Console.WriteLine(response.Response); // The JSON response

Example

Example

Print all students' names

using System;
using System.Linq;
using Newtonsoft.Json.Linq;
// import OneRoster
using ClassLink.OneRoster;

namespace Example
{
    class Program
    {
        static JToken[] getUsers(string url)
        {
            // Create new OneRoster object with the client_id and client_secret
            OneRoster oneRoster = new OneRoster("XXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXX");
            
            // Make the request to the given url
            OneRosterResponse response = oneRoster.MakeRosterRequest(url);
            
            // Parse response
            JObject parsed = JObject.Parse(response.Response);
            
            // If status_code is 200, create array of users from response, otherwise print message and return null
            switch (response.StatusCode)
            {
                case 200:
                    return parsed.Property("users").Value.ToArray();
                case 401:
                    Console.WriteLine("Unauthorized Request\n" + parsed.Property("code") + response.Response);
                    break;
                case 404: 
                    Console.WriteLine("Not Found\n" + parsed.Property("code") + response.Response);
                    break;
                case 500:
                    Console.WriteLine("Server Error\n" + parsed.Property("code") + response.Response);
                    break;
                default:
                    Console.WriteLine("Something Went Wrong, status code " + response.StatusCode + "\n" 
                                      + response.Response);
                    break;
            }

            return null;
        }

        static void Main(string[] args)
        {
            JToken[] users =
                getUsers(
                    "https://example.com/users?fields=givenName%2CfamilyName&filter=role%3D'student'&limit=10&offset=50&orderBy=asc");
            if (users != null)
            {
                foreach (var user in users)
                {
                    Console.WriteLine(user["givenName"] + " " + user["familyName"]);
                }
            }
        }
    }
}

RosterServer: Python

 

Setup

Insert oneroster.py into your project and install the requests module.

Usage

First, import OneRoster.

from oneroster import OneRoster

Then, create a new instance of the OneRoster object, which takes in two strings,
the client_id and client_secret.

oneRoster = OneRoster('XXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX')

You are now able to make requests to a specified URL. This is done using the method make_roster_request(url), which takes in the URL and returns a dictionary.

oneRoster = OneRoster('XXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX')
response = oneRoster.make_roster_request("https://example.com/users")

The response is made up of "status_code", which contains the status code, and "response", which contains the JSON response as a string.

print(response["status_code"]); // The status code
print(response["response"]); // The JSON response

Example

Example

Print all students' names

import json

# Import OneRoster
from oneroster import OneRoster


def get_users(url):
    # Create new OneRoster with the client_id and client_secret
    oneRoster = OneRoster('XXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX')

    # Make the request to the given url and store the dictionary with status_code and response
    response = oneRoster.make_roster_request(url)

    # Decode the response
    decoded = json.loads(response["response"])

    # If status_code is 200, create array of users from response, otherwise print message and return None
    if response["status_code"] == 200:
        return decoded["users"]
    elif response["status_code"] == 401:
        print("Unauthorized Request\n" + response["response"])
    elif response["status_code"] == 404:
        print("Not Found\n" + response["response"])
    elif response["status_code"] == 500:
        print("Server Error\n" + response["response"])
    else:
        print("Something Went Wrong, status code " + response["status_code"]
              + "\n" + response["response"])
    return None

users = get_users("https://example.com/users?fields=givenName%2CfamilyName&filter=role%3D'student'")
if users is not None:
    for user in users:
        print(user["givenName"] + " " + user["familyName"])

RosterServer: Node

 

Setup

Insert the file OneRoster.js into your project.
RosterServer uses crypto-js and requests, so you will need to install them if they are not being used in your project already.

In the directory containing your package.json:

npm install request --save
npm install crypto-js --save

Usage

First, import OneRoster.

const OneRoster = require('./OneRoster')

Next, create a new instance of the OneRoster object, which takes in two strings,
the client_id and client_secret.

let oneRoster = new OneRoster('XXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX');

You are now able to make requests to a specified URL. This is done using the method makeRosterRequest(url, callback), which takes in the URL and a callback, which takes in error, the status code, and the JSON response.

let oneRoster = new OneRoster('XXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX');
oneRoster.makeRosterRequest("https://example.com/users", function(error, statusCode, response) {
    if (error) throw new Error(error);
    console.log(statusCode); // The status code
    console.log(response);  // The JSON response
}); 

Example

Example

Print all students' names

// Import the OneRoster module
const OneRoster = require('./OneRoster');

function getUsers(url) {
    // Create new OneRoster object with the client_id and client_secret
    let oneRoster = new OneRoster('XXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX');

    // Make the request to the given url with the callback that takes in error, the status code, and the response body
    oneRoster.makeRosterRequest(url, function (error, statusCode, response) {
        if (error) throw new Error(error);

        // Decode the resopnse
        let decoded = JSON.parse(response);

        // If statusCode is 200, create array of users from response, otherwise print message
        switch(statusCode) {
            case 200:
                printUsers(decoded.users);
                break;
            case 401:
                console.log("Unauthorized Request\n" + response);
                break;
            case 404:
                console.log("Not Found\n" + response);
                break;
            case 500:
                console.log("Server Error\n" + response);
                break;
            default:
                console.log("Something Went Wrong, status code " + response.statusCode + "\n" + response);
                break;
        }
    });
}

// Print the users
function printUsers(users) {
    for (let i = 0; i < users.length; i++) {
        console.log(users[i].givenName + " " + users[i].familyName);
    }
}

getUsers("https://example.com/users?fields=givenName%2CfamilyName&filter=role%3D'student'");

RosterServer: PHP

 

Setup

Insert OneRoster.php into your project.
NOTE: OneRoster.php uses cURL, which may require setup on Windows.

Usage

First, import OneRoster.

include('OneRoster.php');

Next, create a new instance of the OneRoster object, which takes in two strings,
the client_id and client_secret.

$oneRoster = new OneRoster('XXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX')

You are now able to make requests to a specified URL. This is done using the method makeRosterRequest($url), which takes in the URL and returns an array.

$oneRoster = new OneRoster('XXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX')
$response = $oneRoster->makeRosterRequest("https://example.com/users");

The response is made up of "status_code", which contains the status code, and "response", which contains the JSON response as a string.

echo $response["status_code"]; // The status code
echo $response["response"]; // The JSON response

Example

Example

Print all students' names

<?php
// Include OneRoster
include('OneRoster.php');

function getUsers($url) {

    // Create new OneRoster object with the client_id and client_secret
    $oneRoster = new OneRoster('XXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX');

    // Make the request to the given url and store the array with status_code and response
    $response = $oneRoster->makeRosterRequest($url);

    // Decode the response
    $decoded = json_decode($response["response"], true);

    // If status_code is 200, create array of users from response, otherwise print message and return null
    switch ($response["status_code"]) {
        case 200:
            return $decoded["users"];
        case 401:
            echo "Unauthorized Request\n" . $response["response"];
            break;
        case 404:
            echo "Not Found\n" . $response["response"];
            break;
        case 500:
            echo "Server Error\n" . $response["response"];
            break;
        default:
            echo "Something Went Wrong, status code " . $response["status_code"] . $response["response"];
            break;
    }
    return null;
}

$users = getUsers("https://example.com/users?fields=givenName%2CfamilyName&filter=role%3D'student'");

// Print users if not null
if ($users != null) {
    foreach ($users as $user) {
        echo $user["givenName"] . " " . $user["familyName"] . "\n";
    }
}

RosterServer: Java

 

GitHub and JAR download

Setup

To use RosterServer, you need to download the OneRoster JAR file and add a reference to the JAR file in your project. To do this in IntelliJ, click File -> Project Structure -> Libraries -> Click the plus sign -> Select the JAR File.

Usage

First, import com.classlink.roster.OneRoster.

import com.classlink.roster.OneRoster;

Next, create a new instance of the OneRoster object, which takes in two strings,
the client_id and client_secret.

OneRoster oneRoster = new OneRoster("XXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXX");

You are now able to make requests to a specified URL. This is done using the method makeRosterRequest(url), which takes in the URL and returns a OneRosterResponse object, which contains the status code and response.

OneRoster oneRoster = new OneRoster("XXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXX");
OneRosterResponse response = oneRoster.makeRosterRequest("https://example.com/users");

The response is made up of statusCode, which contains the status code as an int, and response, which contains the JSON response as a string.

System.out.println(response.getStatuscode()); // The status code
System.out.println(response.getResponse()); // The JSON response

Example

Example

Print all students' names

import com.google.gson.Gson;
import java.util.List;
import java.util.Map;

// Import OneRoster
import com.classlink.roster.OneRoster;

public class Example {

    private static List<Map<String, String>> getUsers(String url) {
        // Create new OneRoster object with the client_id and client_secret
        OneRoster oneRoster = new OneRoster("XXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXX");

        // Make the request to the given url
        OneRosterResponse response = rr.makeRosterRequest(url);

        Gson gson = new Gson();

        // If the status code is 200, return Map of users, otherwise print message
        if (response.getStatusCode() == 200) {
            Map<String, List<Map<String, String>>> users = gson.fromJson(response.getResponse(), Map.class);
            return users.get("users");
        }

        switch (response.getStatusCode()) {
            case 401:
                System.out.println("Unauthorized Request\n" + response.getResponse());
                break;
            case 404:
                System.out.println("Not Found\n" + response.getResponse());
                break;
            case 500:
                System.out.println("Server Error\n" + response.getResponse());
                break;
            default:
                System.out.println("Something Went Wrong, status code " + response.getStatusCode() +
                        "\n" + response.getResponse());
                break;
        }

        return null;
    }

    public static void main(String[] args) {
        List<Map<String, String>> users = getUsers(
                "https://example.com/users?fields=givenName%2CfamilyName&filter=role%3D'student'");
        if (users != null) {
            for (Map<String, String> user : users) {
                System.out.println(user.get("givenName") + " " + user.get("familyName"));
            }
        }
    }
}

RosterServer: Go

 

Setup

Insert the OneRoster folder into your project.

Usage

First, import the OneRoster package.

import ("../OneRoster")

Next, create a new instance of the OneRoster object, which takes in two strings,
the client_id and client_secret.

oneRoster := OneRoster.New("XXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXX");

You are now able to make requests to a specified URL. This is done using the method MakeRosterRequest(url), which takes in the URL and returns the status code and response.

oneRoster := OneRoster.New("XXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXX");
statusCode: response := oneRoster.MakeRosterRequest("https://example.com/users");

statusCode is an int containing the status code and response is a string with the JSON response.

fmt.Println(statusCode)  // The status code
fmt.Println(response)  // The JSON Response

Example

Example

Print all students' names

package main

// Import OneRoster
import (
	"encoding/json"
	"fmt"
	"../OneRoster"
)

type User struct {
	GivenName string
	FamilyName string
}

type UserResponse struct {
	Users []User
}

func getUsers(url string) []User {
	// Create new OneRoster with the client_id and client_secret
	oneRoster := OneRoster.New("XXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXX");

	// Make the request to the given url and store the status code and response
	statusCode, response := oneRoster.MakeRosterRequest(url)
	b := []byte(response)

	// If status_code is 200, create array of users from response, otherwise print message and return nil
	if statusCode == 200 {
	
		var userResponse = new(UserResponse)
		json.Unmarshal(b, &userResponse)
		return userResponse.Users
	}
	if statusCode == 401 {
		fmt.Println("Unauthorized Request\n" + response)
	} else if statusCode == 404 {
		fmt.Println("Not found\n" + response)
	} else if statusCode == 500 {
		fmt.Println("Server Error\n" + response)
	} else  {
		fmt.Println("Something Went Wrong, status code " + fmt.Sprint(statusCode) + "\n" + response)
	}

	return nil
}

// Print the users if not nil
func main() {
	users := getUsers("https://example.com/users?fields=givenName%2CfamilyName&filter=role%3D'student'")
	if users != nil {
		for _, user := range users {
			fmt.Println(user.GivenName + " " + user.FamilyName)
		}
	}
}

RosterServer: Ruby

 

Setup

Insert the file OneRoster.rb into your project;

Usage

First import OneRoster.

require './OneRoster.rb'

Next, create a new instance of the OneRoster object, which takes in two strings,
the client_id and client_secret.

oneRoster = OneRoster.new("XXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXX");

You are now able to make requests to a specified URL. This is done using the method make_roster_request(url), which takes in the URL and returns a Hash containing the status code and response.

oneRoster = OneRoster.new("XXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXX");
response = oneRoster.make_roster_request("https://example.com/users");

The response is made up of "status_code", which contains the status code, and "response", which contains the JSON response as a string.

puts response["status_code"]  # The status code
puts response["response"] # The JSON Response

Example

Example

Print all students' names

require 'json'

# Import OneRoster
require './OneRoster.rb'
if __FILE__ == $0

    def get_users(url)
      # Create new OneRoster with the client_id and client_secret
      oneRoster = OneRoster.new("XXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXX");

        # Make the request to the given url and store the Hash with status_code and response
      response = oneRoster.make_roster_request(url)
        
        # Decode the response
        decoded = JSON.parse(response["response"])
        
        # If status_code is 200, create array of users from response, otherwise print message and return nil
        case response["status_code"]
        when 200
            return decoded["users"]
        when 401
            puts "Unauthorized Request\n" + response["response"]
        when 404
            puts "Not Found\n" + response["response"]
        when 500
            puts "Server Error\n" + response["response"]
        else
            puts "Something Went Wrong, status code " + response["status_code]" + "\n" + response["response"]
        end
        return nil;
    end
    
    users = get_users("https://example.com/users?fields=givenName%2CfamilyName&filter=role%3D'student'")

    # Print users if not nill
    if users != nil
        users.each do |user|
            puts user["givenName"] + " " + user["familyName"]
        end
    end
end

OneClick: .NET

 

GitHub and DLL Download Links

Setup

Insert OneClick.cs into your project.

Or

Create a reference to the DLL in your project. To do this in Visual Studio 2017, right click Dependencies -> Add References -> Browse -> Select DLL -> Add.

Usage

First import OneClick if you're using a DLL.

using ClassLink_OneClick.OneClick;

Next, you need to create a new instance of OneClick with the client_key and client_secret.

OneClick oc = new OneClick("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

Generate Bearer Token

getCodeUrl(scope, redirectUri)

Following that, you will need to generate the url for you to sign in and retrieve your code, which will be used to get the access token. This is done with the method getCodeUrl(scope, redirectUri).

The scope can be:

  • profile - Access to user identiy and user specific information
  • oneroster - Access to oneroster info and classes
  • full - Access to all public apis

Scope will be defaulted to profile not included in method call.

The redirectUri is the url that you will be redirected to upon login. It defaults to https://localhost:8080/code.

You can use curl or get the code from the url bar after signing in.

OneClick oc = new OneClick("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
// Prints the url for the code
Console.WriteLine(oc.getCodeUrl("full"));

getToken(code)

After getting the code from the url, you need to generate the bearer token that will be used for all the requests. This will be generated using the getToken(code) method.

// Uses the code received after signing in and returns the bearer token 
Console.WriteLine(oc.getToken("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));

Accessing the Endpoints

Now that you have your bearer token, you can access the endpoints. This can be done through a number of methods. The first method, getInfo, allows the user to specify what endpoint they want to hit and what field to return. The rest of the methods will make requests to specific endpoints for specific information.

getInfo(bearer, endpoint, extractNode)

The main method used to make a request to an endpoint is get_info(bearer, endpoint, extractNode). It takes in the bearer token, the url of the endpoint (excluding the hostname), and an optional extractNode, which will return this specific field if is not passed as an empty string.
It will return the info as a JSON response in a string.

// Prints the JSON response from the request to the endpoint
Console.WriteLine(oc.getInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "/path/info", ""));

getUserInfo(bearer)

This method will take in the bearer token and return a JSON containing all of the available user info

// Prints user info as JSON
Console.WriteLine(oc.getUserInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

getUserDistrict(bearer)

This method will get the district associated with the user

// Prints the district as JSON
Console.WriteLine(oc.getUserDistrict("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));

getUserProfiles(bearer)

This method will get info on the user's profiles.

// Prints info on the user's profiles as JSON
Console.WriteLine(oc.getUserProfiles("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));

getUserChildren(bearer)

If the user is a parent registered for ClassLink, this will return a list of linked student accounts (their children)

// Prints children info
Console.WriteLine(oc.getUserChildren("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));

getUserGroups(bearer)

Get a list of all groups that the user is a part of

// Prints a list of all groups that the user is a part of
Console.WriteLine(oc.getUserGroups("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));

getUserOneRosterInfo(bearer)

Get all the OneRoster info about the user
Note: Only available for districts with OneRoster enabled.

// Print the oneroster info about the User
Console.WriteLine(oc.getUserOneRosterInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));

getUserOneRosterClasses(bearer)

Get all the OneRoster classes the user is enrolled in.
Note: Only available for districts with OneRoster enabled.
Info

// Print the oneroster info about user's classes
Console.WriteLine(oc.getUserOneRosterClasses("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));

getUserOneRosterClassTeachers(bearer, classSourcedId)

Get info on the teacher of the class represented by the unique sourcedId.
Note: Only available for districts with OneRoster enabled.
Info

// Print the oneroster info on the teacher of the class
Console.WriteLine(oc.getUserOneRosterClassTeachers("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "sourcedId"));

getUserOneRosterClassStudents(bearer, classSourcedId)

Get info on the students of the class represented by the unique sourcedId.
Note: Only available for districts with OneRoster enabled.
Info

// Print the oneroster info the students of the class
Console.WriteLine(getUserOneRosterClassStudents("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "sourcedId"));

OneClick: Python

 

Setup

Insert OneClick.py into your project.

Usage

First, import OneClick.

import OneClick

Next, you need to create a OneClick and set the info in OneClick with setConfig(client_key and client_secret).

oc = OneClick()
oc.setConfig("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")

Generate Bearer Token

getCodeUrl(scope, redirectURI)

Following that, you will need to generate the url for you to sign in and retrieve your code, which will be used to get the access token. This is done with the method getCodeUrl(scope, redirectURI).

The scope can be:

  • profile - Access to user identiy and user specific information
  • oneroster - Access to oneroster info and classes
  • full - Access to all public apis

Scope will be defaulted to profile if not included.

The redirectURI is the url that you will be redirected to upon login. It defaults to https://localhost:8080/code.

You can use curl or get the code from the url bar after signing in.

oc.setConfig("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
# Prints the url for the code
print(oc.getCodeUrl("full"))

getToken(code)

After getting the code from the url, you need to generate the bearer token that will be used for all the requests. This will be generated using the getToken(code) method.

# Uses the code received after signing in and returns the bearer token 
print(oc.getToken("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))

Accessing the Endpoints

Now that you have your bearer token, you can access the endpoints. This can be done through a number of methods. The first method, getInfo(bearer, endpoint, extractNode), allows the user to specify what endpoint they want to hit and what field to return. The rest of the methods will make requests to specific endpoints for specific information.

getInfo(bearer, endpoint, extractNode)

The main method used to make a request to an endpoint is getInfo(bearer, endpoint, extractNode). It takes in the bearer token, the url of the endpoint (excluding the hostname), and an optional extractNode, which will return this specific field if is included in the method call.
It will return the info as a JSON response in a string.

# Prints the JSON response from the request to the endpoint
print(oc.getInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "/path/info", ""))

getUserInfo(bearer)

This method will take in the bearer token and return a JSON containing all of the available user info

# Prints user info as JSON
print(oc.getUserInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))

getUserDistrict(bearer)

This method will get the district associated with the user

# Prints the district as JSON
print(oc.getUserDisctrict("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))

getUserProfiles(bearer)

This method will get info on the user's profiles.

# Prints info on the user's profiles as JSON
print(oc.getUserProfiles("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))

getUserChildren(bearer)

If the user is a parent registered for ClassLink, this will return a list of linked student accounts (their children)

# Prints children info
print(oc.getUserChildren("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))

getUserGroups(bearer)

Get a list of all groups that the user is a part of

# Prints a list of all groups that the user is a part of
print(oc.getUserGroups("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))

getUserOneRosterInfo(bearer)

Get all the OneRoster info about the user
Note: Only available for districts with OneRoster enabled.

# Print the oneroster info about the User
print(oc.getUserOneRosterInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))

getUserOneRosterClasses(bearer)

Get all the OneRoster classes the user is enrolled in.
Note: Only available for districts with OneRoster enabled.
Info

# Print the oneroster info about user's classes
print(oc.getUserOneRosterClasses("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))

getUserOneRosterClassTeachers(bearer, classSourcedId)

Get info on the teacher of the class represented by the unique sourcedId.
Note: Only available for districts with OneRoster enabled.
Info

# Print the oneroster info on the teacher of the class
print(oc.getUserOneRosterClassTeachers("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "sourcedId"))

getUserOneRosterClassStudents(bearer, classSourcedId)

Get info on the students of the class represented by the unique sourcedId.
Note: Only available for districts with OneRoster enabled.
Info

# Print the oneroster info the students of the class
print(oc.getUserOneRosterClassStudents("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "sourcedId"))

OneClick: Node

 

Setup

Insert OneClick.js with the package.json into your project and run "npm install" from the command line.

npm install

Usage

First, import index.js.

const OneClick = require('./index.js');

Next, you need to create a new instance of OneClick with the client_key and client_secret.

OneClick.setConfig({
  clientId: "cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 	    
  clientSecret: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
});

Generate Bearer Token

getCodeURL(scope, redirectUri, cb)

Following that, you will need to generate the url for you to sign in and retrieve your code, which will be used to get the access token. This is done with the method GetCodeURL(scope, redirectUri, cb).

The scope can be:

  • profile - Access to user identiy and user specific information
  • oneroster - Access to oneroster info and classes
  • full - Access to all public apis

Scope will be defaulted to profile if not included.

The redirectUri is the url that you will be redirected to upon login. It defaults to https://localhost:8080/code.

The callback will take in error and the url.

You can use curl or get the code from the url bar after signing in.

// Prints the url for the code
OneClick.getCodeUrl("full", function(error, url) {
 if (error) throw new Error(error);
 console.log(url); 
});

getToken(code, cb)

After getting the code from the url, you need to generate the bearer token that will be used for all the requests. This will be generated using the getToken(code, cb) method.

// Uses the code received after signing in and returns the bearer token 
OneClick.getToken("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", function(error, token) {
  if (error) throw new Error(error);
	console.log(token);
});

Accessing the Endpoints

Now that you have your bearer token, you can access the endpoints. This can be done through a number of methods. The first method, getInfo(bearer, endpoint, extractNode, cb), allows the user to specify what endpoint they want to hit and what field to return. The rest of the methods will make requests to specific endpoints for specific information.

getInfo(bearer, endpoint, extractNode, cb)

The main method used to make a request to an endpoint is getInfo(bearer, endpoint, extractNode, cb). It takes in the bearer token, the url of the endpoint (excluding the hostname), and an optional extractNode, which will return this specific field if is included in the method call.
The callback will take in an error and the JSON response.

// Prints the JSON response from the request to the endpoint
OneClick.getInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "/path/info", function(error, data) {
  if (error) throw new Error(error);
  console.log(data);
});

getUserInfo(bearer, cb)

This method will take in the bearer token and return a JSON containing all of the available user info

// Prints user info as JSON
OneClick.getUserInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", function(error, data) {
  if (error) throw new Error(error);
  console.log(data);
});

getUserDistrict(bearer, cb)

This method will get the district associated with the user

// Prints the district as JSON
OneClick.getUserDistrict("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", function(error, data) {
  if (error) throw new Error(error);
  console.log(data);
});

getUserProfiles(bearer, cb)

This method will get info on the user's profiles.

// Prints info on the user's profiles as JSON
OneClick.getUserProfiles("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", function(error, data) {
  if (error) throw new Error(error);
  console.log(data);
});

getUserChildren(bearer, cb)

If theuser is a parent registered for ClassLink, this will return a list of linked student accounts (their children)

// Prints children info
OneClick.getUserChildren("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", function(error, data) {
  if (error) throw new Error(error);
  console.log(data);
});

getUserGroups(bearer, cb)

Get a list of all groups that the user is a part of

// Prints a list of all groups that the user is a part of
OneClick.getUserGroups("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", function(error, data) {
  if (error) throw new Error(error);
  console.log(data);
});

getUserOneRosterInfo(bearer, cb)

Get all the OneRoster info about the user
Note: Only available for districts with OneRoster enabled.

// Print the oneroster info about the User
OneClick.getUserOneRosterInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", function(error, data) {
  if (error) throw new Error(error);
  console.log(data);
});

getUserOneRosterClasses(bearer, cb)

Get all the OneRoster classes the user is enrolled in.
Note: Only available for districts with OneRoster enabled.
Info

// Print the oneroster info about user's classes
OneClick.getUserOneRosterClasses("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", function(error, data) {
  if (error) throw new Error(error);
  console.log(data);
});

getUserOneRosterClassTeachers(bearer, classSourcedId, cb)

Get info on the teacher of the class represented by the unique sourcedId.
Note: Only available for districts with OneRoster enabled.
Info

// Print the oneroster info on the teacher of the class
OneClick.getUserOneRosterClassTeachers("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "classSourcedId", function(error, data) {
  if (error) throw new Error(error);
  console.log(data);
});

getUserOneRosterClassStudents(bearer, classSourcedId, cb)

Get info on the students of the class represented by the unique sourcedId.
Note: Only available for districts with OneRoster enabled.
Info

// Print the oneroster info the students of the class
OneClick.getUserOneRosterClassStudents("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "classSourcedId", function(error, data) {
  if (error) throw new Error(error);
  console.log(data);
});

OneClick: PHP

 

Setup

Insert OneClick.php into your project.
NOTE: OneClick.php uses cURL, which may require setup on Windows.

Usage

First import OneClick.

include('OneClick.php');

Next, you need to create a new instance of OneClick with the client_key and client_secret.

$oc = new OneClick("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

Generate Bearer Token

getCodeUrl($scope, $redirectUri)

Following that, you will need to generate the url for you to sign in and retrieve your code, which will be used to get the access token. This is done with the method getCodeUrl($scope, $redirectUri).

The scope can be:

  • profile - Access to user identiy and user specific information
  • oneroster - Access to oneroster info and classes
  • full - Access to all public apis

Scope will be defaulted to profile not included in method call.

The redirectUri is the url that you will be redirected to upon login. It defaults to https://localhost:8080/code.

You can use curl or get the code from the url bar after signing in.

$oc = new OneClick("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
// Prints the url for the code
echo $oc->getCodeUrl("full");

getToken($code)

After getting the code from the url, you need to generate the bearer token that will be used for all the requests. This will be generated using the getToken($code) method.

// Uses the code received after signing in and returns the bearer token 
echo $oc->getToken("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

Accessing the Endpoints

Now that you have your bearer token, you can access the endpoints. This can be done through a number of methods. The first method, getInfo($bearer, $endpoint, $extractNode), allows the user to specify what endpoint they want to hit and what field to return. The rest of the methods will make requests to specific endpoints for specific information.

getInfo($bearer, $endpoint, $extractNode)

The main method used to make a request to an endpoint is getInfo($bearer, $endpoint, $extractNode). It takes in the bearer token, the url of the endpoint (excluding the hostname), and an optional extractNode, which will return this specific field if is not passed as an empty string.
It will return the info as a JSON response in a string.

// Prints the JSON response from the request to the endpoint
echo $oc->getInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "/path/info", "");

getUserInfo($bearer)

This method will take in the bearer token and return a JSON containing all of the available user info

// Prints user info as JSON
echo $oc->getUserInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

getUserDistrict(bearer)

This method will get the district associated with the user

// Prints the district as JSON
echo $oc->getUserDistrict("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

getUserProfiles($bearer)

This method will get info on the user's profiles.

// Prints info on the user's profiles as JSON
echo $oc->getUserProfiles("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

getUserChildren($bearer)

If the user is a parent registered for ClassLink, this will return a list of linked student accounts (their children)

// Prints children info
echo $oc->getUserChildren("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

getUserGroups($bearer)

Get a list of all groups that the user is a part of

// Prints a list of all groups that the user is a part of
echo $oc->getUserGroups("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

getUserOneRosterInfo($bearer)

Get all the OneRoster info about the user
Note: Only available for districts with OneRoster enabled.

// Print the oneroster info about the User
echo $oc->getUserOneRosterInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

getUserOneRosterClasses($bearer)

Get all the OneRoster classes the user is enrolled in.
Note: Only available for districts with OneRoster enabled.
Info

// Print the oneroster info about user's classes
echo $oc->getUserOneRosterClasses("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

getUserOneRosterClassTeachers($bearer, $classSourcedId)

Get info on the teacher of the class represented by the unique sourcedId.
Note: Only available for districts with OneRoster enabled.
Info

// Print the oneroster info on the teacher of the class
echo $oc->getUserOneRosterClassTeachers("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "sourcedId");

getUserOneRosterClassStudents($bearer, $classSourcedId)

Get info on the students of the class represented by the unique sourcedId.
Note: Only available for districts with OneRoster enabled.
Info

// Print the oneroster info the students of the class
echo $oc->getUserOneRosterClassStudents("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "sourcedId");

OneClick: Java

 

Setup

Insert OneClick.java into your project.

Or

Create a JAR file to import into your project

Generate your JAR by running the following command in the same directory as OneClick.java.

javac -d ./build OneClick.java

Then go to the build folder and run the following.

jar cvf OneClick.jar *

To import a JAR file into your project in IntelliJ, click File -> Project Structure -> Libraries -> Click the plus sign -> Select the JAR File.

Usage

First import OneClick.

import OneClick;

Next, you need to create a new instance of OneClick with the client_key and client_secret.

OneClick oc = new OneClick("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

Generate Bearer Token

getCodeUrl(scope, redirectUri)

Following that, you will need to generate the url for you to sign in and retrieve your code, which will be used to get the access token. This is done with the method getCodeUrl(scope, redirectUri).

The scope can be:

  • profile - Access to user identiy and user specific information
  • oneroster - Access to oneroster info and classes
  • full - Access to all public apis

Scope will be defaulted to profile not included in method call.

The redirectUri is the url that you will be redirected to upon login. It defaults to https://localhost:8080/code.

You can use curl or get the code from the url bar after signing in.

OneClick oc = new OneClick("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
// Prints the url for the code
System.out.println(oc.getCodeUrl("full"));

getToken(code)

After getting the code from the url, you need to generate the bearer token that will be used for all the requests. This will be generated using the getToken(code) method.

// Uses the code received after signing in and returns the bearer token 
System.out.println(oc.getToken("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));

Accessing the Endpoints

Now that you have your bearer token, you can access the endpoints. This can be done through a number of methods. The first method, getInfo(bearer, endpoint, extractNode), allows the user to specify what endpoint they want to hit and what field to return. The rest of the methods will make requests to specific endpoints for specific information.

getInfo(bearer, endpoint, extractNode)

The main method used to make a request to an endpoint is get_info(bearer, endpoint, extractNode). It takes in the bearer token, the url of the endpoint (excluding the hostname), and an optional extractNode, which will return this specific field if is not passed as an empty string.
It will return the info as a JSON response in a string.

// Prints the JSON response from the request to the endpoint
System.out.println(oc.getInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "/path/info", ""));

getUserInfo(bearer)

This method will take in the bearer token and return a JSON containing all of the available user info

// Prints user info as JSON
System.out.println(oc.getUserInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

getUserDistrict(bearer)

This method will get the district associated with the user

// Prints the district as JSON
System.out.println(oc.getUserDistrict("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));

getUserProfiles(bearer)

This method will get info on the user's profiles.

// Prints info on the user's profiles as JSON
System.out.println(oc.getUserProfiles("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));

getUserChildren(bearer)

If the user is a parent registered for ClassLink, this will return a list of linked student accounts (their children)

// Prints children info
System.out.println(oc.getUserChildren("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));

getUserGroups(bearer)

Get a list of all groups that the user is a part of

// Prints a list of all groups that the user is a part of
System.out.println(oc.getUserGroups("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));

getUserOneRosterInfo(bearer)

Get all the OneRoster info about the user
Note: Only available for districts with OneRoster enabled.

// Print the oneroster info about the User
System.out.println(oc.getUserOneRosterInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));

getUserOneRosterClasses(bearer)

Get all the OneRoster classes the user is enrolled in.
Note: Only available for districts with OneRoster enabled.
Info

// Print the oneroster info about user's classes
System.out.println(oc.getUserOneRosterClasses("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));

getUserOneRosterClassTeachers(bearer, sourcedId)

Get info on the teacher of the class represented by the unique sourcedId.
Note: Only available for districts with OneRoster enabled.
Info

// Print the oneroster info on the teacher of the class
System.out.println(oc.getUserOneRosterClassTeachers("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "sourcedId"));

getUserOneRosterClassStudents(bearer, sourcedId)

Get info on the students of the class represented by the unique sourcedId.
Note: Only available for districts with OneRoster enabled.
Info

// Print the oneroster info the students of the class
System.out.println(getUserOneRosterClassStudents("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "sourcedId"));

OneClick: Go

 

Setup

Insert the OneClick folder into your project.

Usage

First, import the OneClick package.

import (
  "../OneClick"
)

Next, you need to create a new instance of OneClick with the client_key and client_secret.

oc := OneClick.New("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")

Generate Bearer Token

GetCodeUrl(scope, redirectUri)

Following that, you will need to generate the url for you to sign in and retrieve your code, which will be used to get the access token. This is done with the method GetCodeUrl(scope, redirectUri).

The scope can be:

  • profile - Access to user identiy and user specific information
  • oneroster - Access to oneroster info and classes
  • full - Access to all public apis

Scope will be defaulted to profile if passed in an empty string.

The redirectUri is the url that you will be redirected to upon login. It defaults to https://localhost:8080/code.

You can use curl or get the code from the url bar after signing in.

oc := OneClick.New("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
// Prints the url for the code
fmt.Println(oc.GetCodeUrl("full", ""))

GetToken(code)

After getting the code from the url, you need to generate the bearer token that will be used for all the requests. This will be generated using the GetToken(code) method.

// Uses the code received after signing in and returns the bearer token 
fmt.Println(oc.GetToken("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))

Accessing the Endpoints

Now that you have your bearer token, you can access the endpoints. This can be done through a number of methods. The first method, GetInfo(bearer, endpoint, extractNode), allows the user to specify what endpoint they want to hit and what field to return. The rest of the methods will make requests to specific endpoints for specific information.

GetInfo(bearer, endpoint, extractNode)

The main method used to make a request to an endpoint is GetInfo(bearer, endpoint, extractNode). It takes in the bearer token, the url of the endpoint (excluding the hostname), and an optional extractNode, which will return this specific field if is included in the method call.
It will return the info as a JSON response in a string.

// Prints the JSON response from the request to the endpoint
fmt.Println(oc.GetInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "/path/info", ""))

GetUserInfo(bearer)

This method will take in the bearer token and return a JSON containing all of the available user info

// Prints user info as JSON
fmt.Println(oc.GetUserInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))

GetUserDistrict(bearer)

This method will get the district associated with the user

// Prints the district as JSON
fmt.Println(oc.GetUserDisctrict("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))

GetUserProfiles(bearer)

This method will get info on the user's profiles.

// Prints info on the user's profiles as JSON
fmt.Println(oc.GetUserProfiles("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))

GetUserChildren(bearer)

If the user is a parent registered for ClassLink, this will return a list of linked student accounts (their children)

// Prints children info
fmt.Println(oc.GetUserChildren("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))

GetUserGroups(bearer)

Get a list of all groups that the user is a part of

// Prints a list of all groups that the user is a part of
fmt.Println(oc.GetUserGroups("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))

GetUserOneRosterInfo(bearer)

Get all the OneRoster info about the user
Note: Only available for districts with OneRoster enabled.

// Print the oneroster info about the User
fmt.Println(oc.GetUserOneRosterInfo("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))

GetUserOneRosterClasses(bearer)

Get all the OneRoster classes the user is enrolled in.
Note: Only available for districts with OneRoster enabled.
Info

// Print the oneroster info about user's classes
fmt.Println(oc.GetUserOneRosterClasses("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))

GetUserOneRosterClassTeachers(bearer, sourcedId)

Get info on the teacher of the class represented by the unique sourcedId.
Note: Only available for districts with OneRoster enabled.
Info

// Print the oneroster info on the teacher of the class
fmt.Println(oc.GetUserOneRosterClassTeachers("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "sourcedId"))

GetUserOneRosterClassStudents(bearer, sourcedId)

Get info on the students of the class represented by the unique sourcedId.
Note: Only available for districts with OneRoster enabled.
Info

// Print the oneroster info the students of the class
fmt.Println(oc.GetUserOneRosterClassStudents("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "sourcedId"))

OneClick: Ruby

 

Setup

Insert OneClick.rb into your project.

Usage

First, import OneClick.rb

require './OneClick.rb'

Next, you need to create a new instance of OneClick with the client_key and client_secret.

oc = OneClick.new("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")

Generate Bearer Token

get_code_url(scope, redirect_uri)

Following that, you will need to generate the url for you to sign in and retrieve your code, which will be used to get the access token. This is done with the method get_code_url(scope, redirect_uri).

The scope can be:

  • profile - Access to user identiy and user specific information
  • oneroster - Access to oneroster info and classes
  • full - Access to all public apis

Scope will be defaulted to profile not included in method call.

The redirect_uri is the url that you will be redirected to upon login. It defaults to https://localhost:8080/code.

You can use curl or get the code from the url bar after signing in.

oc = OneClick.new("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
# Prints the url for the code
puts oc.get_code_url("full")

get_token(code)

After getting the code from the url, you need to generate the bearer token that will be used for all the requests. This will be generated using the get_token(code) method.

# Uses the code received after signing in and returns the bearer token 
puts oc.get_token("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")

Accessing the Endpoints

Now that you have your bearer token, you can access the endpoints. This can be done through a number of methods. The first method, get_info(bearer, endpoint,extract_node), allows the user to specify what endpoint they want to hit and what field to return. The rest of the methods will make requests to specific endpoints for specific information.

get_info(bearer, endpoint, extract_node)

The main method used to make a request to an endpoint is get_info(bearer, endpoint, extract_node). It takes in the bearer token, the url of the endpoint (excluding the hostname), and an optional extract_node, which will return this specific field if is not passed as an empty string.
It will return the info as a JSON response in a string.

# Prints the JSON response from the request to the endpoint
puts oc.get_info("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "/path/info", "")

get_user_info(bearer)

This method will take in the bearer token and return a JSON containing all of the available user info

# Prints user info as JSON
puts oc.get_user_info("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")

get_user_district(bearer)

This method will get the district associated with the user

# Prints the district as JSON
puts oc.get_user_disctrict("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")

get_user_profiles(bearer)

This method will get info on the user's profiles.

# Prints info on the user's profiles as JSON
puts oc.get_user_profiles("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")

get_user_children(bearer)

If the user is a parent registered for ClassLink, this will return a list of linked student accounts (their children)

# Prints children info
puts oc.get_user_children("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")

get_user_groups(bearer)

Get a list of all groups that the user is a part of

# Prints a list of all groups that the user is a part of
puts oc.get_user_groups("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")

get_user_one_roster_info(bearer)

Get all the OneRoster info about the user
Note: Only available for districts with OneRoster enabled.

# Print the oneroster info about the User
puts oc.get_user_one_roster_info("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")

get_user_one_roster_classes(bearer)

Get all the OneRoster classes the user is enrolled in.
Note: Only available for districts with OneRoster enabled.
Info

# Print the oneroster info about user's classes
puts oc.get_user_one_roster_classes("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")

get_user_one_roster_class_teachers(bearer, class_sourced_id)

Get info on the teacher of the class represented by the unique sourcedId.
Note: Only available for districts with OneRoster enabled.
Info

# Print the oneroster info on the teacher of the class
puts oc.get_user_one_roster_class_teachers("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "sourcedId")

get_user_one_roster_class_students(bearer, class_sourced_id)

Get info on the students of the class represented by the unique sourcedId.
Note: Only available for districts with OneRoster enabled.
Info

# Print the oneroster info the students of the class
puts oc.get_user_one_roster_class_students("cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "sourcedId")