POST | /rating/ | Create RatingScore | Create rating from booking |
---|
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
{
[ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)]
public partial class AddRating
{
///<summary>
///
///</summary>
[ApiMember(Description="", IsRequired=true)]
public virtual Guid CompanyId { get; set; }
///<summary>
///Id of the booking
///</summary>
[ApiMember(Description="Id of the booking", IsRequired=true)]
public virtual int BookingId { get; set; }
///<summary>
///The identifier for the booking, use to verify the booking.
///</summary>
[ApiMember(Description="The identifier for the booking, use to verify the booking.", IsRequired=true)]
public virtual string Identifier { get; set; }
///<summary>
///The rating score between 1 and 5.
///</summary>
[ApiMember(Description="The rating score between 1 and 5.", IsRequired=true)]
public virtual int RatingScore { get; set; }
///<summary>
///The review for the rating
///</summary>
[ApiMember(Description="The review for the rating")]
public virtual CreateReview Review { get; set; }
}
public partial class CompanyRatingResponse
{
///<summary>
///
///</summary>
[ApiMember(Description="")]
public virtual Guid CompanyId { get; set; }
///<summary>
///Id of the booking
///</summary>
[ApiMember(Description="Id of the booking")]
public virtual int BookingId { get; set; }
///<summary>
///The status of the rating, 1 = Active
///</summary>
[ApiMember(Description="The status of the rating, 1 = Active")]
public virtual int Status { get; set; }
///<summary>
///The rating score
///</summary>
[ApiMember(Description="The rating score")]
public virtual int RatingScore { get; set; }
///<summary>
///The review if any exists to the rating
///</summary>
[ApiMember(Description="The review if any exists to the rating")]
public virtual RatingReviewResponse Review { get; set; }
public virtual DateTime CreatedDate { get; set; }
public virtual DateTime UpdatedDate { get; set; }
}
public partial class CreateReview
{
///<summary>
///The title for the review
///</summary>
[ApiMember(Description="The title for the review")]
public virtual string Title { get; set; }
///<summary>
///The description for the review
///</summary>
[ApiMember(Description="The description for the review")]
public virtual string Description { get; set; }
///<summary>
///The review author
///</summary>
[ApiMember(Description="The review author")]
public virtual string Author { get; set; }
///<summary>
///The review author
///</summary>
[ApiMember(Description="The review author")]
public virtual string ReviewAnswer { get; set; }
}
public partial class RatingReviewResponse
{
///<summary>
///The title for the review
///</summary>
[ApiMember(Description="The title for the review")]
public virtual string Title { get; set; }
///<summary>
///The description for the review
///</summary>
[ApiMember(Description="The description for the review")]
public virtual string Description { get; set; }
///<summary>
///The rating score
///</summary>
[ApiMember(Description="The rating score")]
public virtual int RatingScore { get; set; }
///<summary>
///The review author
///</summary>
[ApiMember(Description="The review author")]
public virtual string Author { get; set; }
///<summary>
///The created date
///</summary>
[ApiMember(Description="The created date")]
public virtual DateTime Created { get; set; }
///<summary>
///The review answer from the company
///</summary>
[ApiMember(Description="The review answer from the company")]
public virtual string ReviewAnswer { get; set; }
}
}
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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /rating/ HTTP/1.1
Host: api.bokamera.se
Accept: application/json
Content-Type: application/json
Content-Length: length
{"BookingId":0,"Identifier":"String","RatingScore":0,"Review":{"Title":"String","Description":"String","Author":"String","ReviewAnswer":"String"}}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"BookingId":0,"Status":0,"RatingScore":0,"Review":{"Title":"String","Description":"String","RatingScore":0,"Author":"String","ReviewAnswer":"String"}}