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
NamebodystringYesThe resource name
DescriptionbodystringYesThe resource description
Activebodybool?NoIf resource is active or not
ColorbodystringYesThe resource color in scheduler
ImageUrlbodyUriYesThe Image URL of the resource
EmailbodystringYesThe Email of the resource
MobilePhonebodystringYesThe Mobile phone number of the resource
AccessGroupbodystringYesUsed 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>YesIf 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
ValueformstringYes
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 .xml suffix or ?format=xml

HTTP + XML

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/xml
Content-Type: application/xml
Content-Length: length

<UpdateResource xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <AccessGroup>String</AccessGroup>
  <Active>false</Active>
  <Color>String</Color>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <CustomFields>
    <AddCustomField>
      <Id>0</Id>
      <Value>String</Value>
    </AddCustomField>
  </CustomFields>
  <Description>String</Description>
  <Email>String</Email>
  <EmailNotification>false</EmailNotification>
  <Id>0</Id>
  <ImageUrl i:nil="true" />
  <MobilePhone>String</MobilePhone>
  <Name>String</Name>
  <SMSNotification>false</SMSNotification>
  <SendEmailReminder>false</SendEmailReminder>
  <SendSMSReminder>false</SendSMSReminder>
</UpdateResource>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ResourceQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <AccessGroup>String</AccessGroup>
  <Active>false</Active>
  <Bookings>
    <BookedTime>
      <BookedSpots>0</BookedSpots>
      <Customer>
        <CorporateIdentityNumber>String</CorporateIdentityNumber>
        <Email>String</Email>
        <FacebookUserName>String</FacebookUserName>
        <Firstname>String</Firstname>
        <Id>00000000-0000-0000-0000-000000000000</Id>
        <ImageUrl>String</ImageUrl>
        <InvoiceAddress1>String</InvoiceAddress1>
        <InvoiceAddress2>String</InvoiceAddress2>
        <InvoiceCity>String</InvoiceCity>
        <InvoiceCountryCode>String</InvoiceCountryCode>
        <InvoicePostalCode>String</InvoicePostalCode>
        <Lastname>String</Lastname>
        <Phone>String</Phone>
      </Customer>
      <From>0001-01-01T00:00:00</From>
      <Id>0</Id>
      <PauseAfterInMinutes>0</PauseAfterInMinutes>
      <ServiceId>0</ServiceId>
      <Status>Booked</Status>
      <StatusId>0</StatusId>
      <To>0001-01-01T00:00:00</To>
      <TotalSpots>0</TotalSpots>
    </BookedTime>
  </Bookings>
  <Color>String</Color>
  <Created>0001-01-01T00:00:00</Created>
  <Description>String</Description>
  <Email>String</Email>
  <EmailNotification>false</EmailNotification>
  <Exceptions>
    <TimeException>
      <From>0001-01-01T00:00:00</From>
      <Id>0</Id>
      <IsBlock>false</IsBlock>
      <IsRecurring>false</IsRecurring>
      <ReasonText>String</ReasonText>
      <ReasonTextPublic>String</ReasonTextPublic>
      <ResourceIds xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:int>0</d4p1:int>
      </ResourceIds>
      <To>0001-01-01T00:00:00</To>
    </TimeException>
  </Exceptions>
  <Id>0</Id>
  <ImageUrl i:nil="true" />
  <MobilePhone>String</MobilePhone>
  <Name>String</Name>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <SMSNotification>false</SMSNotification>
  <SendEmailReminder>false</SendEmailReminder>
  <SendSMSReminder>false</SendSMSReminder>
  <Updated>0001-01-01T00:00:00</Updated>
</ResourceQueryResponse>