Skip to content

Latest commit

 

History

History
158 lines (120 loc) · 5.8 KB

File metadata and controls

158 lines (120 loc) · 5.8 KB
title Create referenceDefinition
description Create a new referenceDefinition object.
author dakelle
ms.localizationpriority medium
ms.subservice industry-data-etl
doc_type apiPageType
ms.date 06/28/2024

Create referenceDefinition

Namespace: microsoft.graph.industryData

[!INCLUDE beta-disclaimer]

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

[!INCLUDE national-cloud-support]

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.

[!INCLUDE permissions-table]

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"
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


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"
}