NAV
shell ruby python csharp php

QuestionCategory

The QuestionCategory object

The QuestionCategory object looks like this in JSON:

{
    "object": "question_category",
    "id": 1,
    "catalog_course_id": 591,
    "name": "Rude",
    "status": "active",
    "sandbox": true
}
Attribute Required Data Type
id No int
catalog_course_id Yes int
name Yes text (250)
status Yes enum (active, retired)
sandbox No bool

index

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questioncategories" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questioncategories',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questioncategories',
 headers={
  'Authorization': 'Bearer YOUR_POPULI_API_KEY'
 },
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questioncategories"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questioncategories');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);

Example response:

{
    "object": "list",
    "count": 17,
    "results": 17,
    "results_per_page": null,
    "pages": 1,
    "page": 1,
    "offset": 0,
    "has_more": false,
    "data": [
        {
            "object": "question_category",
            "id": 93,
            "catalog_course_id": 576,
            "name": "Rap Music",
            "status": "active"
        }
    ],
    "sandbox": true
}

Retrieves all QuestionCategory objects tied to a specific Catalogcourse.

HTTP Request

GET /catalogcourses/(catalogcourse)/questioncategories

Parameters

None

Permissions

One of the following roles is required to call this method:

show

Example code to call this method:

curl "https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questioncategories/(questioncategory)" \
-H "Content-Type: application/json" \ 
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \ 
-X GET
require 'httparty'
response = HTTParty.get(
 'https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questioncategories/(questioncategory)',
 headers: {
  'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
 },
)
puts response.body
import requests
response = requests.get(
 'https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questioncategories/(questioncategory)',
 headers={
  'Authorization': 'Bearer YOUR_POPULI_API_KEY'
 },
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questioncategories/(questioncategory)"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/catalogcourses/(catalogcourse)/questioncategories/(questioncategory)');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);

Example response:

{
    "object": "question_category",
    "id": 100,
    "catalog_course_id": 576,
    "name": "Stuff",
    "status": "active",
    "sandbox": true
}

Retrieves a specific QuestionCategory object.

HTTP Request

GET /catalogcourses/(catalogcourse)/questioncategories/(questioncategory)

Parameters

No additional parameters are needed beyond the ID of the object being requested that appears in the URL.

Permissions

One of the following roles is required to call this method: