BokaMera.API.Host

<back to all web services

UpdateRating

The following routes are available for this service:
PUT/rating/Update RatingScoreUpdate 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
{
    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 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; }
    }

    [ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)]
    public partial class UpdateRating
    {
        ///<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. Only needed when a customer, not admin
        ///</summary>
        [ApiMember(Description="The identifier for the booking, use to verify the booking. Only needed when a customer, not admin")]
        public virtual string Identifier { get; set; }

        ///<summary>
        ///The rating score between 1 and 5.
        ///</summary>
        [ApiMember(Description="The rating score between 1 and 5.")]
        public virtual int? RatingScore { get; set; }

        ///<summary>
        ///The review for the rating
        ///</summary>
        [ApiMember(Description="The review for the rating")]
        public virtual UpdateReview Review { get; set; }
    }

    public partial class UpdateReview
    {
        ///<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 answer from the company. Only the company can respond to this
        ///</summary>
        [ApiMember(Description="The review answer from the company. Only the company can respond to this")]
        public virtual string ReviewAnswer { get; set; }
    }

}

C# UpdateRating DTOs

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 /rating/ HTTP/1.1 
Host: api.bokamera.se 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<UpdateRating xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <BookingId>0</BookingId>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <Identifier>String</Identifier>
  <RatingScore>0</RatingScore>
  <Review>
    <Author>String</Author>
    <Description>String</Description>
    <ReviewAnswer>String</ReviewAnswer>
    <Title>String</Title>
  </Review>
</UpdateRating>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CompanyRatingResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <BookingId>0</BookingId>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <CreatedDate>0001-01-01T00:00:00</CreatedDate>
  <RatingScore>0</RatingScore>
  <Review>
    <Author>String</Author>
    <Created>0001-01-01T00:00:00</Created>
    <Description>String</Description>
    <RatingScore>0</RatingScore>
    <ReviewAnswer>String</ReviewAnswer>
    <Title>String</Title>
  </Review>
  <Status>0</Status>
  <UpdatedDate>0001-01-01T00:00:00</UpdatedDate>
</CompanyRatingResponse>