دليل استخدام API

دليل شامل لكيفية استخدام الربط البرمجي للحصول على أرقام واتساب مجانية بكل سهولة

معلومات الاتصال

الدومين: hamadh.store

الخادم: HTTPS

نوع الطلب: GET/POST

نقاط API النهائية

كيف تبدأ؟

1

احصل على مفتاح API

يمكنك الحصول عليه من البوت مقابل 50 نقطة

2

تحقق من الرصيد

استخدم /api/balance للتأكد من رصيدك

3

اختر الدولة

استخدم /api/countries لرؤية الدول المتاحة

4

ابدأ الاستخدام

اشترِ رقم واحصل على كود التفعيل فوراً

عرض الرصيد

GET/POST

لعرض الرصيد المتوفر في حسابك.

طلب API
GET/POST https://hamadh.store/n/api/api/balance/<api_key>
مثال عملي
GET https://hamadh.store/n/api/api/balance/NU-ABC123-XYZ456-789DEF
الاستجابة الناجحة
{
"success": true,
"balance": 150
}

عرض الدول

GET/POST

لعرض جميع الدول المتوفرة مع أسعار كل دولة.

طلب API
GET/POST https://hamadh.store/n/api/api/countries/<api_key>
الاستجابة الناجحة
{
"success": true,
"countries": [
    {
        "id": 1,
        "name": "مصر",
        "code": "eg",
        "price": 0
    },
    {
        "id": 2,
        "name": "السعودية",
        "code": "sa",
        "price": 1
    }
]
}

إنشاء طلب

GET/POST

لإنشاء طلب جديد للحصول على رقم من الدولة المطلوبة.

طلب API
GET/POST https://hamadh.store/n/api/api/order/<api_key>/<country_code>
مثال عملي
GET https://hamadh.store/n/api/api/order/NU-ABC123-XYZ456-789DEF/eg
الاستجابة الناجحة
{
"success": true,
"order": {
    "id": 123,
    "user_id": 5806409403,
    "country_name": "مصر",
    "number": "+201234567890",
    "status": "active",
    "otp_code": null,
    "created_at": "2024-01-15 14:30:00"
},
"message": "Order created successfully"
}

طلب الكود

GET/POST

لجلب كود التفعيل (OTP) للطلب الموجود.

طلب API
GET/POST https://hamadh.store/n/api/api/otp/<api_key>/<order_id>
مثال عملي
GET https://hamadh.store/n/api/api/otp/NU-ABC123-XYZ456-789DEF/123
الاستجابة الناجحة
{
"success": true,
"order": {
    "id": 123,
    "user_id": 5806409403,
    "country_name": "مصر",
    "number": "+201234567890",
    "status": "completed",
    "otp_code": "123456",
    "created_at": "2024-01-15 14:30:00"
},
"message": "OTP retrieved successfully"
}

إلغاء الطلب

GET/POST

لإلغاء طلب موجود واستعادة الرصيد.

طلب API
GET/POST https://hamadh.store/n/api/api/cancel/<api_key>/<order_id>
الاستجابة الناجحة
{
"success": true,
"message": "Order cancelled successfully"
}

رسائل الخطأ الشائعة

في حالة حدوث خطأ في أي من الطلبات، ستحصل على الاستجابة التالية:

الاستجابة الفاشلة
{
"success": false,
"error": "error description"
}

أمثلة على رسائل الخطأ الشائعة:

رسالة الخطأ السبب الحل
"Invalid API key" مفتاح API غير صحيح تأكد من مفتاح API الصحيح
"Insufficient balance" رصيد غير كافي قم بشحن حسابك عبر البوت
"Account not activated" الحساب غير مفعل قم بتفعيل حسابك أولاً (دعوة 3 أشخاص أو استخدام 3 نقاط)
"Country not found" الدولة غير متوفرة اختر دولة أخرى متاحة من قائمة الدول
"No numbers available" لا توجد أرقام متاحة جرب دولة أخرى أو انتظر حتى تتوفر أرقام جديدة
"OTP not found" الكود لم يصل بعد انتظر لحظات وحاول مرة أخرى بعد 30 ثانية
"Order not found" الطلب غير موجود تأكد من معرف الطلب الصحيح
"You have an active order" لديك طلب نشط بالفعل أكمل الطلب الحالي أو ألغِه قبل إنشاء طلب جديد
"Failed to connect to monitor" فشل في الاتصال بخادم المراقبة حاول مرة أخرى بعد قليل
"Internal server error" خطأ داخلي في الخادم تواصل مع الدعم الفني للإبلاغ عن المشكلة
مثال على خطأ في الرصيد
{
"success": false,
"error": "Insufficient balance. Need 5 points, have 2"
}
مثال على خطأ في الحساب غير المفعل
{
"success": false,
"error": "Account not activated"
}

أمثلة كود عملية

مثال Python
import requests

API_KEY = "NU-ABC123-XYZ456-789DEF"
BASE_URL = "https://hamadh.store/n/api/"

# التحقق من الرصيد
def get_balance():
    response = requests.get(f"{BASE_URL}/api/balance/{API_KEY}")
    if response.json().get("success"):
        return response.json()["balance"]
    else:
        print(f"خطأ: {response.json().get('error')}")
        return None

# الحصول على الدول المتاحة
def get_countries():
    response = requests.get(f"{BASE_URL}/api/countries/{API_KEY}")
    if response.json().get("success"):
        return response.json()["countries"]
    else:
        print(f"خطأ: {response.json().get('error')}")
        return None

# إنشاء طلب جديد
def create_order(country_code):
    response = requests.get(f"{BASE_URL}/api/order/{API_KEY}/{country_code}")
    return response.json()

# استخدام الأمثلة
balance = get_balance()
print(f"الرصيد: {balance}")

countries = get_countries()
for country in countries:
    print(f"{country['name']} - {country['price']}$")
مثال JavaScript
const API_KEY = "NU-ABC123-XYZ456-789DEF";
const BASE_URL = "https://hamadh.store/n/api/";

// التحقق من الرصيد
async function getBalance() {
    try {
        const response = await fetch(`${BASE_URL}/api/balance/${API_KEY}`);
        const data = await response.json();
        
        if (data.success) {
            return data.balance;
        } else {
            console.error(`خطأ: ${data.error}`);
            return null;
        }
    } catch (error) {
        console.error('خطأ في الاتصال:', error);
        return null;
    }
}

// الحصول على الدول المتاحة
async function getCountries() {
    try {
        const response = await fetch(`${BASE_URL}/api/countries/${API_KEY}`);
        const data = await response.json();
        
        if (data.success) {
            return data.countries;
        } else {
            console.error(`خطأ: ${data.error}`);
            return null;
        }
    } catch (error) {
        console.error('خطأ في الاتصال:', error);
        return null;
    }
}

// استخدام الأمثلة
getBalance().then(balance => {
    console.log(`الرصيد: ${balance}`);
});

getCountries().then(countries => {
    countries.forEach(country => {
        console.log(`${country.name} - ${country.price}$`);
    });
});