منصة استقل للإعلانات وخدمات السيو

登入 報名

整合指南

開發者指南

透過逐步說明和程式碼範例,掌握將 منصة استقل للإعلانات وخدمات السيو 整合到您的數位生態系統中。

1

創建您的應用程式

在開發人員儀表板中定義您的應用程式名稱、網域和重定向 URI,以接收您唯一的用戶端 ID 和金鑰。

資訊: 在提交應用程式以供審核之前,請準備好您的公共網域、回調 URL 和請求的範圍。

客戶ID A unique 32-character hexadecimal identifier generated for your app upon creation.
Client Secret (Secret Key) 將這些憑證保密,如果秘密洩露,請立即輪調。
Redirect URIs 使用 HTTPS 回呼 URL 進行生產整合。 Comma-separated list of authorized callback URLs where the authorization code will be sent.
2

配置 OAuth 2.0

實施授權程式碼流程,以允許成員安全地授予對其資料和身分的存取權限。

الخطوة 1: طلب رمز التفويض (Auth Code)

Redirect the user to the authorization endpoint. The user will be prompted to grant the requested permissions.

GET /oauth/authorize
GET https://ads.estaql.com/oauth/authorize?
    client_id=YOUR_CLIENT_ID&
    redirect_uri=https://yourapp.com/callback&
    response_type=code&
    scope=user.identity.read%20user.profile.read&
    state=RANDOM_CSRF_STATE

الخطوة 2: استبدال الرمز برمز الوصول (POST /oauth/token)

Once authorized, the user is redirected back to your redirect_uri with a code query parameter. Exchange this code via a secure server-to-server POST request:

POST /oauth/token
POST https://ads.estaql.com/oauth/token
Content-Type: application/json

{
    "grant_type": "authorization_code",
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "redirect_uri": "https://yourapp.com/callback",
    "code": "AUTHORIZATION_CODE"
}
JSON Response (HTTP 200)
{
    "access_token": "def50200a87...",
    "refresh_token": "def50200b92...",
    "expires_in": 3600,
    "token_type": "Bearer"
}

الخطوة 3: الوصول إلى نقاط النهاية المحمية

Provide the access token in the Authorization: Bearer {access_token} HTTP header on all API requests:

GET /api/developer/v1/me
GET https://ads.estaql.com/api/developer/v1/me HTTP/1.1
Host: ads.estaql.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
3

程式碼範例

使用我們全面的程式碼範例連接您的後端或將互動式小工具直接嵌入到您的網站中。

PHP (cURL)
Node.js (Axios)
Python (Requests)
C# (.NET)
cURL CLI
PHP (cURL)
<?php
$clientId = 'YOUR_CLIENT_ID';
$clientSecret = 'YOUR_CLIENT_SECRET';
$code = $_GET['code']; // Code received from authorization redirect

// 1. Exchange code for access token
$ch = curl_init('https://ads.estaql.com/oauth/token');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
    'grant_type'    => 'authorization_code',
    'client_id'     => $clientId,
    'client_secret' => $clientSecret,
    'redirect_uri'  => 'https://yourapp.com/callback',
    'code'          => $code
]);

$response = json_decode(curl_exec($ch), true);
$accessToken = $response['access_token'];

// 2. Fetch authenticated member identity
$ch = curl_init('https://ads.estaql.com/api/developer/v1/me');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $accessToken,
    'Accept: application/json'
]);

$user = json_decode(curl_exec($ch), true);
print_r($user);
?>
Node.js (Axios)
const axios = require('axios');

async function authenticateAndFetchUser(authCode) {
    // 1. Exchange authorization code for token
    const tokenResponse = await axios.post('https://ads.estaql.com/oauth/token', {
        grant_type: 'authorization_code',
        client_id: 'YOUR_CLIENT_ID',
        client_secret: 'YOUR_CLIENT_SECRET',
        redirect_uri: 'https://yourapp.com/callback',
        code: authCode
    });

    const accessToken = tokenResponse.data.access_token;

    // 2. Call Developer API v1 endpoint
    const userResponse = await axios.get('https://ads.estaql.com/api/developer/v1/me', {
        headers: {
            'Authorization': `Bearer ${accessToken}`,
            'Accept': 'application/json'
        }
    });

    return userResponse.data.data;
}
Python (Requests)
import requests

