API v2 Answering Service API

API v2 Answering Service API

Please contact support@triagelogic.com to get your credentials and encryption key and correct urls for your account.

Environment Connections

DEVELOPMENT or Sandbox (Unstable) - Test data

QA (Stable) - Live data

      $server_url: https://mtc-qa.my247healthcare.com/cc/modules/apiv2


PRODUCTION - Live data


Token Create Post Parameters:

      "login_username":"{API USERNAME}"
      "login_password":"{ENCRYPTED PASSWORD}"

Post URLs

Token Create Post URL: $server_url/index.php?resource=tokenCreate

Ticket Submission Post URL: $server_url/index.php?resource=adi&token=FuGBtOni95Bw0fNo

Ticket Status URL: $server_url/index.php?resource=ticketStatus&token=FuGBtOni95Bw0fNo&ticket_id=RQxQ5s84H





Client Overview

1. Token Create

We are using a token based API. For this you have to create a token and send this token when calling the API. This token will be validated up to two hours from the user's last activity. To create a token, you have to call the Token Create API with a username and encrypted password. For Encryption & Decryption of the password we are using openssl_encrypt & openssl_decrypt method, where a key is required, this key value is only known Sender to Receiver.




API Name

Token Create

API Desc

Please send encrypted password, not plain login password

URL

$server_url/index.php?resource=tokenCreate

Method

POST

Parameter

{

"login_username"*:"{API USERNAME}",

"login_password"*:"{ENCRYPTED PASSWORD}"

}

Return

{

    "success":true,

    "result":

    {

        "token":"FuGBtOni95Bw0fNo"    

    },

    "errors":[]

}




2. Ticket Submission/Answering Service

To create a new ticket you must send the token in the POST.


API Name

Answering Service (Create Ticket)

API Desc

Create a new ticket

URL

$server_url/index.php?resource=as&token=FuGBtOni95Bw0fNo

Method

POST

Parameter

{

"patient_lname"*:"example fname",

"patient_fname"*:"example lname",

"dob"*:"19891230",

“complaint"*:"issue",

“prac”*:”1234”

“client_code”*:""

"contact_phone":"1234567890",

"contact_phone_2":"1234567890",

"sex":"male",

"email":"example@example.com",

"address":"address",

"city":"city",

"state":"FL",

"zip":"90210",

"caller_lname":"example lname",

"caller_fname":"example fname",

"relationship":"relationship to patient",

"comments":"comments for nurse",

"txt":"1|2|3|4",

"Call_type":"1",

"field_mr":"123|ABC123",

}

Return

{

    "success":true,

    "result":

    {

        "field_mr":"123|123",

        "call_type":"1",

        "patient_lname":"example fname",

        "patient_fname":"example lname",

        "dob":"19891230",

        "sex":"male",

        "complaint":"issue",

        "caller_lname":"example lname",

        "caller_fname":"example fname",

        "relationship":"relationship",

        "contact_phone":"1234567890",

        "contact_phone_2":"1234567890",

        "email":"example@example.com",

        "address":"address",

        "city":"city",

        "state":"FL",

        "zip":"90210",

        "ticket_id":"xxxxxxxx",

        "notes":"2020-10-01 13:19:10 : Created by Answering Service API v2.0 from $company by $user"

    },

    "errors":[]

}



3. Ticket Status

A ticket status can retrieved using the Token and TicketID


API Name

Ticket Status

API Desc

Checking ticket status

URL

$server_url/index.php?resource=ticketStatus&token=FuGBtOni95Bw0fNo&ticket_id=RQxQ5s84H

Method

GET

Parameter

Return

{

  "success": true,

  "result": {

    "ticket_id": "Y27szqASe",

    "ticket_status": "IN PROGRESS"

  },

  "errors": [


  ]

}



Developer Notes

Password Encryption Decryption Tool (or do this on your server code below.)

Encrypted with using openssl_encrypt, openssl_decrypt and base64_encode, base64_decode php function.

CipherMethod = “aes-256-cbc”

EncryptionDecryptionKey= “{hidden key}”

https://dev.my247healthcare.com/encrypt.php?p=password&c=cypher&k=key

&c and &k not needed if using the following defaults. 


Example of creating your own password encryption function in PHP.

public static function EncryptionCustom($Str='')

{

    if(isset($Str) && trim($Str)!='' )

    {

    $CipherMethod=CosmicConfiguration::CipherMethod;

    $EncryptionDecryptionKey=CosmicConfiguration::EncryptionDecryptionKey;


    $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($CipherMethod));

    $encrypted = openssl_encrypt($Str, $CipherMethod, $EncryptionDecryptionKey, 0, $iv);

     

    $data= base64_encode($encrypted . '::' . $iv);

    return $data;


    }

    else

    {

      return '';

    }

}


public static function DecryptionCustom($Str='')

{

    if(isset($Str) && trim($Str)!='' )

    {

    $CipherMethod=CosmicConfiguration::CipherMethod;

    $EncryptionDecryptionKey=CosmicConfiguration::EncryptionDecryptionKey;


    list($encrypted_data, $iv) = explode('::', base64_decode($Str), 2);

    if(isset($encrypted_data) && $encrypted_data!='' && isset($iv) && $iv!='')

    {

    $data= openssl_decrypt($encrypted_data, $CipherMethod, $EncryptionDecryptionKey, 0, $iv);

    return $data;

    }

    else

    {

    return '';

    }

     

    }

    else

    {

    return '';

    }

}



Please check back to this document as we add additional details each week.


ERROR CODES

406 = Invalid Ticket when requesting ticket status.
406 = Invalid doctor code when submitting a ticket.
407 = Missing required information.
408 = Not authenticated. Token has expired or user not found.
413 = Missing required information on Ticket request or unable to create token.
414 = Doctor submitted does not exist in submitted practice.








    • Related Articles

    • Answering Service API error codes

      200 = Success 405 = No Access to this practice. 406 = Invalid doctor code. 407 = Missing complaint. 408 = Insufficient access to use API 409 = Database query failure. 410 = Invalid DoB format. 411 = This (dc=) doctor does not have Secure Messaging ...
    • Why are some calls coming into Unassigned as Answering Service practice?

      Why are some calls coming into Unassigned as Answering Service practice? These calls are being created from an external API connecting to the Call Center application in order to create the tickets. When the calls appear to be attached to ANSWERING ...
    • Tickets from Answering Service API are coming in under the incorrect practice and doctor.

      Tickets from Answering Service API are coming in under the incorrect practice and doctor. Many answering services uses Triage Logic Call Center API to submit tickets from their software to Triage Logic software. Sometimes a ticket may come through ...
    • API v1 Setting up a new Answering Service company

      Ensure the Answering Service Company has the latest API document (attached). On the CC site, have "Answering Service" practice created and enabled. Create the user account for the API service to use. Have the "COMPANY" field entered as the actual ...
    • User Access for Answering Service Agents and Managers.

      Answering Service users should only have access level : Practice Manager/Edit. Flags : Intake Agent, Queues (manager role), Practices : Never ALL, should be the ones they service.