مرجع API

كل ما تحتاجه لتوثيق الطلبات وإنشاء الروابط المختصرة وقراءة استخدام مساحة Urlivo الخاصة بك.

مصادقة Bearer

قم بتوثيق كل طلب باستخدام مفتاح API داخل ترويسة Authorization.

حدود حسب الخطة

وصول API وعدد المفاتيح والحدود بالساعة تعتمد على الخطة المرتبطة بمساحتك.

JSON إدخالًا وإخراجًا

أرسل JSON في عمليات الكتابة وتوقع ردود JSON مع كائنات meta و error بشكل متناسق.

ترويسة التوثيق

Authorization: Bearer YOUR_API_KEY

مثال على استجابة الحالة

{
    "data": {
        "name": "Urlivo",
        "version": "v1",
        "docs_url": "https://urlivo.com/developers/api",
        "user": {
            "id": "u_123",
            "email": "hello@example.com",
            "name": "Jane Doe"
        }
    },
    "meta": {}
}

المسارات

الإصدار الأول من API يركز على إنشاء الروابط وإدارتها وقراءة استخدام المساحة وإدارة النطاقات.

GET الحصول على حالة API
/api/v1/status
curl -X GET \
  https://urlivo.com/api/v1/status \
  -H "Authorization: Bearer YOUR_API_KEY"
GET الحصول على استخدام المساحة
/api/v1/me/usage
curl -X GET \
  https://urlivo.com/api/v1/me/usage \
  -H "Authorization: Bearer YOUR_API_KEY"
GET عرض الروابط
/api/v1/links
curl -X GET \
  "https://urlivo.com/api/v1/links?status=active&sort=newest" \
  -H "Authorization: Bearer YOUR_API_KEY"
POST إنشاء رابط
/api/v1/links
curl -X POST \
  https://urlivo.com/api/v1/links \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "target_url": "https://example.com/campaign",
    "slug": "spring24",
    "title": "Spring campaign",
    "domain": "urlivo.com"
  }'
GET جلب رابط واحد
/api/v1/links/{id}
curl -X GET \
  https://urlivo.com/api/v1/links/l_ab12cd34 \
  -H "Authorization: Bearer YOUR_API_KEY"
PATCH تحديث رابط
/api/v1/links/{id}
curl -X PATCH \
  https://urlivo.com/api/v1/links/l_ab12cd34 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Spring campaign 2026",
    "status": "disabled"
  }'
DELETE حذف رابط
/api/v1/links/{id}
curl -X DELETE \
  https://urlivo.com/api/v1/links/l_ab12cd34 \
  -H "Authorization: Bearer YOUR_API_KEY"
GET عرض النطاقات المتاحة
/api/v1/domains
curl -X GET \
  https://urlivo.com/api/v1/domains \
  -H "Authorization: Bearer YOUR_API_KEY"

مثال على استجابة قائمة

{
    "data": [
        {
            "id": "l_ab12cd34",
            "short_url": "https://urlivo.com/spring24",
            "domain": "urlivo.com",
            "domain_type": "system",
            "slug": "spring24",
            "title": "Spring campaign",
            "target_url": "https://example.com/campaign",
            "status": "active",
            "clicks": 42,
            "expires_at": "",
            "created_at": "2026-03-09 10:00:00",
            "updated_at": "2026-03-09 10:00:00"
        }
    ],
    "meta": {
        "page": 1,
        "per_page": 20,
        "total": 1,
        "has_more": false
    }
}

مثال على استجابة خطأ

{
    "error": {
        "code": "invalid_url",
        "message": "Please enter a valid URL starting with http:// or https://.",
        "status": 422,
        "meta": {}
    }
}

ملاحظات التنفيذ