def get_user_profile(auth_code):
    # 1. Exchange code for access token
    token_url = 'https://ads.estaql.com/oauth/token'
    payload = {
        'grant_type': 'authorization_code',
        'client_id': 'YOUR_CLIENT_ID',
        'client_secret': 'YOUR_CLIENT_SECRET',
        'redirect_uri': 'https://yourapp.com/callback',
        'code': auth_code
    }
    token_res = requests.post(token_url, data=payload)
    access_token = token_res.json().get('access_token')

    # 2. Call Developer API v1
    api_url = 'https://ads.estaql.com/api/developer/v1/me'
    headers = {
        'Authorization': f'Bearer {access_token}',
        'Accept': 'application/json'
    }
    user_res = requests.get(api_url, headers=headers)
    return user_res.json()
C# (HttpClient)
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using System.Collections.Generic;

public async Task<string> GetUserProfile(string authCode) {
    using var client = new HttpClient();

    // 1. Exchange code for token
    var parameters = new Dictionary<string, string> {
        { "grant_type", "authorization_code" },
        { "client_id", "YOUR_CLIENT_ID" },
        { "client_secret", "YOUR_CLIENT_SECRET" },
        { "redirect_uri", "https://yourapp.com/callback" },
        { "code", authCode }
    };

    var content = new FormUrlEncodedContent(parameters);
    var tokenResponse = await client.PostAsync("https://ads.estaql.com/oauth/token", content);
    var tokenJson = await tokenResponse.Content.ReadAsStringAsync();
    
    // Parse accessToken from tokenJson ...
    string accessToken = "EXTRACTED_ACCESS_TOKEN";

    // 2. Call Developer API v1
    client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
    client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
    
    var userResponse = await client.GetAsync("https://ads.estaql.com/api/developer/v1/me");
    return await userResponse.Content.ReadAsStringAsync();
}
cURL CLI
# 1. Exchange authorization code for token
curl -X POST https://ads.estaql.com/oauth/token \
     -H "Content-Type: application/x-www-form-urlencoded" \
     -d "grant_type=authorization_code" \
     -d "client_id=YOUR_CLIENT_ID" \
     -d "client_secret=YOUR_CLIENT_SECRET" \
     -d "code=AUTHORIZATION_CODE" \
     -d "redirect_uri=https://yourapp.com/callback"

# 2. Call Developer API v1 with Bearer token
curl -X GET https://ads.estaql.com/api/developer/v1/me \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -H "Accept: application/json"
4

مرجع نقاط نهاية الـ API

كتالوج شامل لكافة نقاط نهاية REST API v1 المتاحة مع المعاملات والصلاحيات المطلوبة. All requests require the Authorization: Bearer {token} header and are rate-limited to 30 requests per minute.

الهوية والملف الشخصي

GET /api/developer/v1/me
user.identity.read

閱讀會員帳戶識別碼和基本公共身分欄位。

GET /api/developer/v1/me/profile
user.profile.read

閱讀公共個人資料詳細資訊和核心成員元資料。

GET /api/developer/v1/me/email
user.email.read (Sensitive)

الوصول إلى عنوان البريد الإلكتروني الموثق لحساب المستخدم.

GET /api/developer/v1/me/social-links
user.social_links.read

閱讀會員個人資料附帶的公開社交連結。

GET /api/developer/v1/me/follows
user.follows.read

讀取可見成員的追蹤者和關注關係。

POST /api/developer/v1/me/follows
user.follows.write (Sensitive)

متابعة أو إلغاء متابعة أعضاء آخرين نيابة عن المستخدم.

Payload: {"target_user_id": 123, "action": "follow|unfollow|toggle"}

المحتوى والتفاعل & الرسائل والإشعارات

GET /api/developer/v1/me/content
user.content.read

قراءة منشورات وتحديثات الحالة العامة للمستخدم.

POST /api/developer/v1/me/content
user.content.write (Sensitive)

