API Authentication: X-API-KEY



Security Scheme Type Header parameter name:
API Key X-API-KEY


API Endpoints:



Production Endpoint : https://www.b2bmd.app/partners

Sandbox Endpoint      : https://www.b2bmdllc.com/partners


User Authentication:



AUTHORIZATION: X-API-KEY

User Authentication API is used to generate a user specific Token based on the user's email address.

/api.php?fn=get_token

Method: POST

API Parameters:

Parameter Name Parameter Type
email* Text (valid email address)

Note: Email for authorization is the email of the patient you are submitting the data for.

Response: JSON Object

                                                    
                                                        Success:{
                                                        "user_id",
                                                        "token"
                                                        }
                                                    
                                                
                                                    
                                                        Error:{
                                                        "code": [],   // Array of errors 
                                                        "message": "Request Failed"
                                                        }
                                                    
                                                

New Patient Consult



AUTHORIZATION: X-API-KEY

/api.php?fn=patient-info

Method: POST

API Parameters:

Parameter Name Parameter Type Pattern
auth_token* Text Put your token here that was generated in Step 1 above.
cid* Text This must be same for all new patient requests
ctype* Text ED
firstname* Text  
lastname* Text  
email* Text  
dob* Text \d{2}/\d{2}/\d{4}
gender* Text ["Male", "Female"]
phone* Text (\d{3})\ \d{3}-\d{4}
address1* Text  
address2* Text  
city* Text  
state* Text  
zip* Text  
allergies* Text  
medications* Text  
prefix Text Optional
middlename Text Optional
suffix Text Optional
extension Text Optional
qas* Text Valid JSON
rx_drug_name* Text  
rx_dosage* Text  
rx_pills_count* Text  
rx_dispense* Text  
rx_refills* Text  
rx_days_supply* Text  
image1 Text Valid image URL
image2 Text Valid image URL
height* Text  
weight* Text  
vouched_jobid Text  

In case you have multiple Rx, use the following parameters (optional):

rx_drug_name_other Text    
rx_dosage_other Text    
rx_pills_count_other Text    
rx_dispense_other Text    
rx_refills_other Text    
rx_days_supply_other Text    

Response: JSON Object

                                                    
                                                        Success:{
                                                        "user_id",
                                                        "case_id"
                                                        } 
                                                    
                                                
                                                    
                                                        Error:{
                                                        "code": [],   // Array of errors 
                                                        "message" : "Request Failed"
                                                        } 
                                                    
                                                

UPDATE Patient Record



AUTHORIZATION: X-API-KEY

/api.php?fn=update

Method: POST

API Parameters:

Parameter Name Parameter Type Pattern
casenum* Text  
prefix Text  
firstname Text  
lastname Text  
suffix Text  
dob Text \d{2}/\d{2}/\d{4}
phone_number Text (\d{3})\ \d{3}-\d{4}
address_line_1 Text  
address_line_2 Text  
city Text  
state Text  
zipcode Text  
qas Text Must be in a valid JSON format
email Text Must be a valid email address

Response: JSON Object

                                                    
                                                        'code' => 'authentication_success', 'message' => 'success' 
                                                    
                                                
                                                    
                                                        'code' => 'authentication_failed', 'message' => 'failed' 
                                                    
                                                

Edit Faceshot Image



AUTHORIZATION: X-API-KEY

/api.php?fn=edit_faceshot

Method: POST

API Parameters:

Parameter Name Parameter Type
casenum Text
image URL of the image

Response: JSON Object

                                                    
                                                        Success:{
                                                        "case_id : "", // Case number will be returned 
                                                        "message": "Request Success"
                                                        }
                                                    

                                                
                                                    
                                                        Error:{
                                                        "code": [],   // Array of errors 
                                                        "message": "Request Failed"
                                                        }
                                                    
                                                

Edit PhotoID Image



AUTHORIZATION: X-API-KEY

/api.php?fn=edit_photoid

Method: POST

API Parameters:

Parameter Name Parameter Type
casenum Text
image URL of the image

Response: JSON Object

                                                    
                                                        Success:{
                                                        "case_id : "", // Case number will be returned 
                                                        "message": "Request Success"
                                                        }
                                                    

                                                
                                                    
                                                        Error:{
                                                        "code": [],   // Array of errors 
                                                        "message": "Request Failed"
                                                        }
                                                    
                                                

Get all messages with case number:



