Assessments
To retrieve the list of all assement types, make a request to:
HTTP Request
Section titled “HTTP Request”GET {server_url}/api/v1/assessments
Header Parameter
Section titled “Header Parameter”| Parameter | Default |
|---|---|
| Content-type | application/json |
| Authorization | Bearer {jwt_token} |
Example Request
Section titled “Example Request”curl -X GET {server_url}/api/v1/assessments-H "Content-type: application/json"-H "Authorization: Bearer {jwt_token}"RestClient::Request.new( :method => :get, :url => "{server_url}/api/v1/assessments", :headers => { "Content-type" => "application/json", "Authorization" => "Bearer {jwt_token}" }).executeExample Response
Section titled “Example Response”{ "assessments": [ { "key": "CAGE-AID", "name": "Substance use Screening Test (CAGE-AID)" }, { "key": "GAD-7", "name": "Anxiety Screening Test (GAD-7)" }, { "key": "PHQ-9", "name": "Depression Screening Test (PHQ-9)" } ]}HTTP Request
Section titled “HTTP Request”To retrieve a specific document, make a request to:
GET {server_url}/api/v1/assessments/{assessment-key}
Headers
Section titled “Headers”| Parameter | Default |
|---|---|
| Authorization | Bearer {jwt_token} |
| Accept | application/json |
| Content-type | application/json |
URL Parameters
Section titled “URL Parameters”The following parameters need to be included in the URL of the request:
| Attribute | Required | Description |
|---|---|---|
| assessment-key | true | Key of assessment type retrieved from assessments list |
Example Request
Section titled “Example Request”curl -X GET {server_url}/api/v1/assessments/{assessment-key} \ -H 'Authorization: Bearer {jwt_token}' \ -H 'Accept: application/json'RestClient::Request.new( :method => :get, :url => '{server_url}/api/v1/assessments/{assessment-key}', :headers => { 'Authorization' => 'Bearer {jwt_token}', 'Accept' => 'application/json' }).executeExample Response
Section titled “Example Response”{ "assessment": { "key": "PHQ-9", "name": "Depression Screening Test (PHQ-9)", "description": "This depression screening test will quickly help you determine whether you may be suffering from depression. It takes less than a minute to complete and you'll be provided with an instant score.", "instructions": "Over the last two weeks, how often have you been bothered by any of the following problems?", "questions": [ { "id": "responses[0]", "response_answer_key": "0", "text": "Little interest or pleasure in doing things", "options": [ { "value": "0", "text": "Not at all" }, { "value": "1", "text": "Several days" }, { "value": "2", "text": "More than half the days" }, { "value": "3", "text": "Nearly everyday" } ] }, { "id": "responses[1]", "response_answer_key": "1", "text": "Feeling down, depressed, or hopeless", "options": [ { "value": "0", "text": "Not at all" }, { "value": "1", "text": "Several days" }, { "value": "2", "text": "More than half the days" }, { "value": "3", "text": "Nearly everyday" } ] }, { "id": "responses[2]", "response_answer_key": "2", "text": "Trouble falling or staying asleep, or sleeping too much", "options": [ { "value": "0", "text": "Not at all" }, { "value": "1", "text": "Several days" }, { "value": "2", "text": "More than half the days" }, { "value": "3", "text": "Nearly everyday" } ] }, { "id": "responses[3]", "response_answer_key": "3", "text": "Feeling tired or having little energy", "options": [ { "value": "0", "text": "Not at all" }, { "value": "1", "text": "Several days" }, { "value": "2", "text": "More than half the days" }, { "value": "3", "text": "Nearly everyday" } ] }, { "id": "responses[4]", "response_answer_key": "4", "text": "Poor appetite or overeating", "options": [ { "value": "0", "text": "Not at all" }, { "value": "1", "text": "Several days" }, { "value": "2", "text": "More than half the days" }, { "value": "3", "text": "Nearly everyday" } ] }, { "id": "responses[5]", "response_answer_key": "5", "text": "Feeling bad about yourself—or that you are a failure or have let yourself or your family down", "options": [ { "value": "0", "text": "Not at all" }, { "value": "1", "text": "Several days" }, { "value": "2", "text": "More than half the days" }, { "value": "3", "text": "Nearly everyday" } ] }, { "id": "responses[6]", "response_answer_key": "6", "text": "Trouble concentrating on things, such as reading the newspaper or watching television", "options": [ { "value": "0", "text": "Not at all" }, { "value": "1", "text": "Several days" }, { "value": "2", "text": "More than half the days" }, { "value": "3", "text": "Nearly everyday" } ] }, { "id": "responses[7]", "response_answer_key": "7", "text": "Moving or speaking so slowly that other people could have noticed? Or the opposite—being so fidgety or restless that you have been moving around a lot more than usual", "options": [ { "value": "0", "text": "Not at all" }, { "value": "1", "text": "Several days" }, { "value": "2", "text": "More than half the days" }, { "value": "3", "text": "Nearly everyday" } ] }, { "id": "responses[8]", "response_answer_key": "8", "text": "Thoughts that you would be better off dead or of hurting yourself in some way", "options": [ { "value": "0", "text": "Not at all" }, { "value": "1", "text": "Several days" }, { "value": "2", "text": "More than half the days" }, { "value": "3", "text": "Nearly everyday" } ] } ] }}