إنشاء وتعديل ونشر التحديثات والمنشورات نيابة عن المستخدم.

Payload: {"content": "Post text", "privacy": "public|followers|private"}
POST /api/developer/v1/me/reactions
user.reactions.write

إضافة وإلغاء التفاعلات والإعجابات على المنشورات نيابة عن المستخدم.

Payload: {"status_id": 123}
GET /api/developer/v1/me/messages
user.messages.read (Sensitive)

قراءة محادثات وصندوق الرسائل الخاصة التابعة للمستخدم.

POST /api/developer/v1/me/messages
user.messages.write (Sensitive)

إرسال رسائل خاصة مباشرة نيابة عن المستخدم.

Payload: {"receiver_id": 123, "content": "Message body"}
GET /api/developer/v1/me/notifications
user.notifications.read

قراءة إشعارات وتنبيهات الحساب وعدد التنبيهات غير المقروءة.

المحفظة والمكافآت, المجتمع والوسائط & المتجر والإعلانات

GET /api/developer/v1/me/wallet
user.wallet.read (Sensitive)

قراءة رصيد النقاط والمحفظة المالية الخاصة بحساب المستخدم.

GET /api/developer/v1/me/badges
user.badges.read

قراءة أوسمة العضو وإنجازاته المكتسبة وحالة التحديات.

GET /api/developer/v1/me/clips
user.clips.read

تصفح مقاطع الفيديو القصيرة والمقاطع المحفوظة في حساب العضو.

GET /api/developer/v1/forums
user.forums.read

قراءة أقسام المنتدى والمواضيع والنقاشات والردود.

GET /api/developer/v1/store/products
user.store.read

تصفح قائمة المنتجات والخدمات المعروضة في المتجر وقاعدة المعرفة.

GET /api/developer/v1/me/orders
user.orders.read (Sensitive)

قراءة سجل طلبات الشراء والعروض المقدمة الخاصة بالمستخدم.

GET /api/developer/v1/me/ads/stats
user.ads.read

قراءة إحصائيات ظهور الإعلانات والنقرات وأداء الحملات الإعلانية.

تكاملات مالك التطبيق

GET /api/developer/v1/owner/profile
owner.profile.read

透過開發者 API 讀取授權所有者資料。

GET /api/developer/v1/owner/content
owner.content.read

閱讀授權所有者內容來源和發布的更新。

POST /api/developer/v1/owner/follow
owner.follow.write (Sensitive)

代表授權所有者追蹤或取消追蹤成員。

POST /api/developer/v1/owner/messages
owner.messages.write (Sensitive)

代表授權所有者發送私人訊息。

Payload: {"content": "Message text"}
5

كتالوج صلاحيات OAuth 2.0

أذونات وصلاحيات دقيقة تطلبها التطبيقات الخارجية أثناء عملية مصادقة OAuth.

