Muokkaa

Jaa


(automation API) Create userGroup

Note

User groups are replaced with security groups and will be deprecated in version 25. For more information, see security group APIs and Control Access to Business Central Using Security Groups.

Creates a user group in Dynamics 365 Business Central.

HTTP request

Replace the URL prefix for Business Central depending on environment following the guideline.

POST /microsoft/automation/v2.0/companies({companyId})/userGroups

Request headers

Header Value
Authorization Bearer {token}. Required.
Content-Type application/json

Request body

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

Response

If successful, this method returns 201 Created response code and a userGroup object in the response body.

Example

Request

Here is an example of the request.

POST https://api.businesscentral.dynamics.com/v2.0/{environment name}/api/microsoft/automation/v2.0/companies({companyId})/userGroups
Content-type: application/json
{
    "code": "NEW USER GROUP",
    "displayName": "New User Group",
    "defaultProfileID": "ACCOUNTANT"
}

Response Here is an example of the response.

HTTP/1.1 201 Created
Content-type: application/json
{
    "id": "90814d0b-caad-eb11-9b52-000d3ab03e45",
    "code": "NEW USER GROUP",
    "displayName": "New User Group",
    "defaultProfileID": "ACCOUNTANT",
    "assignToAllNewUsers": false
}

Tips for working with the APIs
userGroup