Bookmarks API

Bookmark is a relation between user and object called ‘Favoritos’, which are educational contents or collections. Bookmarks do not have an index for itens.

Adding a bookmark

POST v1/users/:user_id/bookmarks

Parameters

Name Description
user_id The user id
bookmarks[id] The id of the object
bookmarks[type] Represents the type of bookmark, [ LearningObject, Collection]

Request

Headers

Accept: application/json
Content-Type: application/json
Access-Token: SRvnvA5b8h2cnTsL7rZihA
Client: Mg5zQ57OEQFmJblz93XUjQ
Uid: odie_hackett@croninlockman.info
Host: example.org
Cookie: 

Route

POST v1/users/671/bookmarks

Body

{"bookmarks":{"id":66,"type":"LearningObject"}}

cURL

curl "https://api.portalmec.c3sl.ufpr.brv1/users/671/bookmarks" -d '{"bookmarks":{"id":66,"type":"LearningObject"}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Access-Token: SRvnvA5b8h2cnTsL7rZihA" \
	-H "Client: Mg5zQ57OEQFmJblz93XUjQ" \
	-H "Uid: odie_hackett@croninlockman.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=YmswVkRkRkJTWG5xZHlFNTU5VFp2TWJzZmRtYkFUL1oxY1dPOWNSVTJrckthaDJjakt1Yng0c1pFZlk4MlpFZVptbkIrK1NPSnJLUXYyaWluYkQrMmtDc2Y1cW53ZjRhUm16bmMvSmh0b295YjFrVjJEdTVCa0E3VjF5MmpzdzhUOCtCUjMzQ1BEUXJaS1I3MVJ4YnZBaUozUUtWT0kzdERhSWU1L3diMFdHdUVSazUvaFBmSlVwallMNkZWRFJJLS13eCtwR2I3bVRFdy9oYVppN052QkF3PT0%3D--a3dd117695b992cc36c6f6105bf1f4f972fa3f82; path=/; HttpOnly
Vary: Origin
ETag: W/"aa8a6a3eb62a9bf4f2ed201d847a9534"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 41d040f4-2fe1-421c-8327-eb0469a3614d
X-Runtime: 0.127713
Content-Length: 160

Status

201 Created

Body

{
  "id": 2,
  "user_id": 671,
  "bookmarkable_type": "LearningObject",
  "bookmarkable_id": 66,
  "created_at": "2019-03-08T13:42:45.970Z",
  "updated_at": "2019-03-08T13:42:45.970Z"
}