Skip to main content

Enrollment API via Postman

Prerequisites

Before using this collection, follow the steps from Setting Up Postman.

Using the Collection

Select an Environment

In the top right corner, select an environment from the imported ones:

Select an Environment

Click on the "Environments" tab and click on the Checkbox for the desired environment:

Select an Environment

Authorization

In order to authenticate, an environment must be selected. The environment files includes a Key and Secret value for testing purposes.

In the "Collections" tab, click on the Ed-Fi Roster root folder, when the folder opens, select the "Authorization" tab.

Authorization

Scroll down and click Get New Access Token.

Get New Access Token

The following confirmation message will appear:

Configuration Message

Click on Use Token:

Use Token

The token is ready to be used.

This token expires, therefore, this process must be repeated each time the token has expired.

All API calls inherit from this authorization token.

Execute the API Calls

There are two types of API calls, independent and dependent calls.

Independent API calls

These API calls can be executed directly once the token is generated, because it does not depend on any value to be executed.

To execute any of these API calls, select the call and click on Send. There's no modification needed, and if so, it means there's an error with the Authentication Token (in which case, it is better to follow the Authorization steps again).

Send

After the request is done, the status 200 OK must appear and the Response body must be visible.

Send

Dependent API calls

These API calls require a value in a variable in order to be executed. Those appear with the preposition 'by' in the API calls

Dependent API calls

There are two ways to get the variables needed for these API calls, this will be exemplified using the 'Schools by LEA' API call:

Copy and enter the ID required in the environment variables

Execute the "Local Education Agencies" API call

Local Education Agencies

Copy the first ID in the result.

Go to the "Environments" tab and paste the copied value in the "Current Value" field for the lea_id variable:

Copy and enter the ID required in the environment variables

Return to the Collection and execute the API call 'Schools by LEA'. Status 200 OK should appear and the Response body must be visible

Send

Here, The lea_id variable is replaced with the value set.

If no value is set, the following error will appear:

Send

Execute an API call that automatically sets the required variable

The API calls that are located under the "Enrollment Composite" folder that have the name "All" in it, will automatically set the value for the corresponding variable by setting the first result returned by the call.

For example, if you want to execute the 'Schools by LEA' API call, you can execute the 'All Local Education Agencies' API call first and that way the LEA variable will be automatically set and ready to use.

Animation

API RequestRequest to set the variable
by LEA"All Local Education Agencies"
by School"All Schools"
by Staff"All Staff"
by Section"All Sections"

Getting Code Samples

Postman provides built in code samples for multiple programming languages per API request.

To get these code samples:

Open an API request and verify it's valid:

Verify the API request is valid

Click on the Code button on the right side menu Code

Code

Select your programming language of choice in the dropdown and copy the code:

Select your programming language of choice

Code Samples

note

In order to run the samples, get a new Access Token and place it after the Bearer

import requests

url = "https://api.ed-fi.org/v6.2/api/data/v3/ed-fi/staffs"

payload={}
headers = {
'Authorization': 'Bearer {{YourToken}}'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Demo

Using Python