Collections API

Collection is a group of educational content or another collection, which an user can show, create, update and destroy.

Add items to collection

POST /v1/collections/:id/items

Parameters

Name Description
collection[items] Items belongs to the collection

Request

Headers

Accept: application/json
Content-Type: application/json
Access-Token: OoO6ejnLnmpeDjaVtbZfnA
Client: JOfp6G6Uq2BEWnQc2fGflg
Uid: lorna_schamberger@auer.org
Host: example.org
Cookie: 

Route

POST /v1/collections/63/items

Body

{"collection":{"items":[{"id":285,"type":"LearningObject","position":"4"}]}}

cURL

curl "https://api.portalmec.c3sl.ufpr.br/v1/collections/63/items" -d '{"collection":{"items":[{"id":285,"type":"LearningObject","position":"4"}]}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Access-Token: OoO6ejnLnmpeDjaVtbZfnA" \
	-H "Client: JOfp6G6Uq2BEWnQc2fGflg" \
	-H "Uid: lorna_schamberger@auer.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=b09pM0lEMC9qRHd3T0cwZTRFV0djWW1Jd01DVTJqWmdsQnhiRW81WTNnRFN5QktVRE92Z0htL3hyczhhTncySzlhTzdHQW1ubWx3eXBiRS8zUVo2OGZnQkxPeTdoTjlGS0Fsc0xNVnJrbVRmVGx3UE5QZ1IrQUlhY0tEZVFtenh6dHVVbUd0eUg3eWYyd0xEb1ArUHJQMGh1Ri9SV00xRGQyYU1obUw5dDE1dnFNcEUvOFdOYjVOYk9PNitkN3M0LS1VN1kzWEVDR0FQT0s2MUxOcUlIRTlBPT0%3D--4975430fb1132f024e6611ddf5926bca6595e10e; path=/; HttpOnly
Vary: Origin
ETag: W/"81e58020faab9cc055ba5731ec9d04ae"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 960df74e-2da1-4e7c-9fa5-f59567622f47
X-Runtime: 0.386602
Content-Length: 12162

Status

200 OK

Body

