GET /++quiz_get_resource

This document provides details on the GET /++quiz_get_resource endpoint, explaining how to retrieve a resource, e.g. a quiz, a question, or a page from g-math-science.com

Endpoint

GET /++quiz_get_resource

Description

The GET /++quiz_get_resource endpoint retrieves a specific resource (such as a quiz or document) based on either its relative path or unique identifier (UID). The service returns the resource's details in JSON format.

Request Parameters

  • path (optional): The relative path of the resource. Example: /quizzes/math/quiz1.
  • uid (optional): The unique identifier of the resource. Example: 12345-abcdef-67890.

Note: Either path or uid must be provided, but not both.

Response

The response is a JSON object containing the resource details or an error message if the request is invalid or fails.

Response Codes

  • 200 OK: The request was successful, and the resource details are returned.
  • 400 Bad Request: The request is invalid. Either both path and uid were provided, or neither was provided.
  • 401 Unauthorized: The subscription is not valid.
  • 404 Not Found: The requested resource was not found.
  • 500 Internal Server Error: An unknown error occurred during processing.

Example

Request

https://go-math-science.com/++quiz_get_resource?registration_id=<registration id>&subscription_method=referer&path=/math/discrete-mathematics

Response
{
"@id": "http://localhost:8090/Plone2/computing/software-engineering/architecture",
"id": "architecture",
"@type": "Folder",
"parent": {
"@id": "http://localhost:8090/Plone2/computing/software-engineering",
"description": "Software engineering is an engineering discipline that is concerned with all aspects of software production",
"review_state": "published",
"@type": "Folder",
"title": "Software Engineering"
},
"created": "2020-09-22T22:42:01+00:00",
"modified": "2023-10-28T00:40:27+00:00",
"review_state": "published",
"UID": "7aa7d087cf674fdcb3ce0b8d17e3d76f",
"version": "current",
"layout": "CollectionQuizListView",
"is_folderish": true,
"previous_item": {
"@id": "http://localhost:8090/Plone2/computing/software-engineering/requirements-engineering",
"@type": "Folder",
"title": "Requirements Engineering",
"description": "The first step to understand your problem is to analyze it. Business analysis plays an important role to identify the business problem paving to the technical solution."
},
"next_item": {},
"lock": {},
"@components": {
"actions": {
"@id": "http://localhost:8090/Plone2/computing/software-engineering/architecture/@actions"
},
"breadcrumbs": {
"@id": "http://localhost:8090/Plone2/computing/software-engineering/architecture/@breadcrumbs"
},
"navigation": {
"@id": "http://localhost:8090/Plone2/computing/software-engineering/architecture/@navigation"
},
"contextnavigation": {
"@id": "http://localhost:8090/Plone2/computing/software-engineering/architecture/@contextnavigation"
},
"workflow": {
"@id": "http://localhost:8090/Plone2/computing/software-engineering/architecture/@workflow"
},
"types": {
"@id": "http://localhost:8090/Plone2/computing/software-engineering/architecture/@types"
}
},
"image": null,
"font_icon": null,
"creators": [
"okhaled"
],
"contributors": [],
"rights": null,
"effective": "2020-09-22T23:42:00",
"expires": null,
"subjects": [],
"language": {
"token": "en-us",
"title": "English (USA)"
},
"title": "Architecture",
"description": "The architecture of the software system set the the foundations for designs and give guidance for all technical teams to add their solutions without going beyond the limits.",
"allow_discussion": false,
"exclude_from_nav": false,
"relatedItems": [],
"nextPreviousEnabled": false,
"blocks": {},
"blocks_layout": {
"items": []
},
"text": null,
"items_total": 3,
"items": [
{
"@id": "http://localhost:8090/Plone2/computing/software-engineering/architecture/introduction",
"description": "Get ready to know more about software architecture",
"review_state": "published",
"@type": "Folder",
"title": "Introduction"
},
{
"@id": "http://localhost:8090/Plone2/computing/software-engineering/architecture/performance-or-security",
"description": "A trade-off decision that many solution architects struggle to make is what requirements to compromise if security and performance requirements conflict? Something which I saw many times in my long career. One point of view is that good user experience is linked primarily to the performance of the system since it does make sense to provide good functionality but without a responsive system. On the other hand, some architects would see that providing a maximum level of security would give a better user experience. This may be true, but have they considered system performance while adding all security measures?",
"review_state": "published",
"@type": "Document",
"title": "What are the trade-off choices between performance and security?"
},
{
"@id": "http://localhost:8090/Plone2/computing/software-engineering/architecture/service-oriented-architecture",
"description": "Some useful quizzes in service-oriented architecture",
"review_state": "published",
"@type": "Folder",
"title": "Service-Oriented Architecture"
}
]
}
Error Responses
  • 400 Bad Request

    {
      "error": "You must send either resource uid or resource relative path"
    }
    
  • 401 Unauthorized

    {
      "error": "Invalid subscription. Please check your subscription status."
    }
    
  • 404 Not Found

    {
      "error": "Requested resource is not found"
    }
    
  • 500 Internal Server Error

    {
      "error": "Unknown error: <detailed error message>"
    }

Document Actions