Docs Index

Doc

GET /api/questions/:id

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
Code language: JavaScript (javascript)

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" }
Code language: JSON / JSON with Comments (json)

Fields returned:

FieldDescription
idPrimary key for the object. Use this to query or modify this resource later.
titleUser-assigned title of the question.
author_nameName of the person who authored this question. This is the same person as the owner referenced by owner_email.
owner_emailEmail address of the person who owns the question.
languageChosen language for the question. One of a set list.
descriptionNotes for yourself (or colleagues) on what this question is about, and what good and bad answers might look like.
contentsUser-assigned question contents. This text is inserted into your CoderPad interview session if you choose to use this question.
sharedA boolean specifying whether this question is shared with the user’s organization. Defaults to true.
usedA counter counting the number of times this question was used to create pads.
created_atThe time when the question was created, in UTC ISO 8601, like 2019-01-30T00:22:55.520Z.
updated_atSimilarly, the time when the question was last updated.