POST | /bookinglog | Add a new event to booking log | Add a new event to the booking of the company of the currently logged in user, only administrators are allowed to add items to event log. |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using BokaMera.API.ServiceModel.Dtos;
namespace BokaMera.API.ServiceModel.Dtos
{
public partial class BookingLogEventTypeResponse
{
///<summary>
///The event type id
///</summary>
[ApiMember(Description="The event type id")]
public virtual int Id { get; set; }
///<summary>
///The event type name
///</summary>
[ApiMember(Description="The event type name")]
public virtual string Name { get; set; }
///<summary>
///The event type description
///</summary>
[ApiMember(Description="The event type description")]
public virtual string Description { get; set; }
}
public partial class BookingLogQueryResponse
{
///<summary>
///The booking log id
///</summary>
[ApiMember(Description="The booking log id")]
public virtual int Id { get; set; }
///<summary>
///The booking id
///</summary>
[ApiMember(Description="The booking id")]
public virtual int BookingId { get; set; }
///<summary>
///The type of event
///</summary>
[ApiMember(Description="The type of event")]
public virtual int EventTypeId { get; set; }
///<summary>
///The type of event
///</summary>
[ApiMember(Description="The type of event")]
public virtual BookingLogEventTypeResponse EventType { get; set; }
///<summary>
///Comments that could be added to the event log item
///</summary>
[ApiMember(Description="Comments that could be added to the event log item")]
public virtual string Comments { get; set; }
///<summary>
///The user created the event
///</summary>
[ApiMember(Description="The user created the event")]
public virtual string UserName { get; set; }
///<summary>
///Then date when the event occured
///</summary>
[ApiMember(Description="Then date when the event occured")]
public virtual DateTime Created { get; set; }
}
[ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)]
[ApiResponse(Description="You have too low privilegies to call this service", StatusCode=403)]
public partial class CreateBookingLogItem
: ICompany
{
///<summary>
///The company id, if empty will use the company id for the user you are logged in with.
///</summary>
[ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")]
public virtual Guid? CompanyId { get; set; }
///<summary>
///The booking id
///</summary>
[ApiMember(Description="The booking id", IsRequired=true)]
public virtual int BookingId { get; set; }
///<summary>
///The type of event
///</summary>
[ApiMember(Description="The type of event", IsRequired=true)]
public virtual int EventTypeId { get; set; }
///<summary>
///Comments that could be added to the event log item
///</summary>
[ApiMember(Description="Comments that could be added to the event log item", IsRequired=true)]
public virtual string Comments { get; set; }
///<summary>
///Then date when the event occured, leave blank if current datetime
///</summary>
[ApiMember(Description="Then date when the event occured, leave blank if current datetime", IsRequired=true)]
public virtual DateTime? Created { get; set; }
}
}
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.
POST /bookinglog HTTP/1.1
Host: api.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CreateBookingLogItem xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<BookingId>0</BookingId>
<Comments>String</Comments>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<Created>0001-01-01T00:00:00</Created>
<EventTypeId>0</EventTypeId>
</CreateBookingLogItem>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <BookingLogQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <BookingId>0</BookingId> <Comments>String</Comments> <Created>0001-01-01T00:00:00</Created> <EventType> <Description>String</Description> <Id>0</Id> <Name>String</Name> </EventType> <EventTypeId>0</EventTypeId> <Id>0</Id> <UserName>String</UserName> </BookingLogQueryResponse>