Docs Index


POST /api/questions

Last updated on

Create a new question.

curl \ --data title="Are avocados fruity?" \ --data description="Fruit puzzler round 2" \ --data language="ruby" \ --data contents="def is_fruity?(thing);\n end\n" \ -H 'Authorization: Token token="<%= api_key %>"' \
Code language: JavaScript (javascript)

returns the question just created:

{ "status": "OK", "id": 7, "title": "Are avocados fruity?", "owner_email": "", "language": "ruby", "description": "Fruit puzzler round 2", "contents": "def is_fruity?(thing);\n end\n", "shared": true, "used": 0, "created_at": "2019-01-28T21:21:16Z", "updated_at": "2019-01-28T21:21:16Z" }
Code language: JSON / JSON with Comments (json)

The available paramters you have to configure are detailed below:

idPrimary key for the object. Use this to query or modify this resource later.
titleTitle for this question.
languageOne of a set list.
descriptionNotes for yourself (or colleagues) on what this question is about, and what good and bad answers might look like.
contentsThis text is inserted into your CoderPad interview session if you choose to use this question.