BokaMera.API.Host

<back to all web services

DeleteResource

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
DELETE/resource/{Id}Delete a resourceDelete a resource for the currently logged in user, only administrators are allowed to delete resources.
"use strict";
export class TimeException {
    /** @param {{Id?:number,IsRecurring?:boolean,IsBlock?:boolean,ReasonText?:string,ReasonTextPublic?:string,From?:string,To?:string,ResourceIds?:number[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description Time exception id */
    Id;
    /**
     * @type {boolean}
     * @description Indicates whether or not the time exception is recurring */
    IsRecurring;
    /**
     * @type {boolean}
     * @description Indicates whether the time exception is blocking the time or not */
    IsBlock;
    /**
     * @type {string}
     * @description The reason of the time exception, example: Vacation, doctors appointment, ... */
    ReasonText;
    /**
     * @type {string}
     * @description The public reason of the time exception, example: Vacation, doctors appointment, ... */
    ReasonTextPublic;
    /**
     * @type {string}
     * @description Time exception start */
    From;
    /**
     * @type {string}
     * @description Time exception end */
    To;
    /**
     * @type {number[]}
     * @description Resources that owns this exception */
    ResourceIds;
}
/** @typedef {number} */
export var BookingStatusEnum;
(function (BookingStatusEnum) {
    BookingStatusEnum[BookingStatusEnum["Booked"] = 1] = "Booked"
    BookingStatusEnum[BookingStatusEnum["Unbooked"] = 2] = "Unbooked"
    BookingStatusEnum[BookingStatusEnum["Reserved"] = 3] = "Reserved"
    BookingStatusEnum[BookingStatusEnum["Canceled"] = 4] = "Canceled"
    BookingStatusEnum[BookingStatusEnum["AwaitingPayment"] = 5] = "AwaitingPayment"
    BookingStatusEnum[BookingStatusEnum["AwaitingPaymentNoTimeLimit"] = 6] = "AwaitingPaymentNoTimeLimit"
    BookingStatusEnum[BookingStatusEnum["Payed"] = 7] = "Payed"
    BookingStatusEnum[BookingStatusEnum["AwaitingPaymentRequestFromAdmin"] = 8] = "AwaitingPaymentRequestFromAdmin"
    BookingStatusEnum[BookingStatusEnum["AwaitingPaymentFromProvider"] = 9] = "AwaitingPaymentFromProvider"
    BookingStatusEnum[BookingStatusEnum["Invoiced"] = 10] = "Invoiced"
})(BookingStatusEnum || (BookingStatusEnum = {}));
export class BookedCustomer {
    /** @param {{Id?:string,Firstname?:string,Lastname?:string,Email?:string,Phone?:string,FacebookUserName?:string,ImageUrl?:string,CorporateIdentityNumber?:string,InvoiceAddress1?:string,InvoiceAddress2?:string,InvoiceCity?:string,InvoicePostalCode?:string,InvoiceCountryCode?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Id;
    /** @type {string} */
    Firstname;
    /** @type {string} */
    Lastname;
    /** @type {string} */
    Email;
    /** @type {string} */
    Phone;
    /** @type {string} */
    FacebookUserName;
    /** @type {string} */
    ImageUrl;
    /** @type {string} */
    CorporateIdentityNumber;
    /** @type {string} */
    InvoiceAddress1;
    /** @type {string} */
    InvoiceAddress2;
    /** @type {string} */
    InvoiceCity;
    /** @type {string} */
    InvoicePostalCode;
    /** @type {string} */
    InvoiceCountryCode;
}
export class BookedTime {
    /** @param {{Id?:number,ServiceId?:number,From?:string,To?:string,BookedSpots?:number,TotalSpots?:number,PauseAfterInMinutes?:number,StatusId?:number,Status?:BookingStatusEnum,Customer?:BookedCustomer}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description Booking id */
    Id;
    /**
     * @type {number}
     * @description The booked service */
    ServiceId;
    /**
     * @type {string}
     * @description Booking start */
    From;
    /**
     * @type {string}
     * @description Booking end */
    To;
    /**
     * @type {number}
     * @description Number of booked spots */
    BookedSpots;
    /**
     * @type {number}
     * @description Number of total spots for the service */
    TotalSpots;
    /**
     * @type {number}
     * @description The pause after the booking */
    PauseAfterInMinutes;
    /**
     * @type {number}
     * @description The booking status */
    StatusId;
    /** @type {BookingStatusEnum} */
    Status;
    /**
     * @type {BookedCustomer}
     * @description The customer the booking belongs to */
    Customer;
}
export class ResourceQueryResponse {
    /** @param {{Id?:number,Name?:string,Description?:string,Active?:boolean,Color?:string,Email?:string,ImageUrl?:string,MobilePhone?:string,AccessGroup?:string,EmailNotification?:boolean,SMSNotification?:boolean,SendEmailReminder?:boolean,SendSMSReminder?:boolean,Exceptions?:TimeException[],Bookings?:BookedTime[],Created?:string,Updated?:string,ResponseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description The resource id */
    Id;
    /**
     * @type {string}
     * @description The resource name */
    Name;
    /**
     * @type {string}
     * @description The resource description */
    Description;
    /**
     * @type {boolean}
     * @description If resource is active or not */
    Active;
    /**
     * @type {string}
     * @description The resource color in scheduler in hexadecimal color code. Example: #00b0f0 for blue. */
    Color;
    /**
     * @type {string}
     * @description The email of the resource */
    Email;
    /**
     * @type {string}
     * @description The image url of the resource */
    ImageUrl;
    /**
     * @type {string}
     * @description The mobile phone number of the resource */
    MobilePhone;
    /**
     * @type {string}
     * @description Used by example code locks to know what access group the resource is assigned to */
    AccessGroup;
    /**
     * @type {boolean}
     * @description If the resource should receive email notification when booked */
    EmailNotification;
    /**
     * @type {boolean}
     * @description If the resource should receive SMS notification when booked */
    SMSNotification;
    /**
     * @type {?boolean}
     * @description If the resource should receive email reminders on bookings */
    SendEmailReminder;
    /**
     * @type {?boolean}
     * @description If the resource should receive SMS reminders on bookings */
    SendSMSReminder;
    /**
     * @type {TimeException[]}
     * @description The resource time exceptions */
    Exceptions;
    /**
     * @type {BookedTime[]}
     * @description The resource bookings */
    Bookings;
    /**
     * @type {string}
     * @description Then date when the resource was created */
    Created;
    /**
     * @type {string}
     * @description Then date when the resource was updated */
    Updated;
    /** @type {ResponseStatus} */
    ResponseStatus;
}
export class DeleteResource {
    /** @param {{CompanyId?:string,Id?:number,Force?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description Enter the company id, if blank company id and you are an admin, your company id will be used. */
    CompanyId;
    /**
     * @type {number}
     * @description Id of the resource to delete */
    Id;
    /**
     * @type {boolean}
     * @description If this equals true it will force to set the resource as active = false, this is used when bookings exists on the resource and it can't be deleted.  */
    Force;
}

JavaScript DeleteResource DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

DELETE /resource/{Id} HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Id: 0,
	Name: String,
	Description: String,
	Active: False,
	Color: String,
	Email: String,
	MobilePhone: String,
	AccessGroup: String,
	EmailNotification: False,
	SMSNotification: False,
	SendEmailReminder: False,
	SendSMSReminder: False,
	Exceptions: 
	[
		{
			Id: 0,
			IsRecurring: False,
			IsBlock: False,
			ReasonText: String,
			ReasonTextPublic: String,
			ResourceIds: 
			[
				0
			]
		}
	],
	Bookings: 
	[
		{
			Id: 0,
			ServiceId: 0,
			BookedSpots: 0,
			TotalSpots: 0,
			PauseAfterInMinutes: 0,
			StatusId: 0,
			Status: Booked,
			Customer: 
			{
				Firstname: String,
				Lastname: String,
				Email: String,
				Phone: String,
				FacebookUserName: String,
				ImageUrl: String,
				CorporateIdentityNumber: String,
				InvoiceAddress1: String,
				InvoiceAddress2: String,
				InvoiceCity: String,
				InvoicePostalCode: String,
				InvoiceCountryCode: String
			}
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}