{
  "collection": {
    "id": 63,
    "name": "West Rondônia University",
    "curator": null,
    "created_at": "2019-03-08T13:44:27.970Z",
    "updated_at": "2019-03-08T13:44:27.970Z",
    "description": "Quibusdam pariatur rerum quo ducimus.",
    "privacy": "public",
    "score": 0.0,
    "likes_count": 0,
    "liked": false,
    "followed": false,
    "reviewed": false,
    "complained": false,
    "review_average": 0.0,
    "thumbnail": "",
    "items_thumbnails": [

    ],
    "owner": {
      "id": 3080,
      "email": "lorna_schamberger@auer.org",
      "provider": "email",
      "cpf": null,
      "name": "Bruna Corrêa",
      "description": "Fugiat sequi impedit odit omnis quasi cum et quod.",
      "submitter_request": "default",
      "education": "Qui eius aut autem.",
      "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": 1,
      "created_at": "2019-03-08T13:44:27.847Z",
      "updated_at": "2019-03-08T13:44:27.960Z",
      "terms_accepted_at": null
    },
    "tags": [
      {
        "id": 1971,
        "name": "Tag 1970",
        "created_at": "2019-03-08T13:44:28.136Z",
        "updated_at": "2019-03-08T13:44:28.136Z"
      },
      {
        "id": 1970,
        "name": "Tag 1969",
        "created_at": "2019-03-08T13:44:28.097Z",
        "updated_at": "2019-03-08T13:44:28.097Z"
      },
      {
        "id": 1969,
        "name": "Tag 1968",
        "created_at": "2019-03-08T13:44:28.058Z",
        "updated_at": "2019-03-08T13:44:28.058Z"
      },
      {
        "id": 1968,
        "name": "Tag 1967",
        "created_at": "2019-03-08T13:44:28.021Z",
        "updated_at": "2019-03-08T13:44:28.021Z"
      },
      {
        "id": 1967,
        "name": "Tag 1966",
        "created_at": "2019-03-08T13:44:27.982Z",
        "updated_at": "2019-03-08T13:44:27.982Z"
      }
    ],
    "subjects": [
      {
        "id": 19,
        "name": "Direitos Humanos",
        "created_at": "2019-03-08T13:42:18.129Z",
        "updated_at": "2019-03-08T13:42:18.129Z",
        "theme": true
      },
      {
        "id": 18,
        "name": "Outros",
        "created_at": "2019-03-08T13:42:18.125Z",
        "updated_at": "2019-03-08T13:42:18.125Z",
        "theme": false
      }
    ],
    "educational_stages": [
      {
        "id": 2,
        "name": "Ensino Fundamental I (1º até o 5º ano )",
        "created_at": "2019-03-08T13:42:18.184Z",
        "updated_at": "2019-03-08T13:42:18.184Z"
      }
    ],
    "collection_items": [
      {
        "id": 186,
        "position": 3,
        "collectionable": {
          "id": 334,
          "name": "LearningObject 334",
          "description": "Veniam cum inventore praesentium id voluptatem animi unde. Animi autem officiis quaerat ut. Optio fuga ut aut nesciunt totam. Unde quibusdam sit quae dolorum quo sunt eveniet. Ut voluptas laboriosam.",
          "author": "Dra. Matheus Ambrósio",
          "curator": null,
          "thumbnail": null,
          "object_type": "Apresentação",
          "language": {
            "id": 4,
            "name": "Francês",
            "created_at": "2019-03-08T13:42:17.273Z",
            "updated_at": "2019-03-08T13:42:17.273Z",
            "code": "fr"
          },
          "default_attachment_location": null,
          "default_attachment_id": null,
          "default_mime_type": null,
          "score": 0.641776803337422,
          "state": "published",
          "review_average": 0.0,
          "link": null,
          "software": null,
          "license": null,
          "liked": false,
          "likes_count": 0,
          "downloads_count": 0,
          "views_count": 0,
          "reviewed": false,
          "complained": false,
          "shares_count": 0,
          "created_at": "2019-03-08T13:44:28.573Z",
          "published_at": null,
          "terms_of_service": null,
          "updated_at": "2019-03-08T13:44:28.573Z",
          "magnetlink": null,
          "publisher": {
            "id": 3094,
            "email": null,
            "provider": "email",
            "cpf": null,
            "name": "Pedro Ribeiro",
            "description": "Et autem quia architecto cumque sit eos fugit.",
            "submitter_request": "default",
            "education": "Deserunt aut sed expedita.",
            "score": 0.0,
            "cover": "",
            "role_ids": [
              1
            ],
            "institution_ids": [

            ],
            "avatar": "",
            "dspace_url": null,
            "dspace_handle": null,
            "dspace_sets": null,
            "likes_count": 0,
            "followed": false,
            "complained": false,
            "follows_count": 0,
            "learning_objects_count": 1,
            "collections_count": 0,
            "created_at": "2019-03-08T13:44:28.553Z",
            "updated_at": "2019-03-08T13:44:28.553Z",
            "terms_accepted_at": null
          },
          "tags": [
            {
              "id": 1981,
              "name": "Tag 1980",
              "created_at": "2019-03-08T13:44:28.703Z",
              "updated_at": "2019-03-08T13:44:28.703Z"
            },
            {
              "id": 1980,
              "name": "Tag 1979",
              "created_at": "2019-03-08T13:44:28.673Z",
              "updated_at": "2019-03-08T13:44:28.673Z"
            },
            {
              "id": 1979,
              "name": "Tag 1978",
              "created_at": "2019-03-08T13:44:28.643Z",
              "updated_at": "2019-03-08T13:44:28.643Z"
            },
            {
              "id": 1978,
              "name": "Tag 1977",
              "created_at": "2019-03-08T13:44:28.613Z",
              "updated_at": "2019-03-08T13:44:28.613Z"
            },
            {
              "id": 1977,
              "name": "Tag 1976",
              "created_at": "2019-03-08T13:44:28.583Z",
              "updated_at": "2019-03-08T13:44:28.583Z"
            }
          ],
          "subjects": [
            {
              "id": 10,
              "name": "Física",
              "created_at": "2019-03-08T13:42:18.089Z",
              "updated_at": "2019-03-08T13:42:18.089Z",
              "theme": false
            },
            {
              "id": 21,
              "name": "Educação do Campo",
              "created_at": "2019-03-08T13:42:18.141Z",
              "updated_at": "2019-03-08T13:42:18.141Z",
              "theme": true
            }
          ],
          "educational_stages": [
            {
              "id": 1,
              "name": "Educação Infantil",
              "created_at": "2019-03-08T13:42:18.179Z",
              "updated_at": "2019-03-08T13:42:18.179Z"
            }
          ],
          "attachments": [

          ]
        },
        "collectionable_type": "LearningObject"
      },
      {
        "id": 188,
        "position": 4,
        "collectionable": {
          "id": 285,
          "name": "LearningObject 285",
          "description": "Sit aut similique qui voluptatum. Tempora iste sequi molestiae. Quo inventore assumenda dolores. Ut magnam enim.",
          "author": "Lavínia Ambrósio",
          "curator": null,
          "thumbnail": null,
          "object_type": "Outros",
          "language": {
            "id": 9,
            "name": "Japonês",
            "created_at": "2019-03-08T13:42:17.293Z",
            "updated_at": "2019-03-08T13:42:17.293Z",
            "code": "jp"
          },
          "default_attachment_location": null,
          "default_attachment_id": null,
          "default_mime_type": null,
          "score": 0.745579223048554,
          "state": "published",
          "review_average": 0.0,
          "link": null,
          "software": null,
          "license": null,
          "liked": false,
          "likes_count": 0,
          "downloads_count": 0,
          "views_count": 0,
          "reviewed": false,
          "complained": false,
          "shares_count": 0,
          "created_at": "2019-03-08T13:44:09.694Z",
          "published_at": null,
          "terms_of_service": null,
          "updated_at": "2019-03-08T13:44:09.694Z",
          "magnetlink": null,
          "publisher": {
            "id": 2630,
            "email": null,
            "provider": "email",
            "cpf": null,
            "name": "Sr. Lívia Duarte",
            "description": "Consequatur sed et excepturi exercitationem libero incidunt non.",
            "submitter_request": "default",
            "education": "Minus nemo iste eos veniam beatae ullam est.",
            "score": 0.0,
            "cover": "",
            "role_ids": [
              1
            ],
            "institution_ids": [

            ],
            "avatar": "",
            "dspace_url": null,
            "dspace_handle": null,
            "dspace_sets": null,
            "likes_count": 0,
            "followed": false,
            "complained": false,
            "follows_count": 0,
            "learning_objects_count": 1,
            "collections_count": 0,
            "created_at": "2019-03-08T13:44:09.678Z",
            "updated_at": "2019-03-08T13:44:09.678Z",
            "terms_accepted_at": null
          },
          "tags": [
            {
              "id": 1676,
              "name": "Tag 1675",
              "created_at": "2019-03-08T13:44:09.838Z",
              "updated_at": "2019-03-08T13:44:09.838Z"
            },
            {
              "id": 1675,
              "name": "Tag 1674",
              "created_at": "2019-03-08T13:44:09.805Z",
              "updated_at": "2019-03-08T13:44:09.805Z"
            },
            {
              "id": 1674,
              "name": "Tag 1673",
              "created_at": "2019-03-08T13:44:09.771Z",
              "updated_at": "2019-03-08T13:44:09.771Z"
            },
            {
              "id": 1673,
              "name": "Tag 1672",
              "created_at": "2019-03-08T13:44:09.737Z",
              "updated_at": "2019-03-08T13:44:09.737Z"
            },
            {
              "id": 1672,
              "name": "Tag 1671",
              "created_at": "2019-03-08T13:44:09.704Z",
              "updated_at": "2019-03-08T13:44:09.704Z"
            }
          ],
          "subjects": [
            {
              "id": 4,
              "name": "Arte",
              "created_at": "2019-03-08T13:42:18.061Z",
              "updated_at": "2019-03-08T13:42:18.061Z",
              "theme": false
            },
            {
              "id": 25,
              "name": "Educação Sexual",
              "created_at": "2019-03-08T13:42:18.158Z",
              "updated_at": "2019-03-08T13:42:18.158Z",
              "theme": true
            }
          ],
          "educational_stages": [
            {
              "id": 6,
              "name": "Outros",
              "created_at": "2019-03-08T13:42:18.200Z",
              "updated_at": "2019-03-08T13:42:18.200Z"
            }
          ],
          "attachments": [

          ]
        },
        "collectionable_type": "LearningObject"
      },
      {
        "id": 185,
        "position": 5,
        "collectionable": {
          "id": 333,
          "name": "LearningObject 333",
          "description": "Qui laudantium facilis necessitatibus perspiciatis. Deserunt adipisci aut aliquid ut facere numquam nostrum. Quod similique libero quia labore quo enim quasi.",
          "author": "Breno Jesus Filho",
          "curator": null,
          "thumbnail": null,
          "object_type": "Áudio",
          "language": {
            "id": 4,
            "name": "Francês",
            "created_at": "2019-03-08T13:42:17.273Z",
            "updated_at": "2019-03-08T13:42:17.273Z",
            "code": "fr"
          },
          "default_attachment_location": null,
          "default_attachment_id": null,
          "default_mime_type": null,
          "score": 0.142354488661022,
          "state": "published",
          "review_average": 0.0,
          "link": null,
          "software": null,
          "license": null,
          "liked": false,
          "likes_count": 0,
          "downloads_count": 0,
          "views_count": 0,
          "reviewed": false,
          "complained": false,
          "shares_count": 0,
          "created_at": "2019-03-08T13:44:28.213Z",
          "published_at": null,
          "terms_of_service": null,
          "updated_at": "2019-03-08T13:44:28.213Z",
          "magnetlink": null,
          "publisher": {
            "id": 3086,
            "email": null,
            "provider": "email",
            "cpf": null,
            "name": "Letícia Neves",
            "description": "Placeat aspernatur sed voluptate et error sed odit tempora.",
            "submitter_request": "default",
            "education": "Debitis placeat sapiente repellat ducimus ab tempore.",
            "score": 0.0,
            "cover": "",
            "role_ids": [
              1
            ],
            "institution_ids": [

            ],
            "avatar": "",
            "dspace_url": null,
            "dspace_handle": null,
            "dspace_sets": null,
            "likes_count": 0,
            "followed": false,
            "complained": false,
            "follows_count": 0,
            "learning_objects_count": 1,
            "collections_count": 0,
            "created_at": "2019-03-08T13:44:28.192Z",
            "updated_at": "2019-03-08T13:44:28.192Z",
            "terms_accepted_at": null
          },
          "tags": [
            {
              "id": 1976,
              "name": "Tag 1975",
              "created_at": "2019-03-08T13:44:28.368Z",
              "updated_at": "2019-03-08T13:44:28.368Z"
            },
            {
              "id": 1975,
              "name": "Tag 1974",
              "created_at": "2019-03-08T13:44:28.331Z",
              "updated_at": "2019-03-08T13:44:28.331Z"
            },
            {
              "id": 1974,
              "name": "Tag 1973",
              "created_at": "2019-03-08T13:44:28.293Z",
              "updated_at": "2019-03-08T13:44:28.293Z"
            },
            {
              "id": 1973,
              "name": "Tag 1972",
              "created_at": "2019-03-08T13:44:28.259Z",
              "updated_at": "2019-03-08T13:44:28.259Z"
            },
            {
              "id": 1972,
              "name": "Tag 1971",
              "created_at": "2019-03-08T13:44:28.226Z",
              "updated_at": "2019-03-08T13:44:28.226Z"
            }
          ],
          "subjects": [
            {
              "id": 10,
              "name": "Física",
              "created_at": "2019-03-08T13:42:18.089Z",
              "updated_at": "2019-03-08T13:42:18.089Z",
              "theme": false
            },
            {
              "id": 21,
              "name": "Educação do Campo",
              "created_at": "2019-03-08T13:42:18.141Z",
              "updated_at": "2019-03-08T13:42:18.141Z",
              "theme": true
            }
          ],
          "educational_stages": [
            {
              "id": 3,
              "name": "Ensino Fundamental II  (do 6º até o 9º ano)",
              "created_at": "2019-03-08T13:42:18.188Z",
              "updated_at": "2019-03-08T13:42:18.188Z"
            }
          ],
          "attachments": [

          ]
        },
        "collectionable_type": "LearningObject"
      },
      {
        "id": 187,
        "position": 8,
        "collectionable": {
          "id": 335,
          "name": "LearningObject 335",
          "description": "Adipisci sunt inventore dolore veniam. Qui sit ipsa. Quibusdam enim ex sed. Velit consequatur id molestiae veniam nisi excepturi.",
          "author": "Júlio Aragão",
          "curator": null,
          "thumbnail": null,
          "object_type": "Software Educacional",
          "language": {
            "id": 3,
            "name": "Espanhol",
            "created_at": "2019-03-08T13:42:17.268Z",
            "updated_at": "2019-03-08T13:42:17.268Z",
            "code": "es"
          },
          "default_attachment_location": null,
          "default_attachment_id": null,
          "default_mime_type": null,
          "score": 0.867738822372869,
          "state": "published",
          "review_average": 0.0,
          "link": null,
          "software": null,
          "license": null,
          "liked": false,
          "likes_count": 0,
          "downloads_count": 0,
          "views_count": 0,
          "reviewed": false,
          "complained": false,
          "shares_count": 0,
          "created_at": "2019-03-08T13:44:28.895Z",
          "published_at": null,
          "terms_of_service": null,
          "updated_at": "2019-03-08T13:44:28.895Z",
          "magnetlink": null,
          "publisher": {
            "id": 3102,
            "email": null,
            "provider": "email",
            "cpf": null,
            "name": "Ana Novaes Jr.",
            "description": "Ut repellat illo in.",
            "submitter_request": "default",
            "education": "Ea ipsum nulla quod.",
            "score": 0.0,
            "cover": "",
            "role_ids": [
              1
            ],
            "institution_ids": [

            ],
            "avatar": "",
            "dspace_url": null,
            "dspace_handle": null,
            "dspace_sets": null,
            "likes_count": 0,
            "followed": false,
            "complained": false,
            "follows_count": 0,
            "learning_objects_count": 1,
            "collections_count": 0,
            "created_at": "2019-03-08T13:44:28.876Z",
            "updated_at": "2019-03-08T13:44:28.876Z",
            "terms_accepted_at": null
          },
          "tags": [
            {
              "id": 1986,
              "name": "Tag 1985",
              "created_at": "2019-03-08T13:44:29.027Z",
              "updated_at": "2019-03-08T13:44:29.027Z"
            },
            {
              "id": 1985,
              "name": "Tag 1984",
              "created_at": "2019-03-08T13:44:28.998Z",
              "updated_at": "2019-03-08T13:44:28.998Z"
            },
            {
              "id": 1984,
              "name": "Tag 1983",
              "created_at": "2019-03-08T13:44:28.968Z",
              "updated_at": "2019-03-08T13:44:28.968Z"
            },
            {
              "id": 1983,
              "name": "Tag 1982",
              "created_at": "2019-03-08T13:44:28.938Z",
              "updated_at": "2019-03-08T13:44:28.938Z"
            },
            {
              "id": 1982,
              "name": "Tag 1981",
              "created_at": "2019-03-08T13:44:28.906Z",
              "updated_at": "2019-03-08T13:44:28.906Z"
            }
          ],
          "subjects": [
            {
              "id": 21,
              "name": "Educação do Campo",
              "created_at": "2019-03-08T13:42:18.141Z",
              "updated_at": "2019-03-08T13:42:18.141Z",
              "theme": true
            },
            {
              "id": 6,
              "name": "Ciências da Natureza",
              "created_at": "2019-03-08T13:42:18.071Z",
              "updated_at": "2019-03-08T13:42:18.071Z",
              "theme": false
            }
          ],
          "educational_stages": [
            {
              "id": 5,
              "name": "Ensino Superior",
              "created_at": "2019-03-08T13:42:18.196Z",
              "updated_at": "2019-03-08T13:42:18.196Z"
            }
          ],
          "attachments": [

          ]
        },
        "collectionable_type": "LearningObject"
      }
    ]
  },
  "errors": [

  ]
}