En español
NIDA

Developers API

Revised October 2012

Description

To retrieve all the questions and to evaluate them, the user must need an access token. A request to '/get_token' give a response which includes a token_id.

URL: <URLBASE>/get_token

Logic

Each request creates a new user with a token_id.  All further requests are processed using this token_id. 

Sample Request Format

{
  "key": "qtye456ceger",
  "user": {
            "name": "Ameen",
            "age": "23",
            "sex": "male",
            "interviewer": "Jim",
            "questionnaire_type": 2
          }
}

Params 

key required
name optional
age optional
sex optional
inteviewer optional
questionnaire_type optional. Take values 1 or 2.Default is 1 unless specified
Method 
(GET|POST)

Response

{
  "status": "1",
  "messages": [
    {
      "message": "Success using API"
    }
  ],
  "token_id": 20,
  "name": "ameen",
  "age": "23",
  "sex": "Male",
  "interviewer": "Jim"
}

Response fields

status Status of the API request
errors Errors if any
token_id Further API call need this token_id

 

This page was last updated October 2012