Create referenceDefinition

Namespace: microsoft.graph.industryData

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Create a new referenceDefinition object.

referenceDefinition objects associate incoming data with standardized reference types values for validation.

You can extend the following reference types with other codes that better align with your source data.

Name ReferenceType
Academic Subjects RefAcademicSubject
Demographic: Race RefRace
Demographic: Ethnicity RefEthnicity
Grade Level RefGradeLevel
Organization Types RefOrgType
Person Flags RefPersonFlagType

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) IndustryData-ReferenceDefinition.ReadWrite.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application IndustryData-ReferenceDefinition.ReadWrite.All Not available.

HTTP request

POST /external/industryData/referenceDefinitions

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of the referenceDefinition object.

The following table lists the required and optional properties for creating a referenceDefinition object.

Property Type Description
referenceType String The categorical type for a collection enumerated values. Required.
displayName String A human-readable representation of the reference code value for display in a user interface. Optional.
code String Code value for the definition. Must be unique within the referenceType. Required.
isDisabled Boolean Indicates whether the definition is disabled. Required.
sortIndex Int32 The index that specifies the order in which to present the definition to the user. Must be unique within the referenceType. Required.

Response

If successful, this method returns a 201 Created response code and a microsoft.graph.industryData.referenceDefinition object in the response body.

Examples

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/external/industryData/referenceDefinitions
Content-Type: application/json

{
  "@odata.type": "#microsoft.graph.industryData.referenceDefinition",
  "referenceType": "RefGradeLevel",
  "code": "TestGrade",
  "isDisabled": false,
  "sortIndex": 300,
  "displayName": "New Test Grade Level"
}

Response

The following example shows the response.

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.type": "#microsoft.graph.industryData.referenceDefinition",
  "id": "RefGradeLevel-TestGrade",
  "referenceType": "RefGradeLevel",
  "displayName": "New Test Grade Level",
  "code": "TestGrade",
  "source": "Tenant Defined",
  "isDisabled": false,
  "sortIndex": 300,
  "createdDateTime": "2024-03-13T18:20:26.3796502Z",
  "lastModifiedDateTime": "2024-03-13T18:20:26.3796502Z"
}