Reviews API

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

Updating a Review

PUT /v1/:type/:id/reviews/:review_id

Parameters

Name Description
id The id of object
review_id The id of review
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: d8wwkj8u7650yB2M_52UWQ
Client: 0MKwaGWibp613Itk_ntXzg
Uid: kacie_hyatt@satterfield.info
Host: example.org
Cookie: 

Route

PUT /v1/learning_objects/861/reviews/1744

Body

{"review":{"name":"ea","description":"Aut ipsa voluptatem ut autem.","pros":"Earum dolor vel officiis et sit quod.","cons":"Sint at sunt fugit delectus sit.","review_ratings_attributes":[{"rating_id":1,"value":3}]}}

cURL

curl "https://api.portalmec.c3sl.ufpr.br/v1/learning_objects/861/reviews/1744" -d '{"review":{"name":"ea","description":"Aut ipsa voluptatem ut autem.","pros":"Earum dolor vel officiis et sit quod.","cons":"Sint at sunt fugit delectus sit.","review_ratings_attributes":[{"rating_id":1,"value":3}]}}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Access-Token: d8wwkj8u7650yB2M_52UWQ" \
	-H "Client: 0MKwaGWibp613Itk_ntXzg" \
	-H "Uid: kacie_hyatt@satterfield.info"

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=aytuSHdJR0NPai9qcmh6aXg2VDlYWEJaS05WK0pSd1VGSnFEbDU5bVNLUm9HTmViWjlUNmh3d2o3ZjBmRFo5czRhWlI4cnlWcHRGZW10cTJTQi9WRzdOWDNoMFI3NTdaN1RibGUxNFpaQ3h2OE1TOWdZQVJYbzZyd3FabE5ET3hWcFZzNVZVYlNYcy9OcGptZXovN2lJRmM0M2hwQkdwRzk0TU1wVUo2NFFwaERWNWtQQ2tEbzQxWXREbXllemIxLS14andpKzVOMFZBaDlFNHg4czloci9BPT0%3D--348b1f283eded0ea1fee25b5a7ab3b0b60dd5cc2; path=/; HttpOnly
Vary: Origin
ETag: W/"ff6a0022fe03be21713f43db528097be"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: b76dd995-d5e4-4c46-8865-ab9d2953d46a
X-Runtime: 0.151486
Content-Length: 1806

Status

200 OK

Body

{
  "id": 1744,
  "name": "ea",
  "description": "Aut ipsa voluptatem ut autem.",
  "pros": "Earum dolor vel officiis et sit quod.",
  "cons": "Sint at sunt fugit delectus sit.",
  "rating_average": 0.0,
  "rates_count": 0,
  "created_at": "2019-03-08T13:48:04.295Z",
  "updated_at": "2019-03-08T13:48:04.416Z",
  "reviewable": {
    "object_type_id": 7,
    "id": 861,
    "attachment_id": null,
    "state": "published",
    "review_average": 0.0,
    "thumbnail_file_name": null,
    "thumbnail_content_type": null,
    "name": "LearningObject 860",
    "publisher_id": 7757,
    "publisher_type": "User",
    "language_id": 4,
    "author": "Daniel Cruz",
    "terms_of_service": null,
    "id_dspace": 860,
    "description": "Ab odio nulla omnis dolorum. At iure qui debitis. Sit id earum facilis. Totam ipsam veniam eum dolorum sit. Odit porro dolores libero.",
    "published_at": null,
    "score": 0.193007080536974,
    "metadata": [

    ],
    "created_at": "2019-03-08T13:48:00.175Z",
    "updated_at": "2019-03-08T13:48:00.175Z",
    "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": [

  ],
  "user": {
    "id": 7853,
    "email": "kacie_hyatt@satterfield.info",
    "provider": "email",
    "cpf": null,
    "name": "Sr. Gabriela Lopes",
    "description": "Error ut incidunt ducimus iste quia ad.",
    "submitter_request": "default",
    "education": "Consectetur laudantium est in delectus aperiam qui.",
    "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:48:04.186Z",
    "updated_at": "2019-03-08T13:48:04.281Z",
    "terms_accepted_at": null
  }
}