| title | Create extensionProperty (directory extension) |
|---|---|
| description | Create a new directory extension. |
| ms.localizationpriority | medium |
| author | dkershaw10 |
| ms.subservice | extensions |
| doc_type | apiPageType |
| ms.date | 04/17/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Create a new directory extension definition, represented by an extensionProperty object.
[!INCLUDE national-cloud-support]
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]
[!INCLUDE rbac-apps-applications-directoryextensions-apis]
POST /applications/{application ObjectId}/extensionProperties
POST /applications(appId='{appId}')/extensionProperties| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
In the request body, provide an extensionProperty object with the following properties.
| Property | Type | Description |
|---|---|---|
| dataType | String | Specifies the data type of the value the extension property can hold. Following values are supported.
|
| name | String | Name of the extension property. Not nullable. |
| isMultiValued | Boolean | Defines the directory extension as a multi-valued property. When true, the directory extension property can store a collection of objects of the dataType; for example, a collection of string types such as "extension_b7b1c57b532f40b8b5ed4b7a7ba67401_jobGroupTracker": ["String 1", "String 2"]. The default value is false. |
| targetObjects | String collection | The Microsoft Graph resources that can use the extension property. All values must be in PascalCase. The following values are supported. Not nullable.
|
If successful, this method returns 201, Created response code and a new extensionProperty object in the response body.
The following example shows a request.
POST https://graph.microsoft.com/beta/applications/fd918e4b-c821-4efb-b50a-5eddd23afc6f/extensionProperties
Content-type: application/json
{
"name": "jobGroup",
"dataType": "String",
"isMultiValued": true,
"targetObjects": [
"User"
]
}[!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]
If successful, this method returns a 201 Created response code and an extensionProperty object in the response body.
HTTP/1.1 201 Created
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#applications('fd918e4b-c821-4efb-b50a-5eddd23afc6f')/extensionProperties/$entity",
"id": "da38c7b1-133e-4a79-abcd-e2fd586ce621",
"deletedDateTime": null,
"appDisplayName": "b2c-extensions-app. Do not modify. Used by AADB2C for storing user data.",
"dataType": "String",
"isMultiValued": true,
"isSyncedFromOnPremises": false,
"name": "extension_25883231668a43a780b25685c3f874bc_jobGroup",
"targetObjects": [
"User"
]
}