Ed-Fi API Client Developer Postman Example

Description:
The purpose of this example is to illustrate how the relationship based authorization strategy can cause errors. This example uses a student resource as the example.

Directions:
  Environment and Collection Setup:
	1. unzip the files to a location on your computer. 
	2. Ensure that Postman version 6.1.3 or later.
	3. Import the environment from the Ed-Fi API Client Developer Example.postman_environment.json file.
	4. import the collection from the Ed-Fi API Client Developer Example.postman_collection.json file.
  
  Getting a new access token:
	The operations in this example inherits the authorization from the collection. You must configure the Collection Authorization and then get a new token to execute the operations correctly.
	1. Go to the edit collection modal
	2. Select the Authorization tab
	3. Ensure the "TYPE" is set to 'OAuth2'
	4. Ensure that the "Add auth data to" is set to 'Request Headers'
	5. Click the "Get New Access Token" button
	6. Set "Token Name" to 'Bearer'
	7. Set "Grant Type" to 'Client Credentials'
	8. Set "Access Token URL" to '{{AuthURL}}'
	9. Set "Client ID" to '{{ClientId}}'
	10. Set "Client Secret" to '{{ClientSecret}}'
	11. "Scope" should be blank
	12. Set "Client Authentication" to 'Send as Basic Auth header'
	13. Click "Request Token"
	14. Upon successfully getting a new token, the token will be displayed, click on the "Use Token" button
	15. Click "Update" on the collection edit modal

  Executing the operations:	
	There are descriptions on the collection and on each operation that explains what the purpose of the step is. 

	1. Get localEducationAgencies - This step is just to show what LEAs are available to the key and secret provided
	2. Post Student - This step uses a Postman pre request script to create a random student unique id and use it in the 
	   body of the post for the student. Every time this is executed a new id will be genreated and a new student will be created
	3. Get Students (Fail Condition) - This step shows that although the student wwas successfully created in the previous step,
	   you are not able to retrieve the student. This is because a relationship has not been established between the student and the 
	   LEA that the key and secret used has access to.
	4. Get schools - This step is just to return a list of schools that the used key and secret have access to. For the purposes of this 
	   example we will use Grandbend High School. Notice the school has a LEA reference.
	5. Post studentSchoolAssociations - This step will Post and enrollment record enrolling the newly created student into Grandbend High school
	   and establishing the relationship between the student and the LEA via the school
	6. Get students (success condition) - this step shows that now that the relationship was established between the student and the LEA,
	   the student information is now returned in the response.
	   
	   

	
