Connect to API

dhust
Padawan

Connect to API

Hi. What steps do local administrators of PS in a district need to do to setup API access? I've talked with someone in my district but they don't seem like they know. Thank you.

9 Replies
BlayneC
Hobbyist

What kind of API access are you looking for?
Is this a 3rd party app?  If so, it may have a plugin that can be loaded in PowerSchool that will then provide API access after obtaining a ClientID and Secret.
If you are looking to develop your own software that uses an API to get data from PowerSchool, then you will need to create your own plugin (usually a simple xml file to start with).

dhust
Padawan

  • Looking to grab student classes, grades, and similar info.
  • This is not a 3rd party app.
  • I'll be developing the app
    • I'm pretty sure I would need more than an XML file. I think I need an API key and such. 
    • Also looking for API endpoints to connect to. Not sure where that info is.
mbezaire
Practitioner

You want to navigate to your district's schoology link with "/api" tacked on to find your api key and secret.  Ex:  mydistrictlms.schoology.com/api

 

Then, look at https://developers.schoology.com/api-documentation/rest-api-v1/ for endpoints

dhust
Padawan

I'm not using Schoology. I just want to create something myself using PS's API.

BlayneC
Hobbyist

I replied down below in this discussion. Wanted you to know you have a reply to your post that you want to build something yourself using APIs from PowerSchool.

mbezaire
Practitioner

For PowerSchool generally I think you would need to work with a PowerSchool contact within your district to get access to PowerSource and then log into there and visit https://support.powerschool.com/developer

BlayneC
Hobbyist

The PowerSchool documents are not very good for figuring things out on your own.  Here is a good starting point that will hopefully get you headed in the right direction.  Or, at least get it so you can start getting some data out via API.

 

1 - You need an xml file to load in as a Plugin for PowerSchool. See the attached SamplePlugin.xml file (I had to rename it with a .txt extension because it would not accept an .xml file).  The plugin file is super simple but critical for you to access data via API. Think of the Plugin as creating the API in PowerSchool.

2. Go to "Plugin Management Dashboard" and install this xml file.  This creates the endpoint for you to access data.  Make sure to mark it as Enabled.

3. Click on your new Plugin, and then click on "Data Provider Configuration".  This will give you the "Client ID" and "Client Secret" for accessing your API which is created by your Plugin.

 

You can now make API calls. Let's use Postman for example.  Here are the steps to get that setup.

1. You need to get a Bearer Token to be able to make API calls. Here is the POST statement for Postman to get your bearer token.

POST: https//yoursite.powerschool.com/oauth/access_token

In the "Authorization" tab set Username = Client ID. Set Password = Client Secret (from step 3 above)

In the Headers tab set "Content-Type" to "application/x-www-form-urlencoded;charset=UTF-8"

In the Body tab enter: "grant_type=client_credentials"

 

When you send this request you should get back a document that looks like this:

{
"access_token": "ce8815eb-b28f-40aa-bd9b-5f0a8dfa1813",
"token_type": "Bearer",
"expires_in": "1814654"
}

The Bearer Token will remain the same for about 30 days or until you click "Regenerate Client ID and Secret" in the Data Provider Configuration screen for your Plugin in PowerSchool.  In your application you can then save this token in the database or some other mechanism 

 

2. Now you can make an API call to get data for a single student.  Here is how you do that in Postman using a GET request.  I'm including a couple expansions and an extension to get more student data.  You can look at the PowerSchool API documents as a reference of how to get more expansion sets or extension sets of data. Oh, the student ID below of 123 is the DCID in the PowerSchool database.  Each student has 3 ID numbers: "Student Number" (the ID you are used to using for a student), Student "ID" (which is the PowerSchool assigned ID), and "DCID" (which is assigned by the Oracle Database).  The APIs usually use the DCID for accessing students. So, if the API call doesn't return a student, make sure you know the DCID of a student so you can retrieve that student's information.

 

GET: https://yoursite.powerschool.com/ws/v1/student/123?expansions=demographics,contact_info&extensions=s...

In the "Authorization" tab select "Bearer Token" and set "Token" to the "access token" you received in step 1 above.

In the "Headers" tab set these 2 values: "Content-Type" set to "application/json" and "Accept" set to "application/json".

 

You should get back a document that looks something like this:

