BokaMera.API.Host

<back to all web services

CreateResourceType

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/resourcetypesAdd a new resourcetypeAdd a new resourcetype to the company of the currently logged in user, only administrators are allowed to add resourcetypes.
"use strict";
export class ResourceTypeResource {
    /** @param {{Id?:number,Name?:string,Active?:boolean,Description?:string,Email?:string,Phone?:string,Color?:string,ImageUrl?:string,Priority?:number,EmailNotification?:boolean,SMSNotification?:boolean,EmailReminder?:boolean,SMSReminder?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description The resource id */
    Id;
    /**
     * @type {string}
     * @description The resource name */
    Name;
    /**
     * @type {boolean}
     * @description The resource status */
    Active;
    /**
     * @type {string}
     * @description The resource description */
    Description;
    /**
     * @type {string}
     * @description The resource email */
    Email;
    /**
     * @type {string}
     * @description The resource phone */
    Phone;
    /**
     * @type {string}
     * @description The resource color */
    Color;
    /**
     * @type {string}
     * @description The resource image */
    ImageUrl;
    /**
     * @type {number}
     * @description The priority of the resource */
    Priority;
    /**
     * @type {boolean}
     * @description If the resource want to receive email notifications */
    EmailNotification;
    /**
     * @type {boolean}
     * @description If the resource want to receive sms notifications */
    SMSNotification;
    /**
     * @type {boolean}
     * @description If the resource want to receive email reminders */
    EmailReminder;
    /**
     * @type {boolean}
     * @description If the resource want to receive sms reminders */
    SMSReminder;
}
export class ResourceTypeQueryResponse {
    /** @param {{Id?:number,Name?:string,Description?:string,Resources?:ResourceTypeResource[],Active?:boolean,Created?:string,Updated?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description The resourcetype id */
    Id;
    /**
     * @type {string}
     * @description The resourcetype name */
    Name;
    /**
     * @type {string}
     * @description The resourcetype description */
    Description;
    /**
     * @type {ResourceTypeResource[]}
     * @description The resources in the resourcetype. Only shows active resources if not admin. */
    Resources;
    /**
     * @type {boolean}
     * @description If resourcetype is active or not */
    Active;
    /**
     * @type {string}
     * @description Then date when the resource was created */
    Created;
    /**
     * @type {string}
     * @description Then date when the resource was updated */
    Updated;
}
export class AddResourceTypeResource {
    /** @param {{Id?:number,Priority?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description The resource id */
    Id;
    /**
     * @type {number}
     * @description The priority of the resource. If no priority is set it will take random resource when booking a time. */
    Priority;
}
export class CreateResourceType {
    /** @param {{CompanyId?:string,Name?:string,Resources?:AddResourceTypeResource[],Description?:string,Active?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {?string}
     * @description The company id, if empty will use the company id for the user you are logged in with. */
    CompanyId;
    /**
     * @type {string}
     * @description The resourcetype name */
    Name;
    /**
     * @type {AddResourceTypeResource[]}
     * @description The resources to be included */
    Resources;
    /**
     * @type {string}
     * @description The resourcetype description */
    Description;
    /**
     * @type {boolean}
     * @description If resourcetype is active or not */
    Active;
}

JavaScript CreateResourceType DTOs

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

HTTP + JSON

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}