| Requires any of the roles: | Admin, TenantAdmin, AccessAdmin |
| POST | /BusinessUserAccess | Creates an access for a business user. |
|---|
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| AccessTemplateId | body | string | Yes | AccessTemplate ID |
| BusinessUserId | body | integer | Yes | ID of the business user |
| AccessCodeInitializationStrategy | body | AccessCodeInitializationStrategy | No | Strategy for initializing access codes for a new access from the template (unique per space on same one for all spaces). |
| Permission | body | array | No | List of user permissions in the organization. |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| ValidFrom | form | string | Yes | Access comes into effect after this time |
| ValidTo | form | string | No | Time when access stops. If you don't specify then access is active for undefined end time. |
| Label | form | string | No | Access label. |
| Spaces | form | List<ThingBusinessUserAccessDto> | Yes | List of spaces that the access is granted for. |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Version | form | integer | No | Api version |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| ThingId | form | Guid | No | |
| AccessCount | form | int? | No | |
| FromHour | form | TimeSpan? | No | |
| ToHour | form | TimeSpan? | No | |
| Exclusive | form | bool | No |
| Name | Value |
|---|---|
| Unique | 0 |
| Shared | 1 |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Id | form | Guid? | No |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| ResponseStatus | form | ResponseStatus | No |
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /BusinessUserAccess HTTP/1.1
Host: api.4spaces.io
Accept: application/json
Content-Type: application/json
Content-Length: length
{"accessTemplateId":"00000000000000000000000000000000","businessUserId":0,"accessCodeInitializationStrategy":0,"permission":["String"],"validFrom":-62135596800000,"validTo":-62135596800000,"label":"String","spaces":[{"thingId":"00000000000000000000000000000000","accessCount":0,"fromHour":"00:00:00","toHour":"00:00:00","exclusive":false}],"version":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"id":"00000000000000000000000000000000","responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}