"student": {
"@expansions": "demographics, addresses, alerts, phones, school_enrollment, ethnicity_race, contact, contact_info, initial_enrollment, schedule_setup, fees, lunch, counselors, global_id",
"@extensions": "c_studentlocator,s_stu_crosslea_x,u_ecollect_screening,u_ecollect_enroll,u_ecollect_essentials,s_stu_crdc_x,s_stu_x,activities,s_ut_stu_crdc_x,u_students_extension,s_stu_ncea_x,s_stu_edfi_x,s_ut_stu_x,studentcorefields",
"_extension_data": {
"_table_extension": {
"recordFound": true,
"_field": [
{
"name": "pscore_legal_gender",
"type": "String",
"value": "M"
},
{
"name": "homeless_code",
"type": "String",
"value": 0
},
{
"name": "pscore_legal_first_name",
"type": "String",
"value": "JAMES"
},
{
"name": "pscore_legal_middle_name",
"type": "String",
"value": "T"
},
{
"name": "pscore_legal_last_name",
"type": "String",
"value": "KIRK"
}
],
"name": "studentcorefields"
}
},
"id": 123,
"local_id": 900012345,
"state_province_id": 1234567,
"name": {
"first_name": "JAMES",
"middle_name": "T",
"last_name": "KIRK"
},
"demographics": {
"gender": "M",
"birth_date": "2005-03-01",
"district_entry_date": "2010-02-11",
"projected_graduation_year": 2023
},
"contact_info": {
"email": "studentEmail@gmail.com"
}
}
}

 

I hope that gets you started in the right direction to get data from PowerSchool APIs.

As you go along and want to get more customized data, you will create a more complex plugin that contains queries that run on the server-side to get the data you want.

There are a few projects in github that you can look at.  However, start with the above and get Postman working first.  This gives you the key components to at least get APIs working.  Then you can move on to exploring other things specific to what you want to do.

 

 

 

I had a problem attaching the SamplePlugin.xml file - even renaming it to .txt.  So, here it is inline:

 

<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://plugin.powerschool.pearson.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://plugin.powerschool.pearson.com plugin.xsd"
name="Your Plugin Name"
version="1.1"
description="Description of your Plugin for PowerSchool">
<oauth></oauth>
<access_request>
<field table="messagekeymap" field="languageisocode" access="ViewOnly" />

<field table="schools" field="high_grade" access="ViewOnly" />
<field table="schools" field="low_grade" access="ViewOnly" />
<field table="schools" field="school_number" access="ViewOnly" />

<field table="sections" field="dcid" access="ViewOnly" />

<field table="students" field="dcid" access="ViewOnly" />
<field table="students" field="first_name" access="ViewOnly" />
<field table="students" field="gender" access="ViewOnly" />
<field table="students" field="grade_level" access="ViewOnly" />
<field table="students" field="id" access="ViewOnly" />
<field table="students" field="last_name" access="ViewOnly" />
<field table="students" field="lastfirst" access="ViewOnly" />
<field table="students" field="student_number" access="ViewOnly" />
<field table="students" field="global_id" access="FullAccess" />
<field table="students" field="student_username" access="FullAccess" />
</access_request>
<publisher name="Your Name">
<contact email="your_email_address@gmail.com"/>
</publisher>
</plugin>

BlayneC
Hobbyist

When getting the Bearer Token using Postman, select "Basic Auth" in the Authorization tab - this gives you the "Username" and "Password" fields that you fill in with the Client ID and Client Secret from your plugin.

Forgot to mention that in my reply above.

eltontipa
Rookie

Setting up API access in PowerSchool typically involves a few steps, and local administrators in a district may need to follow specific procedures. Please note that the exact steps can vary based on the version of PowerSchool you are using and the specific configuration of your district's PowerSchool instance. Here's a general guide:

  1. Contact PowerSchool Support: The first step is to reach out to PowerSchool Support or your designated support contacts within your school district. They can provide guidance on the specific process for setting up API access and any prerequisites or permissions that may be required.

  2. Request API Access Credentials: PowerSchool API access is often controlled through API credentials, including an API key and potentially other authentication details. You may need to request these credentials from PowerSchool Support or your district's PowerSchool administrators.

  3. Verify Permissions: Ensure that your user account has the necessary permissions to access the PowerSchool API. PowerSchool typically allows administrators to define roles and permissions for users, so you may need appropriate access rights to work with the API.

  4. Review PowerSchool API Documentation: Familiarize yourself with the PowerSchool API documentation. The documentation provides details on available API endpoints, data formats, authentication methods, and usage guidelines. This information is crucial for integrating PowerSchool data into your applications.

  5. Test API Connectivity: Before implementing any production-level integrations, it's a good practice to test API connectivity. You can use tools like cURL or Postman to make test API requests and ensure that you can successfully retrieve or update data.

  6. Implement API Integration: Once you have the necessary credentials and have tested API connectivity, you can proceed with implementing the API integration into your applications or systems. This may involve making HTTP requests to PowerSchool API endpoints based on your specific use case.