Reviews API

Review is a note for educational content or collections, made by users.

Creating a Review

POST /v1/:type/:id/reviews

Parameters

Name Description
id The id of object
type type of object ['learning_objects', 'collections']
review[name] The title of review
review[description] A short description
review[pros] Pros description
review[cons] Cons description
review[review_ratings_attributes] Ratings of attributes belonging to the review

Request

Headers

Accept: application/json
Content-Type: application/json
Access-Token: _5FKXHcoDHgj4QGA9M_4KQ
Client: s2ko1b94wivtni3hcAkJIA
Uid: boyd@christiansen.co
Host: example.org
Cookie: 

Route

POST /v1/learning_objects/849/reviews

Body

{"review":{"name":"eligendi","description":"Necessitatibus debitis sunt eum cupiditate.","pros":"Aut dolorem rem corrupti voluptas omnis soluta quo quos.","cons":"Libero temporibus neque ut sequi.","review_ratings_attributes":[{"rating_id":1,"value":3}]}}

cURL

curl "https://api.portalmec.c3sl.ufpr.br/v1/learning_objects/849/reviews" -d '{"review":{"name":"eligendi","description":"Necessitatibus debitis sunt eum cupiditate.","pros":"Aut dolorem rem corrupti voluptas omnis soluta quo quos.","cons":"Libero temporibus neque ut sequi.","review_ratings_attributes":[{"rating_id":1,"value":3}]}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Access-Token: _5FKXHcoDHgj4QGA9M_4KQ" \
	-H "Client: s2ko1b94wivtni3hcAkJIA" \
	-H "Uid: boyd@christiansen.co"

Response

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Type: application/json; charset=utf-8
Set-Cookie: _session_id=bHhXdlJJQ0IxTXBhUHN1UVJsTVhjY0VNQXNqNmVZbjlTWXVCSXRYK1ZydmRHcEtSNmVlNmk1aE5DbExaSExGRnE1bXRvV3RnLzNhSm40TFFSdVQxTUxUOVMrLzFHRXlLY1BCbXBFTUJhazFZUTRzRFhPOVhDdDFrY1I5TWFqOER0NDlLdFQ3RFM3cjBGZVlqbExQUkhPVHRZS1Y3N2RoQmhwMVVFdFVuT1Z5dnovV3BrTE5UdkVwWVloT1QrdUlYLS0vaVRyQTBqMUtmYTFzMTVISW9zWEVnPT0%3D--899e52587e89dcbb2f1b36aace8595090982086a; path=/; HttpOnly
Vary: Origin
ETag: W/"b4dc3097318abec573b8e07d0a68d18b"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 69278435-88b0-4db7-87bc-86d03c71d338
X-Runtime: 0.196963
Content-Length: 1988

Status

201 Created

Body

{
  "id": 1719,
  "name": "eligendi",
  "description": "Necessitatibus debitis sunt eum cupiditate.",
  "pros": "Aut dolorem rem corrupti voluptas omnis soluta quo quos.",
  "cons": "Libero temporibus neque ut sequi.",
  "rating_average": 3.0,
  "rates_count": 0,
  "created_at": "2019-03-08T13:48:00.045Z",
  "updated_at": "2019-03-08T13:48:00.045Z",
  "reviewable": {
    "object_type_id": 12,
    "id": 849,
    "attachment_id": null,
    "state": "published",
    "review_average": 1.0,
    "thumbnail_file_name": null,
    "thumbnail_content_type": null,
    "name": "LearningObject 848",
    "publisher_id": 7660,
    "publisher_type": "User",
    "language_id": 7,
    "author": "Srta. Beatriz Moreira",
    "terms_of_service": null,
    "id_dspace": 848,
    "description": "Autem odio facere. Ut optio ducimus aperiam ut labore quae dolorem. Consequatur iure aut dolores. Exercitationem adipisci quisquam earum dolorum magnam animi libero. Natus tempore sunt.",
    "published_at": null,
    "score": 0.334690656424912,
    "metadata": [

    ],
    "created_at": "2019-03-08T13:47:55.849Z",
    "updated_at": "2019-03-08T13:48:00.073Z",
    "views_count": 0,
    "downloads_count": 0,
    "likes_count": 0,
    "shares_count": 0,
    "thumbnail_file_size": null,
    "thumbnail_updated_at": null,
    "deleted_at": null,
    "license_id": null,
    "link": null,
    "software": null,
    "curator": null,
    "magnetlink": null
  },
  "reviewable_type": "LearningObject",
  "rated": false,
  "approves": null,
  "review_ratings": [
    {
      "id": 1,
      "review_id": 1719,
      "rating_id": 1,
      "rating_name": "Contexto de Aplicação",
      "value": 3
    }
  ],
  "user": {
    "id": 7756,
    "email": "boyd@christiansen.co",
    "provider": "email",
    "cpf": null,
    "name": "Sr. Pablo Moreira",
    "description": "Est qui quia provident praesentium voluptas fuga dolorem.",
    "submitter_request": "default",
    "education": "Eius quo et quia culpa occaecati.",
    "score": 0.0,
    "cover": "",
    "role_ids": [
      1,
      1
    ],
    "institution_ids": [

    ],
    "avatar": "",
    "dspace_url": null,
    "dspace_handle": null,
    "dspace_sets": [

    ],
    "likes_count": 0,
    "followed": false,
    "complained": false,
    "follows_count": 0,
    "learning_objects_count": 0,
    "collections_count": 0,
    "created_at": "2019-03-08T13:47:59.831Z",
    "updated_at": "2019-03-08T13:47:59.925Z",
    "terms_accepted_at": null
  }
}