RefLyst Widget — Integration Guide

How to add the "Get info on WhatsApp" lead-capture widget to your website, Android app, iOS app, or any custom platform.

Every integration below ultimately does the same thing: collect a name + phone number from a visitor, then send it to RefLyst's capture.php endpoint. RefLyst creates the lead and immediately sends the WhatsApp warmup message. Pick the section that matches your platform.

1.Website (any platform)

Easiest

Add one script tag before the closing </body> tag of your site. Works on WordPress, Webflow, Wix, Shopify, custom HTML — anywhere you can paste a script tag.

<script src="https://reflyst.com/hykr/widget/widget.js"
        data-iid="YOUR_INSTITUTE_ID"
        data-cid="YOUR_COURSE_ID"          <!-- optional -->
        data-color="#128C7E"               <!-- optional, default WhatsApp green -->
        data-text="Get course info on WhatsApp"  <!-- optional -->
        async></script>

This automatically shows a floating WhatsApp-style button in the bottom-right corner. When clicked, it opens a small form (name + phone), and on submit it sends a WhatsApp message to the lead within seconds.

AttributeRequired?Description
data-iidYesYour Institute ID from the RefLyst dashboard.
data-cidNoCourse ID — pre-attaches a specific course to leads from this page. Leave out for a general page.
data-colorNoHex color for the button. Defaults to WhatsApp green.
data-textNoButton label text.
Tip: use a different data-cid on each course landing page (e.g. one script tag on your "Data Science" page, another on your "Digital Marketing" page) so leads are automatically tagged with the right course and the AI talks about the correct fees, batch dates, and EMI from the start.

2.Android App (WebView)

Easiest — no backend work

If your Android app shows your website inside a WebView (very common for institute apps built with Android Studio, AppMySite, MIT App Inventor, etc.), the widget already works automatically — it's the same web page, just inside the app.

Just make sure JavaScript is enabled on the WebView:

WebView webView = findViewById(R.id.webview);
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setDomStorageEnabled(true);

webView.loadUrl("https://yourinstitute.com");

That's it. The floating WhatsApp button will appear inside the WebView exactly as it does in a mobile browser, and tapping it opens the lead-capture form within the app.

3.Android App (Fully Native UI)

Requires a developer

If your app has a fully native interface (Kotlin/Java views, no WebView), the JavaScript widget can't run. Instead, build a simple native form (name + phone fields and a button) and POST the data directly to RefLyst's API — see API Reference below for the exact request/response format.

Example using OkHttp (Kotlin)

val client = OkHttpClient()
val mediaType = "application/json".toMediaType()

val json = JSONObject().apply {
    put("iid", "YOUR_INSTITUTE_ID")
    put("cid", "YOUR_COURSE_ID")           // optional
    put("name", nameInput.text.toString())
    put("phone", phoneInput.text.toString())
    put("page_url", "android-app://com.yourinstitute.app")
}

val body = json.toString().toRequestBody(mediaType)
val request = Request.Builder()
    .url("https://reflyst.com/hykr/widget/capture.php")
    .post(body)
    .build()

client.newCall(request).enqueue(object : Callback {
    override fun onResponse(call: Call, response: Response) {
        val result = JSONObject(response.body!!.string())
        if (result.getBoolean("ok")) {
            // Show "Check WhatsApp!" success message
        }
    }
    override fun onFailure(call: Call, e: IOException) {
        // Show error / retry message
    }
})

No RefLyst-side changes are needed for this — capture.php already accepts requests from any origin (CORS enabled) and works identically whether the request comes from a browser, a mobile app, or any other HTTP client.

4.iOS App

WKWebView Native — requires a developer

WKWebView (your website inside the app)

Same as Android WebView — if your iOS app loads your website in a WKWebView, the widget works automatically with no extra steps. JavaScript is enabled by default in WKWebView.

Fully native iOS UI

Same approach as native Android — build a simple form and POST to capture.php using URLSession:

var request = URLRequest(url: URL(string: "https://reflyst.com/hykr/widget/capture.php")!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")

let body: [String: Any] = [
    "iid": "YOUR_INSTITUTE_ID",
    "cid": "YOUR_COURSE_ID",
    "name": nameField.text ?? "",
    "phone": phoneField.text ?? "",
    "page_url": "ios-app://com.yourinstitute.app"
]
request.httpBody = try? JSONSerialization.data(withJSONObject: body)

URLSession.shared.dataTask(with: request) { data, _, _ in
    // parse { "ok": true/false, "error": "..." }
}.resume()

5.Flutter / React Native

Cross-platform

Flutter

final response = await http.post(
  Uri.parse('https://reflyst.com/hykr/widget/capture.php'),
  headers: {'Content-Type': 'application/json'},
  body: jsonEncode({
    'iid': 'YOUR_INSTITUTE_ID',
    'cid': 'YOUR_COURSE_ID',
    'name': nameController.text,
    'phone': phoneController.text,
    'page_url': 'flutter-app://yourinstitute',
  }),
);
final result = jsonDecode(response.body);
if (result['ok'] == true) {
  // success
}

React Native

const res = await fetch('https://reflyst.com/hykr/widget/capture.php', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    iid: 'YOUR_INSTITUTE_ID',
    cid: 'YOUR_COURSE_ID',
    name: name,
    phone: phone,
    page_url: 'reactnative-app://yourinstitute',
  }),
});
const result = await res.json();
if (result.ok) {
  // success
}

If your Flutter/React Native app uses a WebView component to show web content (e.g. webview_flutter or react-native-webview), the JS widget from Section 1 also works automatically inside that WebView, same as native Android/iOS WebViews.

6.API Reference — capture.php

This is the underlying endpoint used by every integration above.

Request

POST https://reflyst.com/hykr/widget/capture.php
Content-Type: application/json

{
  "iid": "INSTITUTE_UUID",       // required
  "cid": "COURSE_UUID",          // optional — links lead to a specific course
  "name": "Lead's full name",    // required
  "phone": "9876543210",         // required
  "page_url": "https://..."      // optional — for your own analytics/source tracking
}

Response

// Success
{ "ok": true }

// Failure
{ "ok": false, "error": "Reason for failure" }
FieldTypeNotes
iidstringFound in your RefLyst dashboard URL or settings page.
cidstringOptional. Found on the Courses page — click "Copy" next to a course's ID.
namestringRequired. Any non-empty string.
phonestringRequired. 7-15 digits. 10-digit numbers starting with 6-9 are auto-treated as Indian numbers (country code 91 added automatically). Include the country code for international numbers.
page_urlstringOptional, max 500 chars. Use this to identify which page/screen the lead came from (e.g. "android-app://com.yourinstitute.app/CourseScreen").
What happens after a successful call: RefLyst creates (or matches an existing) lead record, attaches it to the specified course (if cid was given, otherwise the institute's default active course), and sends the WhatsApp warmup message to the lead's phone number within seconds. From there, the AI conversation flow takes over automatically.

Error responses you may see

ErrorCause
Institute ID missingiid was empty or not sent.
Phone number requiredphone was empty.
Invalid phone numberPhone number had fewer than 7 or more than 15 digits after stripping non-numeric characters.
Institute not found or inactiveiid doesn't match an active institute -- double check the ID, or contact RefLyst support.