loading
বিজ্ঞাপন

API Integration

আমাদের API ব্যবহার করতে নিচের উদাহরণ কোডগুলো অনুসরণ করুন। এখানে api-key এবং secret-key ব্যবহার করতে হবে।

PHP cURL Request Example

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://zachaikori.com.nijwel.com/api/v1/fraud-check",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('mobile' => 'Custom mobile number'),
CURLOPT_HTTPHEADER => array(
    'api-key: {Your api_key}',
    'secret-key: {Your secret_key}',
    'x-customer-domain: request()->getHost()'
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
                                    
PHP HTTP Request Example

$response = Http::withHeaders([
    'api-key'    => "{Your api_key}",
    'secret-key' => "{Your secret_key}",
    'x-customer-domain' => request()->getHost(),
])->post("https://zachaikori.com.nijwel.com/api/v1/fraud-check", [
    'mobile' => $number,
]);

if ($response->successful()) {
    return $response->json();
} else {
    return [
        'status' => 'error',
        'message' => 'API call failed',
        'error' => $response->body(),
    ];
}
                                    

**বিঃদ্রঃ** আমাদের API থেকে প্রাপ্ত `message` ফিল্ডে বিভিন্ন গুরুত্বপূর্ণ তথ্য, যেমন — অফার, আপডেট, নোটিশ বা অ্যাকাউন্ট/প্যাকেজের মেয়াদ শেষ হওয়ার বার্তা প্রদান করা হয়। এই বার্তাগুলো ব্যবহারকারীর জন্য অত্যন্ত গুরুত্বপূর্ণ, কারণ এগুলোর মাধ্যমে ব্যবহারকারী জানতে পারবেন তার API ব্যবহারে কোনো সীমাবদ্ধতা, মেয়াদোত্তীর্ণ বা অন্যান্য নীতিমালা-সংক্রান্ত সমস্যা আছে কি না।
👉 তাই **ডেভেলপারদের অবশ্যই API রেসপন্সে প্রাপ্ত `message` ফিল্ডকে ব্যবহার করতে হবে** এবং সেই অনুযায়ী সিস্টেমে বার্তাগুলো ব্যবহারকারীর কাছে প্রদর্শন করতে হবে। এতে করে ব্যবহারকারী সহজেই বুঝতে পারবেন কোন কারণে API রেসপন্স ব্যর্থ হয়েছে অথবা আমাদের পক্ষ থেকে কোনো নতুন অফার/আপডেট রয়েছে কি না।

WordPress Instructions

পদ্ধতি ১: আপনার যদি ইতিমধ্যে WordPress সাইট থাকে

ধাপ ১: ZIP ফাইল ডাউনলোড করুন

ধাপ ২: WordPress Admin এ লগইন করুন
আপনার WordPress সাইটের admin panel এ যান:
https://yourwebsite.com/wp-admin
Username ও Password দিয়ে লগইন করুন।

ধাপ ৩: Plugin Upload করুন
- Plugins → Add New এ ক্লিক করুন
- Upload Plugin বাটনে ক্লিক করুন
- zachaikori-fraud-check.zip সিলেক্ট করুন
- Install Now এ ক্লিক করুন
- Install শেষ হলে Activate Plugin ক্লিক করুন

ধাপ ৪: API Settings করুন
Settings → Fraud Check এ যান
API Key দিন
Secret Key দিন
Customer Domain দিন (যেমন: zachaikori.com)
Save Changes ক্লিক করুন

ধাপ ৫: একটি Page তৈরি করুন (প্রয়োজনে)
Pages → Add New এ যান
Title দিন: Fraud Check
Content area তে লিখুন:
[zachaikori_fraud_check]

Publish করে View Page ক্লিক করুন
                                    

Response Example

Response will be in JSON format
✅ Success Response

If the domain is allowed to use the Fraud Check API:


{
    "status": "success",
    "number": "019********",
    "message": "Important message for the user, its may be about offers, updates, notices, or account/package expiry.",
    "limit": 50,
    "life_time_request": "65",
    "used": 5,
    "total_delivery": 104,
    "total_success": 100,
    "total_canceled": 4,
    "subscription": "Free Plan",
    "data": {
        "pathao": {
            "name": "Pathao",
            "success": 43,
            "cancel": 1,
            "total": 44,
            "rate": 98,
            "customer_rating": "Excellent"
        },
        "redx": {
            "name": "RedX",
            "success": 32,
            "cancel": 2,
            "total": 34,
            "rate": 94,
            "customer_rating": "excellent_customer"
        },
        "steadfast": {
            "name": "SteadFast",
            "success": 25,
            "cancel": 1,
            "total": 26,
            "rate": 96,
            "customer_rating": "Excellent"
        },
        "paperfly": {
            "name": "PaperFly",
            "success": 0,
            "cancel": 0,
            "total": 0,
            "rate": 0,
            "customer_rating": "No History"
        }
    }
}
      
❌ Error Response (Invalid API Key)

{
    "status": "error",
    "message": "Unauthorized"
}
                                
❌ Error Response (Blocked User)

{
    "status": "error",
    "message": "আপনার অ্যাকাউন্টটি সাময়িকভাবে বন্ধ করা হয়েছে। অনুগ্রহ করে আপনার অ্যাকাউন্টটি পুনরায় সংযুক্ত করতে আমাদের সাথে যোগাযোগ করুন।"
}
                                
❌ Error Response (Unauthorized Domain)

{
    "status": "error",
    "message": "Unauthorized domain"
}
                                
⚠️ Expired Response

{
    "status": "expired",
    "message": "আপনার ফ্রি ট্রায়ালের আজকের দিনের লিমিট শেষ হয়ে গিয়েছে, পুনরায় চেক করার জন্য রাত ১২ টা পর্যন্ত অপেক্ষা করুন, অথবা আমাদের প্রিমিয়াম প্যাকেজে আপগ্রেড করুন । ধন্যবাদ !"
}
                                
বিজ্ঞাপন