BokaMera.API.Host

<back to all web services

RatingQuery

The following routes are available for this service:
GET/rating/Get RatingsGet Ratings.
RatingQuery Parameters:
NameParameterData TypeRequiredDescription
CompanyIdqueryGuid?No
BookingIdqueryint?NoId of the booking
Activequerybool?NoIf you want to collect only active ratings. Ratings are only active after one has past since creation date.
IncludeRatingReviewsquerybooleanNoIf you want to include the rating reviews
CreatedFromquerydateTimeNoStart of interval to query for bookings when they where created. UTC+0 and parameter as defined by date-time - RFC3339
CreatedToquerydateTimeNoEnd of interval to query for bookings when they where created. UTC+0 and parameter as defined by date-time - RFC3339
QueryBase Parameters:
NameParameterData TypeRequiredDescription
SkipqueryintNoSkip over a given number of elements in a sequence and then return the remainder. Use this when you need paging.

Example:
?skip=10&orderBy=Id
TakequeryintNoReturn a given number of elements in a sequence and then skip over the remainder. Use this when you need paging.

Example:
?take=20
OrderByquerystringNoComma separated list of fields to order by. Prefix the field name with a minus if you wan't to invert the sort for that field.

Example:
?orderBy=Id,-Age,FirstName
OrderByDescquerystringNoComma separated list of fields to order by in descending order. Prefix the field name with a minus if you wan't to invert the sort for that field.

Example:
?orderByDesc=Id,-Age,FirstName
IncludequerystringNoInclude any of the aggregates AVG, COUNT, FIRST, LAST, MAX, MIN, SUM in your result set. The results will be returned in the meta field.

Example:
?include=COUNT(*) as Total

or multiple fields with
?include=Count(*) Total, Min(Age), AVG(Age) AverageAge

or unique with
?include=COUNT(DISTINCT LivingStatus) as UniqueStatus
FieldsformstringNo
MetaformDictionary<string, string>No
Rating Parameters:
NameParameterData TypeRequiredDescription
ReviewIdformGuid?No
ReviewformReviewNo
CompanyIdformGuidYes
BookingIdformintYes
RatingScoreformintYes
StatusformintYes
CreatedformDateTimeYes
UpdatedformDateTimeYes
ModifiedDateformDateTimeOffset?No
Review Parameters:
NameParameterData TypeRequiredDescription
ReviewIdformGuidNo
CompanyIdformGuidYes
TitleformstringYes
DescriptionformstringYes
AuthorformstringYes
StatusformintYes
CreatedformDateTimeYes
UpdatedformDateTimeYes
ModifiedDateformDateTimeOffset?No
ReviewAnswerformstringNo
CompanyRatingResponse Parameters:
NameParameterData TypeRequiredDescription
CompanyIdformGuidNo
BookingIdformintNoId of the booking
StatusformintNoThe status of the rating, 1 = Active
RatingScoreformintNoThe rating score
ReviewformRatingReviewResponseNoThe review if any exists to the rating
CreatedDateformDateTimeNo
UpdatedDateformDateTimeNo
RatingReviewResponse Parameters:
NameParameterData TypeRequiredDescription
TitleformstringNoThe title for the review
DescriptionformstringNoThe description for the review
RatingScoreformintNoThe rating score
AuthorformstringNoThe review author
CreatedformDateTimeNoThe created date
ReviewAnswerformstringNoThe review answer from the company
QueryResponse<AccessKeyTypeResponse> Parameters:
NameParameterData TypeRequiredDescription
OffsetformintNo
TotalformintNo
ResultsformList<AccessKeyTypeResponse>No
MetaformDictionary<string, string>No
ResponseStatusformResponseStatusNo
AccessKeyTypeResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
KeyTypeformstringNo
DescriptionformstringNo

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /rating/ HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Offset: 0,
	Total: 0,
	Results: 
	[
		{
			BookingId: 0,
			Status: 0,
			RatingScore: 0,
			Review: 
			{
				Title: String,
				Description: String,
				RatingScore: 0,
				Author: String,
				ReviewAnswer: String
			}
		}
	],
	Meta: 
	{
		String: String
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}