Create a new extensionProperty definition. You can use this operation to add a custom property value to the targeted object type defined in the extensionProperty, using standard creation and update requests to the target object.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new ExtensionProperty();
$requestBody->setName('jobGroup');
$requestBody->setDataType('String');
$requestBody->setTargetObjects(['User', ]);
$requestResult = $graphServiceClient->applicationsById('application-id')->extensionProperties()->post($requestBody);
If successful, this method returns 201 Created response code and extensionProperty object in the response body.
HTTP/1.1 201 Created
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$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",
"isSyncedFromOnPremises": false,
"name": "extension_25883231668a43a780b25685c3f874bc_jobGroup",
"targetObjects": [
"User"
]
}