Welcome to the Behavioural Questions RESTful API Guide

Records will be returned in the following JSON format:

{ "_id": a unique ID Number, in BSON format allocated automatically.
,"question": a String which poses the question you want to ask.
,"values": An array of strings with leadership values [], }

Submit your api requests in the following format,

n.b. _id is allocated automatically for new records

{"question": "a String which poses the question you want to ask."
,"values": ["An array", "of strings with", "leadership values" ]}

Accessing the API

Return a Number of Random Questions

Send a GET request to:
https://behavioural-recruitment.thewoodenman.repl.co/api/questions/random/:number

replacing {number} in the URI with the number of random questions you'd like to get

Get a Question by ObjectId

Send a GET request to:
https://behavioural-recruitment.thewoodenman.repl.co/api/questions/{id}

replacing {id} in the URI with the ObjectId of your target question
Object Ids are in the standard BSON format, you can find them specifically from other searches.

Get a Question by a Single Value

Send a GET request to:
https://behavioural-recruitment.thewoodenman.repl.co/api/questions/value/{value}

replacing {value} in the URI with your target leadership value in string format
Object Ids are in the standard BSON format.

Submit a Question

Send a POST request to:
https://behavioural-recruitment.thewoodenman.repl.co/api/questions/addone

Omit the ObjectId in the JSON as these will be allocated automatically,
Include the new question in JSON format correctly in the format displayed above.

Submit many Questions

Send a POST request to:
https://behavioural-recruitment.thewoodenman.repl.co/api/questions/addmany

Omit the ObjectId in the JSON as these will be allocated automatically,
Include the new question in JSON format correctly in a different format to the one above, specifically:


                { "array" :[{
                    "question":
                        "{Insert Question Text Here}",
                    "values": [value1, value2, value3]
                },
                {
                    "question":
                        "{Insert Question Text 2 Here}",
                    "values": [value1, value2, value3]
                }]}
            

Replace a Question

Send a POST request to:
https://behavioural-recruitment.thewoodenman.repl.co/api/questions/{id}/replace

replacing {id} in the URI with the ObjectId of your target question
submit your replacement question in JSON format as the body of the POST request

Replace the values of a Question

Send a POST request to:
https://behavioural-recruitment.thewoodenman.repl.co/api/questions/{id}/values/replace

replacing {id} in the URI with the ObjectId of your target question
submit your replacement values in JSON format, but as a series of strings within an array. as the body of the POST request
{ "values": ["optimistic", "results oriented", "sense of humour", "speed", "versatility"] }

Delete a question by ObjectId

Send a DELETE request to:
https://behavioural-recruitment.thewoodenman.repl.co/api/questions/{id}/delete

replacing {id} in the URI with the ObjectId of your target question
The api will target that question, delete it and either confirm or show an error { "values": ["optimistic", "results oriented", "sense of humour", "speed", "versatility"] }