Complaints API

With complaint an user may report a learning object or collection with inappropriate content.

Creating a complaint

POST /v1/complaints

Parameters

Name Description
complaint[user_id] The id of user
complaint[description] The description of the complaint
complaint[complainable_id] The id of the complainable [LearningObject, Review, User, Collection]
complaint[complainable_type] Represents a type of the complainable [LearningObject, Review, User, Collection]
complaint[complaint_reason_id] Id of the reason of the complaint

Request

Headers

Accept: application/json
Content-Type: application/json
Access-Token: IPSPxcvmayXaj4th4jZHRQ
Client: 2yJ3qhLYixxuh6TfJsG1-Q
Uid: trycia@fisher.org
Host: example.org
Cookie: 

Route

POST /v1/complaints

Body

{"complaint":{"user_id":5899,"description":"Voluptas ratione nulla officia.","complainable_id":610,"complainable_type":"LearningObject","complaint_reason_id":1}}

cURL

curl "https://api.portalmec.c3sl.ufpr.br/v1/complaints" -d '{"complaint":{"user_id":5899,"description":"Voluptas ratione nulla officia.","complainable_id":610,"complainable_type":"LearningObject","complaint_reason_id":1}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Access-Token: IPSPxcvmayXaj4th4jZHRQ" \
	-H "Client: 2yJ3qhLYixxuh6TfJsG1-Q" \
	-H "Uid: trycia@fisher.org"

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=WDNmenBNc2V1SHh2Q1p5WXpPVEJsbHU0Z05Wa01Ta0pxSnFEbm9odlV6QWh4emxvbG4rcktCbFZPSWtOS1AwbXlibVo1UXpJa2IrZU9mNkxLblJteE5yWUFMZ1R6OGk5OENISjJwbHZoZjQ5L3JyTU5OU3Uzb3FpTSt1eDdWRFhubGJ4OG4zaUp4YU5xSWpFWVVISmNpZUZTazNNeWExcmlLYWU3ZnFjTlhyR3h5eXgvYzAza0lVeDVIMTNJdjAxLS0xNGZDdGE3NVFHSkgxY2dOM01HdDJ3PT0%3D--300c3fc47a2b39dc484c732b300fd61d1752d3e6; path=/; HttpOnly
Vary: Origin
ETag: W/"0bb549be091fea9a8bfb3e318ac2bf54"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 2630f262-0c54-4b78-98ff-7a58f502e2fd
X-Runtime: 0.578277
Content-Length: 253

Status

201 Created

Body

{
  "id": 25,
  "description": "Voluptas ratione nulla officia.",
  "user_id": 5899,
  "complainable_type": "LearningObject",
  "complainable_id": 610,
  "complaint_reason_id": 1,
  "created_at": "2019-03-08T13:46:29.458Z",
  "updated_at": "2019-03-08T13:46:29.458Z",
  "deleted_at": null
}