| Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
| PUT | /resource/{Id} | Update existing resource | Updates an existing resource if you are authorized to do so. |
|---|
export class TimeException implements ITimeException
{
/** @description Time exception id */
// @ApiMember(Description="Time exception id")
public Id: number;
/** @description Indicates whether or not the time exception is recurring */
// @ApiMember(Description="Indicates whether or not the time exception is recurring")
public IsRecurring: boolean;
/** @description Indicates whether the time exception is blocking the time or not */
// @ApiMember(Description="Indicates whether the time exception is blocking the time or not")
public IsBlock: boolean;
/** @description The reason of the time exception, example: Vacation, doctors appointment, ... */
// @ApiMember(Description="The reason of the time exception, example: Vacation, doctors appointment, ...")
public ReasonText: string;
/** @description The public reason of the time exception, example: Vacation, doctors appointment, ... */
// @ApiMember(Description="The public reason of the time exception, example: Vacation, doctors appointment, ...")
public ReasonTextPublic: string;
/** @description Time exception start */
// @ApiMember(Description="Time exception start")
public From: string;
/** @description Time exception end */
// @ApiMember(Description="Time exception end")
public To: string;
/** @description Resources that owns this exception */
// @ApiMember(Description="Resources that owns this exception")
public ResourceIds: number[] = [];
public constructor(init?: Partial<TimeException>) { (Object as any).assign(this, init); }
}
export enum BookingStatusEnum
{
Booked = 1,
Unbooked = 2,
Reserved = 3,
Canceled = 4,
AwaitingPayment = 5,
AwaitingPaymentNoTimeLimit = 6,
Payed = 7,
AwaitingPaymentRequestFromAdmin = 8,
AwaitingPaymentFromProvider = 9,
Invoiced = 10,
}
export class BookedCustomer
{
public Id: string;
public Firstname: string;
public Lastname: string;
public Email: string;
public Phone: string;
public FacebookUserName: string;
public ImageUrl: string;
public CorporateIdentityNumber: string;
public InvoiceAddress1: string;
public InvoiceAddress2: string;
public InvoiceCity: string;
public InvoicePostalCode: string;
public InvoiceCountryCode: string;
public constructor(init?: Partial<BookedCustomer>) { (Object as any).assign(this, init); }
}
export class BookedTime implements IBookedTime
{
/** @description Booking id */
// @ApiMember(Description="Booking id")
public Id: number;
/** @description The booked service */
// @ApiMember(Description="The booked service")
public ServiceId: number;
/** @description Booking start */
// @ApiMember(Description="Booking start")
public From: string;
/** @description Booking end */
// @ApiMember(Description="Booking end")
public To: string;
/** @description Number of booked spots */
// @ApiMember(Description="Number of booked spots")
public BookedSpots: number;
/** @description Number of total spots for the service */
// @ApiMember(Description="Number of total spots for the service")
public TotalSpots: number;
/** @description The pause after the booking */
// @ApiMember(Description="The pause after the booking")
public PauseAfterInMinutes: number;
/** @description The booking status */
// @ApiMember(Description="The booking status")
public StatusId: number;
public Status: BookingStatusEnum;
/** @description The customer the booking belongs to */
// @ApiMember(Description="The customer the booking belongs to")
public Customer: BookedCustomer;
public constructor(init?: Partial<BookedTime>) { (Object as any).assign(this, init); }
}
export class ResourceQueryResponse
{
/** @description The resource id */
// @ApiMember(Description="The resource id")
public Id: number;
/** @description The resource name */
// @ApiMember(Description="The resource name")
public Name: string;
/** @description The resource description */
// @ApiMember(Description="The resource description")
public Description: string;
/** @description If resource is active or not */
// @ApiMember(Description="If resource is active or not")
public Active: boolean;
/** @description The resource color in scheduler in hexadecimal color code. Example: #00b0f0 for blue. */
// @ApiMember(Description="The resource color in scheduler in hexadecimal color code. Example: #00b0f0 for blue.")
public Color: string;
/** @description The Email of the resource */
// @ApiMember(Description="The Email of the resource")
public Email: string;
/** @description The Image URL of the resource */
// @ApiMember(Description="The Image URL of the resource")
public ImageUrl: string;
/** @description The Mobile phone number of the resource */
// @ApiMember(Description="The Mobile phone number of the resource")
public MobilePhone: string;
/** @description Used by example code locks to know what access group the resource is assigned to */
// @ApiMember(Description="Used by example code locks to know what access group the resource is assigned to")
public AccessGroup: string;
/** @description If the resource should receive Email notification when booked */
// @ApiMember(Description="If the resource should receive Email notification when booked")
public EmailNotification: boolean;
/** @description If the resource should receive SMS notification when booked */
// @ApiMember(Description="If the resource should receive SMS notification when booked")
public SMSNotification: boolean;
/** @description If the resource should receive Email reminders on bookings */
// @ApiMember(Description="If the resource should receive Email reminders on bookings")
public SendEmailReminder?: boolean;
/** @description If the resource should receive SMS reminders on bookings */
// @ApiMember(Description="If the resource should receive SMS reminders on bookings")
public SendSMSReminder?: boolean;
/** @description The resource time exceptions */
// @ApiMember(Description="The resource time exceptions")
public Exceptions: TimeException[] = [];
/** @description The resource bookings */
// @ApiMember(Description="The resource bookings")
public Bookings: BookedTime[] = [];
/** @description The date when the resource was created */
// @ApiMember(Description="The date when the resource was created")
public Created: string;
/** @description The date when the resource was updated */
// @ApiMember(Description="The date when the resource was updated")
public Updated: string;
public ResponseStatus: ResponseStatus;
public constructor(init?: Partial<ResourceQueryResponse>) { (Object as any).assign(this, init); }
}
export class AddCustomField
{
public Id: number;
public Value: string;
public constructor(init?: Partial<AddCustomField>) { (Object as any).assign(this, init); }
}
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
export class UpdateResource implements ICompany
{
/** @description Enter the company id, if blank company id and you are an admin, your company id will be used. */
// @ApiMember(Description="Enter the company id, if blank company id and you are an admin, your company id will be used.", IsRequired=true)
public CompanyId: string;
/** @description Id of the resource */
// @ApiMember(Description="Id of the resource", IsRequired=true, ParameterType="path")
public Id: number;
/** @description The resource name */
// @ApiMember(Description="The resource name")
public Name: string;
/** @description The resource description */
// @ApiMember(Description="The resource description")
public Description: string;
/** @description If resource is active or not */
// @ApiMember(Description="If resource is active or not")
public Active?: boolean;
/** @description The resource color in scheduler */
// @ApiMember(Description="The resource color in scheduler")
public Color: string;
/** @description The Image URL of the resource */
// @ApiMember(Description="The Image URL of the resource")
public ImageUrl: string;
/** @description The Email of the resource */
// @ApiMember(Description="The Email of the resource")
public Email: string;
/** @description The Mobile phone number of the resource */
// @ApiMember(Description="The Mobile phone number of the resource")
public MobilePhone: string;
/** @description Used by example code locks to know what access group the resource is assigned to */
// @ApiMember(Description="Used by example code locks to know what access group the resource is assigned to")
public AccessGroup: string;
/** @description If the resource should receive Email notification when booked */
// @ApiMember(Description="If the resource should receive Email notification when booked")
public EmailNotification?: boolean;
/** @description If the resource should receive SMS notification when booked */
// @ApiMember(Description="If the resource should receive SMS notification when booked")
public SMSNotification?: boolean;
/** @description If the resource should receive Email reminders on bookings */
// @ApiMember(Description="If the resource should receive Email reminders on bookings")
public SendEmailReminder?: boolean;
/** @description If the resource should receive SMS reminders on bookings */
// @ApiMember(Description="If the resource should receive SMS reminders on bookings")
public SendSMSReminder?: boolean;
/** @description If Custom Fields are added to the resource, here you will send the id and the value for each custom field to be saved */
// @ApiMember(Description="If Custom Fields are added to the resource, here you will send the id and the value for each custom field to be saved")
public CustomFields: AddCustomField[] = [];
public constructor(init?: Partial<UpdateResource>) { (Object as any).assign(this, init); }
}
TypeScript UpdateResource DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=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: api.bookmore.com
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>