GET /api/questions/:id (show)
Returns details about a particular question. You can view questions visible to you, which includes your own questions as well as colleagues’ questions where shared
is set to true
. If you’re an organization owner, you can view all questions in the organization.
curl \
-H 'Authorization: Token token="<%= api_key %>"' \
https://app.coderpad.io/api/questions/42
yields:
{
"status": "OK",
"id": 42,
"title": "Are fruits tomatoes?",
"author_name": "Molly Macadamia",
"owner_email": "molly@macadamia.net",
"language": "postgresql",
"description": "Use SQL magic to discover the answer.",
"contents": "SELECT * FROM fruits;\n",
"shared": true,
"used": 0,
"created_at": "2019-01-25T02:07:12Z",
"updated_at": "2019-01-25T02:07:12Z"
}
Fields returned:
Field | Description |
---|---|
id | Primary key for the object. Use this to query or modify this resource later. |
title | User-assigned title of the question. |
author_name | Name of the person who authored this question. This is the same person as the owner referenced by owner_email. |
owner_email | Email address of the person who owns the question. |
language | Chosen language for the question. One of a set list. |
description | Notes for yourself (or colleagues) on what this question is about, and what good and bad answers might look like. |
contents | User-assigned question contents. This text is inserted into your CoderPad interview session if you choose to use this question. |
shared | A boolean specifying whether this question is shared with the user’s organization. Defaults to true . |
used | A counter counting the number of times this question was used to create pads. |
created_at | The time when the question was created, in UTC ISO 8601, like 2019-01-30T00:22:55.520Z . |
updated_at | Similarly, the time when the question was last updated. |