How To: Add Profiles to the Ed-Fi ODS / API
This example outlines the steps necessary to integrate and activate Ed-Fi
Profile definitions for use in an Ed-Fi ODS / API. To be able to update profile
definitions at run-time without rebuild and redeployment, it is preferred to
configure profile definitions in the EdFi_Admin database. Alternatively, you
can define profile via embedded resource in a C# project as described in
Appendix
A.
Step 1. Add Profiles via the EdFi_Admin Database
API Profiles can be configured and assigned through the EdFi_Admin database.
This database stores the data required to manage API keys and secrets, Education
Organizations, Profile assignments, and Profile definitions.
The tables related to this process are shown below.
API Profiles can be directly inserted into the Profiles table and then assigned
to Applications via the ProfileApplications table. When making changes in the
Profiles table, be aware that only one Profile can be stored per row. As such,
the XML in the ProfileDefintion column should use <Profile> as the root element
rather than the <Profiles> root element defined in the
Ed-Fi-ODS-API-Profiles.xsd.
The XML schema of API Profile definitions can be validated using the schema
definition file included in the Ed-Fi-ODS repository at
Ed-Fi-ODS\Application\EdFi.Ods.Common\Metadata\Schemas\Ed-Fi-ODS-API-Profiles.xsd.
Profiles in the EdFi_Admin database are refreshed dynamically by the Ed-Fi ODS
/ API each time the profiles cache expires. The expiration time for the
profiles cache can be adjusted in the appsettings.json file, as shown below.
"Caching": {
...
"Profiles": {
"AbsoluteExpirationSeconds": 1800
}
}
Step 2. Verify that the API Profiles feature is enabled
Ensure that the API Profiles feature is enabled by looking at the
appsettings.json file in the WebApi project, which can be found under the “Entry
Points” folder in the solution.
"FeatureManagement": {
...
"Profiles": true,
...
}
Step 3. Verify that the Profile endpoints are visible
Verify that the new Profile endpoints are visible in the swagger or via metadata endpoint.
You may have to clear your browser cache in order for Swagger UI to display the new resource.

[
...
{
"name": "Test-Profile-Resource-Exclude-Only",
"endpointUri": "http://localhost/metadata/data/v3/profiles/test-profile-resource-excludeonly/swagger.json",
"prefix": "Profiles"
},
{
"name": "Test-Profile-Resource-Include-All",
"endpointUri": "http://localhost/metadata/data/v3/profiles/test-profile-resource-includeall/swagger.json",
"prefix": "Profiles"
},
{
"name": "Test-Profile-Resource-Include-Only",
"endpointUri": "http://localhost//metadata/data/v3/profiles/test-profile-resource-includeonly/swagger.json",
"prefix": "Profiles"
},
{
"name": "Test-Profile-Resource-Nested-Child-Collection-Filtered-To-Exclude-Only-Specific-Types-And-Descriptors",
"endpointUri": "http://localhost//metadata/data/v3/profiles/test-profile-resource-nested-child-collection-filtered-to-exclude-only-specific-types-and-descriptors/swagger.json",
"prefix": "Profiles"
},
{
"name": "Test-Profile-Resource-Nested-Child-Collection-Filtered-To-Include-Only-Specific-Types-And-Descriptors",
"endpointUri": "http://localhost//metadata/data/v3/profiles/test-profile-resource-nested-child-collection-filtered-to-include-only-specific-types-and-descriptors/swagger.json",
"prefix": "Profiles"
},
{
"name": "Test-Profile-Resource-Read-Only",
"endpointUri": "http://localhost/metadata/data/v3/profiles/test-profile-resource-readonly/swagger.json",
"prefix": "Profiles"
},
{
"name": "Test-Profile-Resource-References-Exclude-Only",
"endpointUri": "http://localhost/metadata/data/v3/profiles/test-profile-resource-references-excludeonly/swagger.json",
"prefix": "Profiles"
}
]