Skip to content

Ratings Service

Cody Ley-Han edited this page Apr 5, 2018 · 2 revisions

Types

Rating

{
    "id": {
        "description": "Unique identifier",
        "type": "string"
    },
    "ride_id": {
        "description": "ride that the rating is fore",
        "type": "string"
    },
    "rating": {
        "description": "rating of the experience",
        "type": "int",
        "minimum": 0,
        "maximum": 5
    },
    "rater_id": {
	"description": "the rater's id",
	"type": "string"
    },
    "ratee_id": {
	    "description": "the ratee's id",
        "type": "string",
    },
    "updated_at": {
        "type": "string",
        "format": "date-time in RFC3339 format"
    }
}

Endpoints

List: GET /api/v1/ratings/

Authorization: Admin

Response

{
    "data": ["Rating"]
}

Show: GET /api/v1/ratings/:id

Response

{
    "data": "Rating"
}

Create: POST /api/v1/ratings

Request

{
    "$schema": "http://json-schema.org/draft-07/schema",
    "properties": {
	    "ride_id": {
	        "description": "ride that the rating is fore",
	        "type": "string"
	    },
	    "rating": {
	        "description": "rating of the experience",
	        "type": "int",
	        "minimum": 0,
	        "maximum": 5
	    },
	    "ratee_id": {
		    "description": "the ratee's id",
	        "type": "string",
	    },
	 },
    "required": [
        "make",
        "year",
        "color"
    ]
}

Response

{
    "data": "Rating"
}

Delete: DELETE /api/v1/ratings/:id

Status Code: 204