| Requires any of the roles: | Admin, TenantAdmin, AccessTemplateAdmin |
| PUT | /access/template | Updates an access template. |
|---|
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| AccessTemplateId | body | string | Yes | Access template Id (GUID) |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Name | form | string | Yes | Access template name |
| Description | form | string | No | Access template Description |
| Things | form | array | Yes | IDs and configuration of permitted things |
| Scope | form | AccessTemplateScope | Yes | Usage scope (who can use the template)Allowable Values
|
| AccessCodeInitializationStrategy | form | AccessCodeInitializationStrategy | Yes | How the access codes for a reservation from this template will be initialized.Allowable Values
|
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Version | form | integer | No | Api version |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Id | form | Guid? | No | |
| OrganizationId | form | Guid | No | |
| ThingId | form | Guid | No | |
| ThingName | form | string | No | |
| ThingTypeName | form | string | No | |
| Exclusive | form | bool | No | |
| AvailableFrom | form | int? | No | |
| AvailableTo | form | int? | No | |
| AccessCount | form | int? | No | |
| AccessLevel | form | string | No | |
| Permission | form | List<string> | No |
| Name | Value |
|---|---|
| All | 0 |
| Guest | 1 |
| Staff | 2 |
| Name | Value |
|---|---|
| Unique | 0 |
| Shared | 1 |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Data | form | AccessTemplateView | No |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| ResponseStatus | form | ResponseStatus | No |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Id | form | Guid | No | |
| OrganizationId | form | Guid | No | |
| Organization | form | OrganizationBasicView | No | |
| Name | form | string | No | |
| Permission | form | List<string> | No | |
| Description | form | string | No | |
| Scope | form | AccessTemplateScope | No | |
| AccessCodeInitializationStrategy | form | AccessCodeInitializationStrategy | No |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Id | form | Guid | No | |
| Name | form | string | No | |
| Type | form | OrganizationType | No | |
| SubOrganizations | form | List<OrganizationBasicView> | No |
| Name | Value |
|---|---|
| Unknown | 0 |
| Admin | 10 |
| Tenant | 20 |
| Location | 30 |
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /access/template HTTP/1.1
Host: api.4spaces.io
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
accessTemplateId: 00000000000000000000000000000000,
name: String,
description: String,
things:
[
{
id: 00000000000000000000000000000000,
organizationId: 00000000000000000000000000000000,
thingId: 00000000000000000000000000000000,
thingName: String,
thingTypeName: String,
exclusive: False,
availableFrom: 0,
availableTo: 0,
accessCount: 0,
accessLevel: String,
permission:
[
String
]
}
],
scope: 0,
accessCodeInitializationStrategy: 0,
version: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
data:
{
id: 00000000000000000000000000000000,
organizationId: 00000000000000000000000000000000,
organization:
{
id: 00000000000000000000000000000000,
name: String,
type: 0,
organizations:
[
{
id: 00000000000000000000000000000000,
name: String,
type: 0,
organizations:
[
{
id: 00000000000000000000000000000000,
name: String,
type: 0,
organizations:
[
{
}
]
}
]
}
]
},
name: String,
permission:
[
String
],
description: String,
scope: 0,
accessCodeInitializationStrategy: 0
},
responseStatus:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}