|
| 1 | +# This file is intended for use with Admin API 2 running in multi-tenant mode, |
| 2 | +# along with ODS/API 7.x in multi-tenant mode. It assumes there are two |
| 3 | +# different tenants named "tenant1" and "tenant2". Each has only one ODS |
| 4 | +# instance. |
| 5 | + |
| 6 | +@adminapi_url=https://localhost:7214 |
| 7 | +# @adminapi_url=https://localhost/adminapi |
| 8 | + |
| 9 | +@adminapi_client=adminapi_client2 |
| 10 | +@adminapi_secret=adminapi_SECRET_2025_rftyguhijkotgyhuijok |
| 11 | + |
| 12 | +### Register a new client |
| 13 | +POST {{adminapi_url}}/connect/register |
| 14 | +Content-Type: application/x-www-form-urlencoded |
| 15 | +Tenant: tenant2 |
| 16 | + |
| 17 | +ClientId={{adminapi_client}}&ClientSecret={{adminapi_secret}}&DisplayName=Admin+API+{{adminapi_client}} |
| 18 | + |
| 19 | +### Get a token |
| 20 | +# @name tokenRequest |
| 21 | +POST {{adminapi_url}}/connect/token |
| 22 | +Content-Type: application/x-www-form-urlencoded |
| 23 | +Authorization: basic {{adminapi_client}}:{{adminapi_secret}} |
| 24 | +Tenant: tenant2 |
| 25 | + |
| 26 | +grant_type=client_credentials&scope=edfi_admin_api/full_access |
| 27 | + |
| 28 | +### |
| 29 | +@token={{tokenRequest.response.body.access_token}} |
| 30 | + |
| 31 | + |
| 32 | +### Get profiles |
| 33 | +GET {{adminapi_url}}/v2/profiles |
| 34 | +Content-Type: application/json |
| 35 | +Authorization: bearer {{token}} |
| 36 | + |
| 37 | +### Create profile 1 |
| 38 | +POST {{adminapi_url}}/v2/profiles |
| 39 | +Content-Type: application/json |
| 40 | +Authorization: bearer {{token}} |
| 41 | + |
| 42 | +{ |
| 43 | + "name": "profile1", |
| 44 | + "definition": "<Profile name=\"profile1\"> |
| 45 | + <Resource name=\"School\"> |
| 46 | + <ReadContentType memberSelection=\"ExcludeOnly\"> |
| 47 | + <Property name=\"NameOfInstitution\" /> |
| 48 | + <Property name=\"OperationalStatusDescriptor\" /> |
| 49 | + <Property name=\"CharterApprovalSchoolYearTypeReference\" /> |
| 50 | + <Property name=\"SchoolType\" /> |
| 51 | + <Property name=\"AdministrativeFundingControlDescriptor\" /> |
| 52 | + <Collection name=\"EducationOrganizationAddresses\" memberSelection=\"IncludeAll\" /> |
| 53 | + <Collection name=\"SchoolCategories\" memberSelection=\"IncludeAll\" /> |
| 54 | + </ReadContentType> |
| 55 | + </Resource> |
| 56 | +</Profile>" |
| 57 | +} |
| 58 | + |
| 59 | +# Given the line breaks it should return 400 with a descriptive error message: |
| 60 | +# { |
| 61 | +# "message": "The request body contains malformed JSON. Please ensure your data is properly formatted and try again." |
| 62 | +# } |
| 63 | + |
| 64 | + |
| 65 | +### Create profile 2 |
| 66 | +POST {{adminapi_url}}/v2/profiles |
| 67 | +Content-Type: application/json |
| 68 | +Authorization: bearer {{token}} |
| 69 | + |
| 70 | +{ |
| 71 | + "name": "profile1", |
| 72 | + "definition": "<Profile name=\"profile1\"><Resource name=\"School\"><ReadContentType memberSelection=\"ExcludeOnly\"><Property name=\"NameOfInstitution\" /><Property name=\"OperationalStatusDescriptor\" /> <Property name=\"CharterApprovalSchoolYearTypeReference\" /><Property name=\"SchoolType\" /><Property name=\"AdministrativeFundingControlDescriptor\" /><Collection name=\"EducationOrganizationAddresses\" memberSelection=\"IncludeAll\" /><Collection name=\"SchoolCategories\" memberSelection=\"IncludeAll\" /></ReadContentType></Resource></Profile>" |
| 73 | +} |
| 74 | + |
| 75 | + |
0 commit comments