This endpoint will return the quantity of surveys saved in the FoRSE database for your facility. You must already have access to upload new surveys to access this endpoint.


Connecting to the API

URL Endpoint: https://naatpdata.com/v2/api/status.php

Required Variables

No extra variables are required.


javascript Postman pre-request script


const FACILITY_ID = 'ABCDEFG';
const SECRET_KEY = 'a1b.....x9z';

const apiDate = parseInt(new Date().getTime() / 1000).toString();
const apiSignature = CryptoJS.HmacSHA256(apiDate + FACILITY_ID, SECRET_KEY).toString();

pm.environment.set("facilityId", FACILITY_ID);
pm.environment.set("apiDate", apiDate);
pm.environment.set("apiSignature", apiSignature);

Sample Postman POST :: Body = raw :: JSON


{
  "facilityId": "{{facilityId}}",
  "apiDate": {{apiDate}},
  "apiSignature": "{{apiSignature}}",
}

Sample Reply from API

Responses will be a JSON array and always include status and status_msg:


[
    status: 'string', // success|fail
    status_msg: 'string', // reason for failure
    surveys: //Array of ALL FoRSE surveys, including how many have been saved for your facility.
        (
            [0] => stdClass Object
                (
                    [instrumentId] => KFXY
                    [title] => BAM
                    [qty_saved] => 432
                )
            [1] => stdClass Object
                (
                    [instrumentId] => QGL2
                    [title] => BARC-10
                    [qty_saved] => 127
                )
            [2] => stdClass Object
                (
                    [instrumentId] => B3RH
                    [title] => FoRSE Demographic Information Form V2
                    [qty_saved] => 0
                )
            [3] => stdClass Object
                (
                    [instrumentId] => FVBJ
                    [title] => FoRSE Outcomes Survey
                    [qty_saved] => 900
                )
            [...]
        )
]