-
Notifications
You must be signed in to change notification settings - Fork 55
API Parameters
Create a free account at https://questions.aloc.com.ng On your dashboard, retrieve Access Token that will be attached to each API call.
A sample Access Token should look like this ALOC-78bfe77b49fb3e407bf8
A complete example
fetch("https://questions.aloc.com.ng/api/v2/q?subject=chemistry", { headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'AccessToken': 'ALOC-78bfe77b49fb3e407bf8' }, method: "GET", }) .then(function(res){ console.log(res) }) .catch(function(res){ console.log(res) })
There is a free 7,000 APIs call available when you sign up. Upgrade your account you get up to 70,000 free API calls. For more details visit https://questions.aloc.com.ng
The 'GET' request uses the following parameters in API calls: 'subject', 'type' and 'year'. Please note, for 'GET' API request, subject parameter is compulsory. For example https://questions.aloc.com.ng/api/v2/q?subject=chemistry
Don’t forget to add the access token as shown above.
There are cases where a particular return request has a typographical error in question or options, you can make a 'POST' request to report the question. You can also report wrong answers or poorly explained solutions. For example https://questions.aloc.com.ng/api/r?subject=chemistry&question_id=238
The supported parameters are 'subject', 'question_id', 'message', 'full_name', 'type'. The compulsory parameters are 'subject' and 'question_id'
subject: english, mathematics , commerce , accounting, biology , physics, chemistry, englishlit, government, crk, geography, economics, irk, civiledu, insurance, currentaffairs, history
question_id: The id returned with the JSON request for each question
full_name: Name of the sender.
type:
-
Question ⇒ 1
-
Option A ⇒ 2
-
Option B ⇒ 3
-
Option C ⇒ 4
-
Option D ⇒ 5
-
Answer ⇒ 6
-
Solution ⇒ 7
For example, if I want to report a question, I make the post API call like this
I report option B like this
message : A short description of why you flagged a question
Example ⇒ "Hope was spelled wrongly in this question" ⇒ "I totally disagree, the answer to the question is A because…"
https://questions.aloc.com.ng/api/r?subject=chemistry&question_id=23&message="the answer you provided is wrong"
A complete example
fetch("https://questions.aloc.com.ng/api/r", { headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, method: "POST", body: JSON.stringify({subject: 'english', question_id: 2, message:"you got busted", type:5, }) }) .then(function(res){ console.log(res) }) .catch(function(res){ console.log(res) })