Category Scope Identifier Description Type
Identity user.identity.read 閱讀會員帳戶識別碼和基本公共身分欄位。 صلاحية قياسية
Identity user.profile.read 閱讀公共個人資料詳細資訊和核心成員元資料。 صلاحية قياسية
Identity user.email.read الوصول إلى عنوان البريد الإلكتروني الموثق لحساب المستخدم. صلاحية حساسة
Identity user.social_links.read 閱讀會員個人資料附帶的公開社交連結。 صلاحية قياسية
Identity user.follows.read 讀取可見成員的追蹤者和關注關係。 صلاحية قياسية
Identity user.follows.write متابعة أو إلغاء متابعة أعضاء آخرين نيابة عن المستخدم. صلاحية حساسة
Content user.content.read قراءة منشورات وتحديثات الحالة العامة للمستخدم. صلاحية قياسية
Content user.content.write إنشاء وتعديل ونشر التحديثات والمنشورات نيابة عن المستخدم. صلاحية حساسة
Content user.reactions.write إضافة وإلغاء التفاعلات والإعجابات على المنشورات نيابة عن المستخدم. صلاحية قياسية
Content user.comments.write نشر تعليقات وردود على المنشورات نيابة عن المستخدم. صلاحية حساسة
Messaging user.messages.read قراءة محادثات وصندوق الرسائل الخاصة التابعة للمستخدم. صلاحية حساسة
Messaging user.messages.write إرسال رسائل خاصة مباشرة نيابة عن المستخدم. صلاحية حساسة
Messaging user.notifications.read قراءة إشعارات وتنبيهات الحساب وعدد التنبيهات غير المقروءة. صلاحية قياسية
Economy user.wallet.read قراءة رصيد النقاط والمحفظة المالية الخاصة بحساب المستخدم. صلاحية حساسة
Economy user.badges.read قراءة أوسمة العضو وإنجازاته المكتسبة وحالة التحديات. صلاحية قياسية
Community user.clips.read تصفح مقاطع الفيديو القصيرة والمقاطع المحفوظة في حساب العضو. صلاحية قياسية
Community user.clips.write حفظ وإلغاء حفظ مقاطع الفيديو القصيرة نيابة عن المستخدم. صلاحية قياسية
Community user.forums.read قراءة أقسام المنتدى والمواضيع والنقاشات والردود. صلاحية قياسية
Community user.forums.write إنشاء مواضيع جديدة ونشر الردود في أقسام المنتدى نيابة عن المستخدم. صلاحية حساسة
Commerce user.store.read تصفح قائمة المنتجات والخدمات المعروضة في المتجر وقاعدة المعرفة. صلاحية قياسية
Commerce user.orders.read قراءة سجل طلبات الشراء والعروض المقدمة الخاصة بالمستخدم. صلاحية حساسة
Commerce user.ads.read قراءة إحصائيات ظهور الإعلانات والنقرات وأداء الحملات الإعلانية. صلاحية قياسية
Owner owner.profile.read 透過開發者 API 讀取授權所有者資料。 صلاحية قياسية
Owner owner.content.read 閱讀授權所有者內容來源和發布的更新。 صلاحية قياسية
Owner owner.follow.write 代表授權所有者追蹤或取消追蹤成員。 صلاحية حساسة
Owner owner.messages.read 閱讀屬於授權所有者的私人訊息對話。 صلاحية حساسة
Owner owner.messages.write 代表授權所有者發送私人訊息。 صلاحية حساسة
6

أدوات JavaScript القابلة للتضمين

在您的網站上嵌入我們的小部件以顯示您的 منصة استقل للإعلانات وخدمات السيو 個人資料、內容或追蹤按鈕。

1. Follow Button Widget

Embed an interactive button allowing visitors to follow your profile on MYADS with a single click.

HTML Embed Code
<div id="myads-widget-follow-YOUR_APP_ID"></div>
<script src="https://ads.estaql.com/embed/developer/YOUR_APP_ID/follow.js"></script>
2. Profile Card Widget

Display your verified badge, avatar, bio, follower count, and stats on your website.

HTML Embed Code
<div id="myads-widget-profile-YOUR_APP_ID"></div>
<script src="https://ads.estaql.com/embed/developer/YOUR_APP_ID/profile.js"></script>
3. Latest Content Feed Widget

Showcase your latest public posts and status updates dynamically inside your web application.

HTML Embed Code
<div id="myads-widget-content-YOUR_APP_ID"></div>
<script src="https://ads.estaql.com/embed/developer/YOUR_APP_ID/content.js"></script>
7

واجهة المشاركة على الويب الخارجية

使用共用 API 為帖子編輯器預先填入文字和連結。

GET /share Endpoint
https://ads.estaql.com/share?text=Check+out+this+article!+https://example.com
8

حدود الطلبات والأمان

طلبات الـ API محددة بـ 30 طلباً في الدقيقة لكل عنوان IP. يجب الحفاظ على سرية رموز Bearer.

Rate Limiting Standard Developer API endpoints: 30 requests per minute per client IP. Rate-limited requests receive HTTP 429 Too Many Requests.
Standard JSON Response Envelope Every response contains consistent success, message, and data fields:
{
    "success": true,
    "message": "Operation completed successfully.",
    "data": { ... }
}
Localization Support (Accept-Language) Send Accept-Language: ar or Accept-Language: en in request headers to receive localized responses and validation messages.
Continuous Audio Player
MYADS Audio
0:00
0:00