AUTHORIZATION: X-API-KEY

/api.php?fn=get_messages

Method: POST

API Parameters:

Parameter Name Parameter Type Pattern
casenum Text  

Response: JSON Object

                                                    
                                                        Success:{
                                                        "code" : "",
                                                        "data" : ""
                                                        }
                                                    

                                                
                                                    
                                                        Error:{
                                                        "code" : [],   // Array of errors 
                                                        "message" : "Request Failed"
                                                        }
                                                    
                                                

Send New Message:



AUTHORIZATION: X-API-KEY

/api.php?fn=send_message

Method: POST

API Parameters:

Parameter Name Parameter Type Pattern
casenum Text  
message Text  

Response: JSON Object

                                                    
                                                        Success:{
                                                        "message_id" : ""
                                                        }
                                                    

                                                
                                                    
                                                        Error:{
                                                        "code" : "Error message", 
                                                        "message" : "Request Failed"
                                                        }
                                                    
                                                

Cancel Consult:



AUTHORIZATION: X-API-KEY

/api.php?fn=cancel

Method: POST

API Parameters:

Parameter Name Parameter Type Pattern
casenum* Text Required

Response: JSON Object

                                                    
                                                        Success:{
                                                        "code" : "authentication_success",
                                                        "message": "Success"
                                                        }
                                                    

                                                
                                                    
                                                        Error:{
                                                        "code": authentication_failed, 
                                                        "message": "Failed"
                                                        }
                                                    
                                                

Refill Payment Processed



AUTHORIZATION: X-API-KEY

/api.php?fn=refill_pymt

Method: POST

API Parameters:

Parameter Name Parameter Type Pattern
casenum Text --

Response: JSON Object

                                                    
                                                        Success:{
                                                        "code" => "authentication_success",
                                                        "message" => "success",
                                                        }
                                                    

                                                
                                                    
                                                        Error:{
                                                        "code" : "authentication_failed", 
                                                        "message" : "failed"
                                                        }
                                                    
                                                
                                                    
                                                        Error:{
                                                        "code" : "authentication_failed", 
                                                        "message" : "invalid case number"
                                                        }
                                                    
                                                

RX Change



AUTHORIZATION: X-API-KEY

/api.php?fn=rxchange

Method: POST

API Parameters:

Parameter Name Parameter Type Pattern
casenum Text --
treatment_name Text For Example: Viagra (25 mg) Pill Count 10 (1 Month/3 Month Supply)

When we receive an RX Change, it is changed on the same day and when the new RX is written by the Provider the status automatically changes to Approved Rx Written.

If an RX Change is rejected it is changed to the Rejected status.

Response: JSON Object

                                                    
                                                        Success:{
                                                        "code" => "authentication_success",
                                                        "message" => "success",
                                                        }
                                                    

                                                
                                                    
                                                        Error:{
                                                        "code" : "authentication_failed", 
                                                        "message" : "failed"
                                                        }
                                                    
                                                
                                                    
                                                        Error:{
                                                        "code" : "authentication_failed", 
                                                        "message" : "invalid case number"
                                                        }
                                                    
                                                

RX Refill



AUTHORIZATION: X-API-KEY

/api.php?fn=refill

Method: POST

API Parameters:

Parameter Name Parameter Type Pattern
casenum Text --
medical_change Text If the patient have had any medical changes or medication changes in the last year. If the answer is yes, we need to know what changed.

Both the API parameters are required fields. On success, the status of the patient chart will be changed to RX Refill.

Response: JSON Object

                                                    
                                                        Success:{
                                                        "code" => "success"
                                                        }
                                                    

                                                
                                                    
                                                        Error:{
                                                        "code" : "failed"
                                                        }
                                                    
                                                

Upload Lab Report



AUTHORIZATION: X-API-KEY

/api.php?fn=upload_lab_report

Method: POST

API Parameters:

Parameter Name Parameter Type Pattern
casenum Text --
email Text --
file File Only PDF files are allowed.

Response: JSON Object

                                                    
                                                        Success:{
                                                        'status' => 'success', 'message' => 'File uploaded'
                                                        }
                                                    

                                                
                                                    
                                                        Error:{
                                                        'status' => 'fail', 'message' => 'File Error: Failed to upload file'
                                                        }
                                                    
                                                
Copyright © 2021 B2BMD. All Rights Reserved. Version 2.3.4