This endpoint allows an EHR to register a new Facility with the NAATP API Database with the objective of being able to send data to NAATP API on behalf of the facility. All facilities registered through this endpoint are INACTIVE until the facility has completed all proper documentation. To complete all documentation, a person at NAATP will reach out to the primary contact mentioned in this registration, assist with the documentation, and finally update the facility status to 'Active'. Once active, the EHR may send data to NAATP API on behalf of the facility.


Connecting to the API

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

Important Variables

  • All variables are required so that a person at NAATP can reach out to the individual and arrange for proper completion of documentation.
  • EHR_reference_facilityId varChar(254) utf_bin Case Sensitive variable is generated by your EHR.
    • It must be supplied. You will use it to access the registration_status.php endpoint later.
  • is_test_facility Yes|No Please set to "Yes" for developer testing.
    Yes: testing/development
    • You will receive the same response as if this was a production registration request.
    • FoRSE leadership will NOT receive an email requesting activation of this fake facility
    • The facility will be auto-activated within 30 minutes.
    • You may test registration status.
    • You may upload test surveys after activation.
    • The facility and all of its surveys will be deleted 30 days after creation.
    No: production
    • FoRSE leadership WILL receive an email requesting activation of this real facility.
    • The facility will be activated after NAATP leadership completes requisite paperwork with Facility.
    • You may test registration status.
    • Following activation, you may upload surveys.

javascript Postman pre-request script


const FACILITY_ID = 'ABCDEFG'; //YOUR EHR facilityId (not the id of the facility which you want to sign up)
const SECRET_KEY = 'a1b.....x9z'; //YOUR EHR secret_key (not that of the facility which you want to sign up)

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}}",
  "facility_name": "Test Company",
  "primary_contact_name": "Adem Miller",
  "primary_contact_email": "nobody@naatpdata.com",
  "primary_contact_phone": "555-111-2222",
  "facility_address_street": "123 Main St",
  "facility_address_city": "Beverly Hills",
  "facility_address_state": "CA",
  "facility_address_zip": "90210",
  "facility_address_country": "USA",
  "EHR_reference_facilityId": "ABC-ReferenceID-CreatedBy-EHR"
  "is_test_facility": "Yes"
}

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
    EHR_reference_facilityId => 'string', // the EHR_reference_facilityId that you originally sent us
    facilityId => 'string', // ON SUCCESS ONLY, the facilityId that WE generated
    is_test_facility: 'string', // ON SUCCESS ONLY, y|n