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.
DeleteResource Parameters:
NameParameterData TypeRequiredDescription
CompanyIdqueryGuid?YesEnter the company id, if blank company id and you are an admin, your company id will be used.
IdpathintYesId of the resource to delete
ForcequeryboolNoIf this equals true it will force to set the resource as active = false, this is used when bookings exist on the resource and it cannot be deleted.
ResourceQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNoThe resource id
NameformstringYesThe resource name
DescriptionformstringYesThe resource description
ActiveformboolNoIf resource is active or not
ColorformstringYesThe resource color in scheduler in hexadecimal color code. Example: #00b0f0 for blue.
EmailformstringYesThe Email of the resource
ImageUrlformUriYesThe Image URL of the resource
MobilePhoneformstringYesThe Mobile phone number of the resource
AccessGroupformstringYesUsed by example code locks to know what access group the resource is assigned to
EmailNotificationformboolNoIf the resource should receive Email notification when booked
SMSNotificationformboolNoIf the resource should receive SMS notification when booked
SendEmailReminderformbool?NoIf the resource should receive Email reminders on bookings
SendSMSReminderformbool?NoIf the resource should receive SMS reminders on bookings
ExceptionsformList<TimeException>YesThe resource time exceptions
BookingsformList<BookedTime>YesThe resource bookings
CreatedformDateTimeNoThe date when the resource was created
UpdatedformDateTimeNoThe date when the resource was updated
ResponseStatusformResponseStatusYes
TimeException Parameters:
NameParameterData TypeRequiredDescription
IdformintNoTime exception id
IsRecurringformboolNoIndicates whether or not the time exception is recurring
IsBlockformboolNoIndicates whether the time exception is blocking the time or not
ReasonTextformstringYesThe reason of the time exception, example: Vacation, doctors appointment, ...
ReasonTextPublicformstringYesThe public reason of the time exception, example: Vacation, doctors appointment, ...
FromformDateTimeNoTime exception start
ToformDateTimeNoTime exception end
ResourceIdsformint[]YesResources that owns this exception
BookedTime Parameters:
NameParameterData TypeRequiredDescription
IdformintNoBooking id
ServiceIdformintNoThe booked service
FromformDateTimeNoBooking start
ToformDateTimeNoBooking end
BookedSpotsformintNoNumber of booked spots
TotalSpotsformintNoNumber of total spots for the service
PauseAfterInMinutesformintNoThe pause after the booking
StatusIdformintNoThe booking status
StatusformBookingStatusEnumNo
CustomerformBookedCustomerYesThe customer the booking belongs to
BookingStatusEnum Enum:
NameValue
Booked1
Unbooked2
Reserved3
Canceled4
AwaitingPayment5
AwaitingPaymentNoTimeLimit6
Payed7
AwaitingPaymentRequestFromAdmin8
AwaitingPaymentFromProvider9
Invoiced10
BookedCustomer Parameters:
NameParameterData TypeRequiredDescription
IdformGuidNo
FirstnameformstringYes
LastnameformstringYes
EmailformstringYes
PhoneformstringYes
FacebookUserNameformstringYes
ImageUrlformstringYes
CorporateIdentityNumberformstringYes
InvoiceAddress1formstringYes
InvoiceAddress2formstringYes
InvoiceCityformstringYes
InvoicePostalCodeformstringYes
InvoiceCountryCodeformstringYes

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

HTTP + CSV

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: testapi.bokamera.se 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
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"}}}