| Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
| POST | /resourcetypes | Add a new resourcetype | Add a new resourcetype to the company of the currently logged in user, only administrators are allowed to add resourcetypes. |
|---|
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| CompanyId | body | Guid? | No | The company id, if empty will use the company id for the user you are logged in with. |
| Name | body | string | Yes | The resourcetype name |
| Resources | body | List<AddResourceTypeResource> | Yes | The resources to be included |
| Description | body | string | Yes | The resourcetype description |
| Active | body | bool | No | If resourcetype is active or not |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Id | form | int | No | The resource id |
| Priority | form | int | No | The priority of the resource. If no priority is set it will take random resource when booking a time. |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Id | form | int | No | The resourcetype id |
| Name | form | string | Yes | The resourcetype name |
| Description | form | string | Yes | The resourcetype description |
| Resources | form | List<ResourceTypeResource> | Yes | The resources in the resourcetype. Only shows active resources if not admin. |
| Active | form | bool | No | If resourcetype is active or not |
| Created | form | DateTime | No | The date when the resource was created |
| Updated | form | DateTime | No | The date when the resource was updated |
| Name | Parameter | Data Type | Required | Description |
|---|---|---|---|---|
| Id | form | int | No | The resource id |
| Name | form | string | Yes | The resource name |
| Active | form | bool | No | The resource status |
| Description | form | string | Yes | The resource description |
| form | string | Yes | The resource email | |
| Phone | form | string | Yes | The resource phone |
| Color | form | string | Yes | The resource color |
| ImageUrl | form | Uri | Yes | The resource image |
| Priority | form | int | No | The priority of the resource |
| EmailNotification | form | bool | No | If the resource wants to receive Email notifications |
| SMSNotification | form | bool | No | If the resource wants to receive SMS notifications |
| EmailReminder | form | bool | No | If the resource wants to receive Email reminders |
| SMSReminder | form | bool | No | If the resource wants to receive SMS reminders |
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 /resourcetypes HTTP/1.1
Host: api.bokamera.se
Accept: application/json
Content-Type: application/json
Content-Length: length
{"CompanyId":"00000000-0000-0000-0000-000000000000","Name":"String","Resources":[{"Id":0,"Priority":0}],"Description":"String","Active":false}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"Id":0,"Name":"String","Description":"String","Resources":[{"Id":0,"Name":"String","Active":false,"Description":"String","Email":"String","Phone":"String","Color":"String","Priority":0,"EmailNotification":false,"SMSNotification":false,"EmailReminder":false,"SMSReminder":false}],"Active":false}