For Developer

Overview

Adding JustDoc script to your web app provide you to consult with a doctor online.

Prerequisites

Before including the code to your web app we will provide you unique partner id which will auto include in your script which we will provide you.

Implementation

Single Button On Page

"This will ideal for blogs, new sites, forums etc."

Multiple Buttons on Page

"This will ideal for doctor listings eg. clinics, hospitals"

Single Button On Page

We will provide you two code snippet one is HTML code and another one is SCRIPT code.

HTML code

This following code you have to add where you want to create consult button which will redirect to justdoc.com site.

<div class="jd-root" style="text-align:center;"></div>
Script code

This following script code you have to add to your index page.

<script>(function () {
 window.jd_data = {
  id: '<PartnerId>'
  //You can add more property like name, email, mobile etc.
 };
 var element = document.createElement("script");
 element.src = 'https://justdoc.com/js/jd.js';
 document.head.appendChild(element);
})();
</script>

Multiple Buttons On Page

If you want multiple buttons on your page then you need to call a function "callJustDoc(window.jd_data)" in your button.

For Ex:

<button onClick="callJustDoc(window.jd_data)">Any Name</button>

OR

You can call your own defined function on onclick attribute and from that defined function you can call "callJustDoc(window.jd_data)" function.

Note: You can add this function to any tag like <a> tag or <button> or DropDown.

window.jd_data is required for our function.

You can add required field to window.jd_data object. For ex:

window.jd_data = {
  id: 'partner-id', // which is provided by us
}
//you can add keys and value to your object
  window.jd_data.name: 'xyz',
  window.jd_data.mobile: '1236547899',
  window.jd_data.email: 'xyz@xyz.com'

Required Field

When the script is added to you index page the button will auto created and append to div element 'jd-root'.

Required Entity

In script jd_data is object you can add more field manually

Filed name Required? Description
id Yes Partner Id auto generated. Provide by JustDoc.
partnerName Optional Partner name to be shown to patient
speciality Optional Consultation speciality Ex: - sexology, dermatologist, gynecologist, psychologist, general, pediatrics, homeopathy, infertility
couponCode Optional Coupon code
doctorId Optional Doctor id consult with particular doctor
name Optional Patient name
email Optional Patient email
mobile Optional Patient mobile number
logoUrl Optional Logo of your site if you want to show and the width and height should be 60 * 50
callbackUrl Optional Url of your website. It will redirect to your website after consultation.