BokaMera.API.Host

<back to all web services

UpdateResource

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/resource/{Id}Update existing resourceUpdates an existing resource if you are authorized to do so.
UpdateResource Parameters:
NameParameterData TypeRequiredDescription
CompanyIdbodyGuid?YesEnter the company id, if blank company id and you are an admin, your company id will be used.
IdpathintYesId of the resource
NamebodystringNoThe resource name
DescriptionbodystringNoThe resource description
Activebodybool?NoIf resource is active or not
ColorbodystringNoThe resource color in scheduler
ImageUrlbodyUriNoThe image url of the resource
EmailbodystringNoThe email of the resource
MobilePhonebodystringNoThe mobile phone number of the resource
AccessGroupbodystringNoUsed by example code locks to know what access group the resource is assigned to
EmailNotificationbodybool?NoIf the resource should receive email notification when booked
SMSNotificationbodybool?NoIf the resource should receive SMS notification when booked
SendEmailReminderbodybool?NoIf the resource should receive email reminders on bookings
SendSMSReminderbodybool?NoIf the resource should receive SMS reminders on bookings
CustomFieldsbodyList<AddCustomField>NoIf Custom Fields are added to the resource, here you will send the id and the value for each custom field to be saved
AddCustomField Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
ValueformstringNo
ResourceQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNoThe resource id
NameformstringNoThe resource name
DescriptionformstringNoThe resource description
ActiveformboolNoIf resource is active or not
ColorformstringNoThe resource color in scheduler in hexadecimal color code. Example: #00b0f0 for blue.
EmailformstringNoThe email of the resource
ImageUrlformUriNoThe image url of the resource
MobilePhoneformstringNoThe mobile phone number of the resource
AccessGroupformstringNoUsed 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>NoThe resource time exceptions
BookingsformList<BookedTime>NoThe resource bookings
CreatedformDateTimeNoThen date when the resource was created
UpdatedformDateTimeNoThen date when the resource was updated
ResponseStatusformResponseStatusNo
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
ReasonTextformstringNoThe reason of the time exception, example: Vacation, doctors appointment, ...
ReasonTextPublicformstringNoThe public reason of the time exception, example: Vacation, doctors appointment, ...
FromformDateTimeNoTime exception start
ToformDateTimeNoTime exception end
ResourceIdsformint[]NoResources 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
CustomerformBookedCustomerNoThe customer the booking belongs to
BookingStatusEnum Enum:
NameValue
Booked1
Unbooked2
Reserved3
Canceled4
AwaitingPayment5
AwaitingPaymentNoTimeLimit6
Payed7
AwaitingPaymentRequestFromAdmin8
AwaitingPaymentFromProvider9
Invoiced10
BookedCustomer Parameters:
NameParameterData TypeRequiredDescription
IdformGuidNo
FirstnameformstringNo
LastnameformstringNo
EmailformstringNo
PhoneformstringNo
FacebookUserNameformstringNo
ImageUrlformstringNo
CorporateIdentityNumberformstringNo
InvoiceAddress1formstringNo
InvoiceAddress2formstringNo
InvoiceCityformstringNo
InvoicePostalCodeformstringNo
InvoiceCountryCodeformstringNo

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.

PUT /resource/{Id} HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","Id":0,"Name":"String","Description":"String","Active":false,"Color":"String","Email":"String","MobilePhone":"String","AccessGroup":"String","EmailNotification":false,"SMSNotification":false,"SendEmailReminder":false,"SendSMSReminder":false,"CustomFields":[{"Id":0,"Value":"String"}]}
HTTP/1.1 200 OK
Content-Type: application/json
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"}}}