### GET Request for Second 10 Resources (Pagination) Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest This example illustrates retrieving the second set of 10 resources from a collection by using both 'limit' and 'offset' parameters. The 'offset' parameter specifies the starting index for the results. ```http GET https://imsglobal.org/ims/oneroster/resources/v1p2/resources?limit=10&offset=10 ``` -------------------------------- ### GET Request for First 10 Resources (Pagination) Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest This example demonstrates how to retrieve the first 10 resources from a collection using the 'limit' parameter. It is part of the pagination mechanism to manage large datasets. ```http GET https://imsglobal.org/ims/oneroster/resources/v1p2/resources?limit=10 ``` -------------------------------- ### getResourcesForCourse - Success Response Example (JSON) Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest This JSON payload example demonstrates a successful '200' response for the 'getResourcesForCourse' operation, listing resources linked to a specific course. ```json { "@context": [ "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld" ], "@id": "https://api.example.com/v1.2/courses/courseId1/resources", "resourceSitelist": [ { "@id": "https://api.example.com/v1.2/resources/uuid1", "title": "Resource Title 1", "resourceType": "Resource Type 1", "url": "http://www.example.com/resource1", "vendorId": "vendor1", "vendorName": "Vendor Name 1", "applicationId": "app1", "applicationName": "Application Name 1", "description": "Description of Resource 1", "language": "en-US", "learningStandardIds": [ "lsid1", "lsid2" ], "learningResourceTypeId": "lr type id 1", "copyrightOwner": "Copyright Owner 1", "copyrightYear": 2023, "titleLanguage": "en-US", "descriptionLanguage": "en-US" } ] } ``` -------------------------------- ### getAllResources - Success Response Example (JSON) Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest This JSON payload example demonstrates a successful '200' response for the 'getAllResources' operation. It includes a list of resources with their associated properties. ```json { "@context": [ "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld" ], "@id": "https://api.example.com/v1.2/getAllResources", "resourceSitelist": [ { "@id": "https://api.example.com/v1.2/resources/uuid1", "title": "Resource Title 1", "resourceType": "Resource Type 1", "url": "http://www.example.com/resource1", "vendorId": "vendor1", "vendorName": "Vendor Name 1", "applicationId": "app1", "applicationName": "Application Name 1", "description": "Description of Resource 1", "language": "en-US", "learningStandardIds": [ "lsid1", "lsid2" ], "learningResourceTypeId": "lr type id 1", "copyrightOwner": "Copyright Owner 1", "copyrightYear": 2023, "titleLanguage": "en-US", "descriptionLanguage": "en-US" }, { "@id": "https://api.example.com/v1.2/resources/uuid2", "title": "Resource Title 2", "resourceType": "Resource Type 2", "url": "http://www.example.com/resource2", "vendorId": "vendor2", "vendorName": "Vendor Name 2", "applicationId": "app2", "applicationName": "Application Name 2", "description": "Description of Resource 2", "language": "en-GB", "learningStandardIds": [ "lsid3" ], "learningResourceTypeId": "lr type id 2", "copyrightOwner": "Copyright Owner 2", "copyrightYear": 2022, "titleLanguage": "en-GB", "descriptionLanguage": "en-GB" } ] } ``` -------------------------------- ### Get first set of resources Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest Get the first set of resources i.e. from first to limit. ```APIDOC ## GET /ims/oneroster/v1p2/courses/{courseId}/resources ### Description Retrieves the first set of resources for a course, up to the specified limit. ### Method GET ### Endpoint /ims/oneroster/v1p2/courses/{courseId}/resources ### Parameters #### Path Parameters - **courseId** (string) - Required - The unique identifier for the course. #### Query Parameters - **limit** (integer) - Required - The maximum number of resources to return. - **offset** (integer) - Optional - The offset from the beginning of the results. For the first set, this is typically 0. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **resources** (array) - A list of resource objects. - **limit** (integer) - The limit applied to the response. - **offset** (integer) - The offset applied to the response. - **sourseId** (string) - The identifier of the source. - **next** (string) - URL for the next page of results. - **previous** (string) - URL for the previous page of results. #### Response Example ```json { "resources": [ { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "@id": "https://example.com/ims/oneroster/v1p2/courses/course-id-1/resources/resource-id-1", "title": "Resource Title 1", "resourceSourcedId": "resource-id-1" }, { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "@id": "https://example.com/ims/oneroster/v1p2/courses/course-id-1/resources/resource-id-2", "title": "Resource Title 2", "resourceSourcedId": "resource-id-2" } ], "limit": 2, "offset": 0, "sourseId": "example.com", "next": "https://example.com/ims/oneroster/v1p2/courses/course-id-1/resources?limit=2&offset=2", "previous": null } ``` ### Error Handling - **400**: Invalid selection or filter field. - **401**: Unauthorized request. - **403**: Forbidden. - **404**: Unknown object or invalid GUID. - **422**: Unprocessable Entity (semantically erroneous JSON). - **429**: Server busy, too many requests. - **500**: Internal Server Error. - **default**: Default error payload. ``` -------------------------------- ### getResourcesForUser - Success Response Example (JSON) Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest This JSON payload example shows a successful '200' response for the 'getResourcesForUser' operation, listing resources assigned to a specific user. ```json { "@context": [ "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld" ], "@id": "https://api.example.com/v1.2/users/userId1/resources", "resourceSitelist": [ { "@id": "https://api.example.com/v1.2/resources/uuid1", "title": "Resource Title 1", "resourceType": "Resource Type 1", "url": "http://www.example.com/resource1", "vendorId": "vendor1", "vendorName": "Vendor Name 1", "applicationId": "app1", "applicationName": "Application Name 1", "description": "Description of Resource 1", "language": "en-US", "learningStandardIds": [ "lsid1", "lsid2" ], "learningResourceTypeId": "lr type id 1", "copyrightOwner": "Copyright Owner 1", "copyrightYear": 2023, "titleLanguage": "en-US", "descriptionLanguage": "en-US" } ] } ``` -------------------------------- ### getAllResources - Error Response Examples (JSON) Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest These JSON payload examples demonstrate various error responses (400, 401, 403, 404, 422, 429, 500, default) for the 'getAllResources' operation. They indicate different types of issues that may occur during the request. ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "400", "message": "Bad Request: Missing required parameter." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "401", "message": "Unauthorized: Invalid API key." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "403", "message": "Forbidden: Insufficient permissions." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "404", "message": "Not Found: The requested resource does not exist." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "422", "message": "Unprocessable Entity: Invalid request body." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "429", "message": "Too Many Requests: Rate limit exceeded." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "500", "message": "Internal Server Error: An unexpected error occurred." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "default", "message": "An unknown error occurred." } ] } ``` -------------------------------- ### getResource - Success Response Example (JSON) Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest This JSON payload example shows a successful '200' response for the 'getResource' operation, detailing a specific resource with its properties. ```json { "@context": [ "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld" ], "@id": "https://api.example.com/v1.2/resources/uuid1", "title": "Resource Title 1", "resourceType": "Resource Type 1", "url": "http://www.example.com/resource1", "vendorId": "vendor1", "vendorName": "Vendor Name 1", "applicationId": "app1", "applicationName": "Application Name 1", "description": "Description of Resource 1", "language": "en-US", "learningStandardIds": [ "lsid1", "lsid2" ], "learningResourceTypeId": "lr type id 1", "copyrightOwner": "Copyright Owner 1", "copyrightYear": 2023, "titleLanguage": "en-US", "descriptionLanguage": "en-US" } ``` -------------------------------- ### getResourcesForClass - Success Response Example (JSON) Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest This JSON payload example illustrates a successful '200' response for the 'getResourcesForClass' operation, listing resources associated with a specific class. ```json { "@context": [ "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld" ], "@id": "https://api.example.com/v1.2/classes/classId1/resources", "resourceSitelist": [ { "@id": "https://api.example.com/v1.2/resources/uuid1", "title": "Resource Title 1", "resourceType": "Resource Type 1", "url": "http://www.example.com/resource1", "vendorId": "vendor1", "vendorName": "Vendor Name 1", "applicationId": "app1", "applicationName": "Application Name 1", "description": "Description of Resource 1", "language": "en-US", "learningStandardIds": [ "lsid1", "lsid2" ], "learningResourceTypeId": "lr type id 1", "copyrightOwner": "Copyright Owner 1", "copyrightYear": 2023, "titleLanguage": "en-US", "descriptionLanguage": "en-US" } ] } ``` -------------------------------- ### getResourcesForCourse - Error Response Examples (JSON) Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest These JSON payload examples show various error responses (400, 401, 403, 404, 422, 429, 500, default) for the 'getResourcesForCourse' operation, indicating problems with the request. ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "400", "message": "Bad Request: Invalid course ID provided." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "401", "message": "Unauthorized: API key is invalid or missing." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "403", "message": "Forbidden: User does not have permission to view resources for this course." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "404", "message": "Not Found: The course or its associated resources were not found." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "422", "message": "Unprocessable Entity: The course ID format is incorrect." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "429", "message": "Too Many Requests: Rate limit exceeded." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "500", "message": "Internal Server Error: Error retrieving resources for the course." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "default", "message": "An unexpected error occurred while fetching course resources." } ] } ``` -------------------------------- ### getResourcesForUser - Error Response Examples (JSON) Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest These JSON payload examples detail various error responses (400, 401, 403, 404, 422, 429, 500, default) for the 'getResourcesForUser' operation, indicating problems during the request. ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "400", "message": "Bad Request: Invalid user ID format." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "401", "message": "Unauthorized: Invalid authentication credentials." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "403", "message": "Forbidden: User lacks permission to view resources for this user." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "404", "message": "Not Found: The user or their associated resources could not be found." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "422", "message": "Unprocessable Entity: The user ID provided is invalid." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "429", "message": "Too Many Requests: Rate limit exceeded." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "500", "message": "Internal Server Error: Failed to retrieve resources for the user." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "default", "message": "An unexpected error occurred while fetching user resources." } ] } ``` -------------------------------- ### getResourcesForClass - Error Response Examples (JSON) Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest These JSON payload examples present various error responses (400, 401, 403, 404, 422, 429, 500, default) for the 'getResourcesForClass' operation, indicating issues during the request. ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "400", "message": "Bad Request: Invalid class ID." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "401", "message": "Unauthorized: Authentication credentials invalid." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "403", "message": "Forbidden: User lacks access to resources for this class." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "404", "message": "Not Found: The specified class or its resources could not be found." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "422", "message": "Unprocessable Entity: The class ID parameter is malformed." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "429", "message": "Too Many Requests: Rate limit exceeded." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "500", "message": "Internal Server Error: Failed to retrieve resources for the class." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "default", "message": "An unexpected error occurred while fetching resources for the class." } ] } ``` -------------------------------- ### getResource - Error Response Examples (JSON) Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest These JSON payload examples illustrate various error responses (400, 401, 403, 404, 422, 429, 500, default) for the 'getResource' operation, indicating potential issues with the request. ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "400", "message": "Bad Request: Invalid resource ID format." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "401", "message": "Unauthorized: Authentication failed." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "403", "message": "Forbidden: User does not have permission to view this resource." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "404", "message": "Not Found: The specified resource was not found." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "422", "message": "Unprocessable Entity: The resource ID provided is invalid." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "429", "message": "Too Many Requests: Rate limit exceeded." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "500", "message": "Internal Server Error: Failed to retrieve resource." } ] } ``` ```json { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "errors": [ { "code": "default", "message": "An unexpected error occurred while fetching the resource." } ] } ``` -------------------------------- ### GET /getResource/{id} Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest Retrieves a specific resource by its unique identifier. Includes success and error response examples. ```APIDOC ## GET /getResource/{id} ### Description Retrieves a specific resource identified by its unique ID. ### Method GET ### Endpoint /getResource/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the resource. ### Request Example ```json { "example": "Request for a specific resource with ID 'resource123'" } ``` ### Response #### Success Response (200) - **resource** (object) - The requested resource object. - **links** (array) - Links for related resources. #### Response Example ```json { "example": "{\n \"resource\": { ... resource object ... },\n \"links\": [ { ... link object ... } ]\n}" } ``` #### Error Responses - **400, 401, 403, 404, 422, 429, 500, default** - Details about specific error codes and their meanings. ``` -------------------------------- ### GET /users/{userId}/resources Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest Retrieves resources associated with a specific user. Provides examples for success and error responses. ```APIDOC ## GET /users/{userId}/resources ### Description Retrieves a list of resources associated with a specific user. ### Method GET ### Endpoint /users/{userId}/resources ### Parameters #### Path Parameters - **userId** (string) - Required - The unique identifier of the user. #### Query Parameters - **limit** (integer) - Optional - The maximum number of resources to return. - **offset** (integer) - Optional - The number of resources to skip before starting to collect the result set. ### Request Example ```json { "example": "Request for resources belonging to user 'user001'" } ``` ### Response #### Success Response (200) - **resources** (array) - A list of resource objects associated with the user. - **links** (array) - Links for pagination and related resources. #### Response Example ```json { "example": "{\n \"resources\": [ { ... resource object ... } ],\n \"links\": [ { ... link object ... } ]\n}" } ``` #### Error Responses - **400, 401, 403, 404, 422, 429, 500, default** - Details about specific error codes and their meanings. ``` -------------------------------- ### GET /classes/{classId}/resources Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest Retrieves resources associated with a specific class. Provides examples for success and error scenarios. ```APIDOC ## GET /classes/{classId}/resources ### Description Retrieves a list of resources associated with a specific class. ### Method GET ### Endpoint /classes/{classId}/resources ### Parameters #### Path Parameters - **classId** (string) - Required - The unique identifier of the class. #### Query Parameters - **limit** (integer) - Optional - The maximum number of resources to return. - **offset** (integer) - Optional - The number of resources to skip before starting to collect the result set. ### Request Example ```json { "example": "Request for resources belonging to class 'class456'" } ``` ### Response #### Success Response (200) - **resources** (array) - A list of resource objects associated with the class. - **links** (array) - Links for pagination and related resources. #### Response Example ```json { "example": "{\n \"resources\": [ { ... resource object ... } ],\n \"links\": [ { ... link object ... } ]\n}" } ``` #### Error Responses - **400, 401, 403, 404, 422, 429, 500, default** - Details about specific error codes and their meanings. ``` -------------------------------- ### GET /courses/{courseId}/resources Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest Retrieves resources associated with a specific course. Includes examples for successful retrieval and error conditions. ```APIDOC ## GET /courses/{courseId}/resources ### Description Retrieves a list of resources associated with a specific course. ### Method GET ### Endpoint /courses/{courseId}/resources ### Parameters #### Path Parameters - **courseId** (string) - Required - The unique identifier of the course. #### Query Parameters - **limit** (integer) - Optional - The maximum number of resources to return. - **offset** (integer) - Optional - The number of resources to skip before starting to collect the result set. ### Request Example ```json { "example": "Request for resources belonging to course 'course789'" } ``` ### Response #### Success Response (200) - **resources** (array) - A list of resource objects associated with the course. - **links** (array) - Links for pagination and related resources. #### Response Example ```json { "example": "{\n \"resources\": [ { ... resource object ... } ],\n \"links\": [ { ... link object ... } ]\n}" } ``` #### Error Responses - **400, 401, 403, 404, 422, 429, 500, default** - Details about specific error codes and their meanings. ``` -------------------------------- ### Sort Collection by Title Ascending Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest Example of a GET request to retrieve a collection of resources sorted by the 'title' field in ascending order. This demonstrates the basic usage of the 'sort' and 'orderBy' query parameters. ```http GET https://imsglobal.org/ims/oneroster/resources/v1p2/resources?sort=title&orderBy=asc ``` -------------------------------- ### Example JSON Payload for getAllResources (200 OK) Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest This code snippet demonstrates the expected JSON structure for a successful response to a 'getAllResources' operation in OneRoster v1.2. It includes the 'resources' array, where each resource object contains fields like 'sourcedId', 'status', 'dateLastModified', and other optional or extensible properties. This example is useful for understanding the data format and for validation purposes against the OneRoster schema. ```json { "resources" : [ { "sourcedId" : "..String..", "status" : "active"|"tobedeleted", "dateLastModified" : "..Date/Time..", "metadata" : { "..permitted extension point.." : "..user defined value.." }, "title" : "..NormalizedString..", "roles" : [ "..select from Union..", ..., "..select from Union.." ], "importance" : "primary"|"secondary", "vendorResourceId" : "..String..", "vendorId" : "..String..", "applicationId" : "..String.." }, {"...": "..."}, {"...": "..."} ] } ``` -------------------------------- ### Sort Collection by Nested Object Property Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest Example of a GET request to sort a collection based on a property within a nested object using dot notation. This is useful for accessing and sorting data structured within complex objects. ```http ?sort=. ``` -------------------------------- ### HTTP Link Header for First Page Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest This example shows the 'Link' header for the first page of results, using 'rel="first"'. This is part of the recommended HTTP Link Header structure for pagination. ```http Link: ; rel="first" ``` -------------------------------- ### Get last set of resources Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest Get the last set of resources i.e. from offset to end. ```APIDOC ## GET /ims/oneroster/v1p2/courses/{courseId}/resources ### Description Retrieves the last set of resources for a course, starting from the specified offset until the end of the result set. ### Method GET ### Endpoint /ims/oneroster/v1p2/courses/{courseId}/resources ### Parameters #### Path Parameters - **courseId** (string) - Required - The unique identifier for the course. #### Query Parameters - **limit** (integer) - Optional - The maximum number of resources to return. This parameter might be ignored when fetching the last set if the offset is specified to reach the end. - **offset** (integer) - Required - The number of resources to skip from the beginning of the result set to reach the starting point for the last set. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **resources** (array) - A list of resource objects. - **limit** (integer) - The limit applied to the response. - **offset** (integer) - The offset applied to the response. - **sourseId** (string) - The identifier of the source. - **next** (string) - URL for the next page of results. - **previous** (string) - URL for the previous page of results. #### Response Example ```json { "resources": [ { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "@id": "https://example.com/ims/oneroster/v1p2/courses/course-id-1/resources/resource-id-5", "title": "Resource Title 5", "resourceSourcedId": "resource-id-5" }, { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "@id": "https://example.com/ims/oneroster/v1p2/courses/course-id-1/resources/resource-id-6", "title": "Resource Title 6", "resourceSourcedId": "resource-id-6" } ], "limit": 2, "offset": 4, "sourseId": "example.com", "next": null, "previous": "https://example.com/ims/oneroster/v1p2/courses/course-id-1/resources?limit=2&offset=2" } ``` ### Error Handling - **400**: Invalid selection or filter field. - **401**: Unauthorized request. - **403**: Forbidden. - **404**: Unknown object or invalid GUID. - **422**: Unprocessable Entity (semantically erroneous JSON). - **429**: Server busy, too many requests. - **500**: Internal Server Error. - **default**: Default error payload. ``` -------------------------------- ### HTTP Link Header for Previous Page Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest This example displays the 'Link' header for the previous page of results, identified by 'rel="prev"'. This facilitates navigation back through paginated collections. ```http Link: ; rel="prev" ``` -------------------------------- ### GET /websites/imsglobal_spec_oneroster_v1p2/getResourcesForCourse Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest Retrieves a list of resources for a given course. The response includes details such as sourcedId, status, modification date, metadata, title, roles, importance, and vendor-specific identifiers. ```APIDOC ## GET /websites/imsglobal_spec_oneroster_v1p2/getResourcesForCourse ### Description This endpoint retrieves a list of resources associated with a specific course. The response payload details the properties of each resource, including its unique identifier, status, modification timestamp, and optional metadata or extensions. ### Method GET ### Endpoint /websites/imsglobal_spec_oneroster_v1p2/getResourcesForCourse ### Parameters #### Query Parameters *(No query parameters are explicitly mentioned in the provided text for this specific endpoint, but typically course identifiers would be expected here.)* #### Request Body This endpoint does not have a request body. ### Request Example *(No request example provided in the source text.)* ### Response #### Success Response (200) - **resources** (Array[Object]) - The set of contained resource identifiers. - **sourcedId** (String) - Unique identifier for the resource (GUID). - **status** (Enumeration) - Status of the resource ('active' or 'tobedeleted'). - **dateLastModified** (String) - The date and time the resource was last modified (ISO 8601 format). - **metadata** (Object) - Optional field for extended metadata. - **title** (String) - Human-readable title of the resource. - **roles** (Array[Union(RoleEnumExt)]) - Roles expected to use the resource. - **importance** (Enumeration) - Significance of the resource ('primary' or 'secondary'). - **vendorResourceId** (String) - Unique identifier for the resource allocated by the vendor. - **vendorId** (String) - Identifier for the vendor who created the resource. - **applicationId** (String) - Identifier for the application associated with the resource. #### Response Example ```json { "resources" : [ { "sourcedId" : "..String..", "status" : "active"|"tobedeleted", "dateLastModified" : "..Date/Time..", "metadata" : { "..permitted extension point.." : "..user defined value.." }, "title" : "..NormalizedString..", "roles" : [ "..select from Union..", ..., "..select from Union.." ], "importance" : "primary"|"secondary", "vendorResourceId" : "..String..", "vendorId" : "..String..", "applicationId" : "..String.." }, {...}, {...} ] } ``` ``` -------------------------------- ### Get previous set of resources Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest Get the previous set of resources i.e. from last_offset to last_offset+limit. ```APIDOC ## GET /ims/oneroster/v1p2/courses/{courseId}/resources ### Description Retrieves the previous set of resources for a course, based on the last offset. ### Method GET ### Endpoint /ims/oneroster/v1p2/courses/{courseId}/resources ### Parameters #### Path Parameters - **courseId** (string) - Required - The unique identifier for the course. #### Query Parameters - **limit** (integer) - Required - The number of resources to return per page. - **offset** (integer) - Required - The offset from the beginning of the results. To get the previous set, this value should be `last_offset - limit`. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **resources** (array) - A list of resource objects. - **limit** (integer) - The limit applied to the response. - **offset** (integer) - The offset applied to the response. - **sourseId** (string) - The identifier of the source. - **next** (string) - URL for the next page of results. - **previous** (string) - URL for the previous page of results. #### Response Example ```json { "resources": [ { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "@id": "https://example.com/ims/oneroster/v1p2/courses/course-id-1/resources/resource-id-1", "title": "Resource Title 1", "resourceSourcedId": "resource-id-1" }, { "@context": "http://purl.imsglobal.org/ctx/oneroster/v1p2/context.jsonld", "@id": "https://example.com/ims/oneroster/v1p2/courses/course-id-1/resources/resource-id-2", "title": "Resource Title 2", "resourceSourcedId": "resource-id-2" } ], "limit": 2, "offset": 0, "sourseId": "example.com", "next": "https://example.com/ims/oneroster/v1p2/courses/course-id-1/resources?limit=2&offset=2", "previous": null } ``` ### Error Handling - **400**: Invalid selection or filter field. - **401**: Unauthorized request. - **403**: Forbidden. - **404**: Unknown object or invalid GUID. - **422**: Unprocessable Entity (semantically erroneous JSON). - **429**: Server busy, too many requests. - **500**: Internal Server Error. - **default**: Default error payload. ``` -------------------------------- ### GET /resources Source: https://www.imsglobal.org/spec/oneroster/v1p2/resource/bind/rest Retrieves a list of all resources. Supports pagination, sorting, filtering, and field selection. ```APIDOC ## GET /resources ### Description Retrieves a collection of resources. Supports query parameters for filtering, sorting, pagination, and field selection. ### Method GET ### Endpoint /resources ### Query Parameters - **limit** (integer) - Optional - Maximum number of resources to return. - **offset** (integer) - Optional - Number of resources to skip (for pagination). - **sortBy** (string) - Optional - Field to sort the results by. - **sortOrder** (string) - Optional - Order of sorting (asc or desc). - **filter** (string) - Optional - Criteria to filter the resources. - **fields** (string) - Optional - Comma-separated list of fields to include in the response. ### Request Example ```json { "example": "GET /resources?limit=20&sortBy=title&sortOrder=asc" } ``` ### Response #### Success Response (200) - **resources** (array) - A list of resource objects. - **total** (integer) - The total number of resources available. #### Response Example ```json { "example": "{\n \"resources\": [\n {\n \"sourcedId\": \"resource123\",\n \"title\": \"Introduction to OneRoster\",\n \"resourceType\": \"document\",\n \"url\": \"http://example.com/resources/resource123\"\n }\n ],\n \"total\": 150\n}" } ``` ```