MyAds

Авторизоваться Зарегистрироваться

Руководство по интеграции

Руководства для разработчиков

Освойте интеграцию MyAds в вашу цифровую экосистему с помощью пошаговых инструкций и примеров кода.

1

Создайте свое приложение

Определите имя своего приложения, домен и URI перенаправления на панели разработчика, чтобы получить свой уникальный идентификатор клиента и секрет.

Информация: Прежде чем отправлять приложение на проверку, подготовьте общедоступный домен, URL-адреса обратного вызова и запрошенные области.

Идентификатор клиента A unique 32-character hexadecimal identifier generated for your app upon creation.
Client Secret (Secret Key) Держите эти учетные данные в тайне и немедленно меняйте секрет, если он когда-либо станет известен.
Redirect URIs Используйте URL-адреса обратного вызова HTTPS для производственной интеграции. Comma-separated list of authorized callback URLs where the authorization code will be sent.
2

Настроить OAuth 2.0

Внедрите поток кода авторизации, чтобы позволить участникам безопасно предоставлять доступ к своим данным и личности.

Step 1: Request Authorization Code

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

GET /oauth/authorize
GET https://testxxc.lockr.sbs/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

Step 2: Exchange Code for Access 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://testxxc.lockr.sbs/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"
}

Step 3: Access Protected API Endpoints

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

GET /api/developer/v1/me
GET https://testxxc.lockr.sbs/api/developer/v1/me HTTP/1.1
Host: testxxc.lockr.sbs
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://testxxc.lockr.sbs/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://testxxc.lockr.sbs/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://testxxc.lockr.sbs/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://testxxc.lockr.sbs/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://testxxc.lockr.sbs/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://testxxc.lockr.sbs/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://testxxc.lockr.sbs/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://testxxc.lockr.sbs/api/developer/v1/me");
    return await userResponse.Content.ReadAsStringAsync();
}
cURL CLI
# 1. Exchange authorization code for token
curl -X POST https://testxxc.lockr.sbs/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://testxxc.lockr.sbs/api/developer/v1/me \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -H "Accept: application/json"
4

API Endpoints Reference

Complete catalog of available REST API v1 endpoints with request parameters and required scopes. All requests require the Authorization: Bearer {token} header and are rate-limited to 30 requests per minute.

Identity & Profile

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)

Access the primary verified email address of the member.

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)

Follow or unfollow other members on behalf of the user.

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

Content & Interactions & Messages & Notifications

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

Read public posts and status updates authored by the user.

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

Create, update, and publish posts on behalf of the user.

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

Add or toggle likes and reactions to content on behalf of the user.

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

Read private direct message conversations belonging to the user.

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

Send private direct messages on behalf of the user.

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

Read account notifications, alerts, and unread counters.

Wallet & Rewards, Community & Media & Store & Advertising

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

Read user points balance, rewards, and wallet details.

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

Read member badges, unlocked achievements, and quest status.

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

Browse short video clips feed and saved clips in user account.

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

Read forum categories, topics, discussions, and replies.

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

Browse marketplace products, offerings, and store knowledgebase.

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

Read user purchase orders history and submitted offers.

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

Read ad impression counts, clicks, and campaign performance statistics.

App Owner Integrations

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 Scopes Catalog

Granular permissions requested by third-party applications during the OAuth authorization flow.

Category Scope Identifier Description Type
Identity user.identity.read Прочтите идентификатор учетной записи участника и основные общедоступные поля идентификации. Standard Scope
Identity user.profile.read Прочтите детали общедоступного профиля и метаданные основных участников. Standard Scope
Identity user.email.read Access the primary verified email address of the member. Sensitive Scope
Identity user.social_links.read Прочтите общедоступные социальные ссылки, прикрепленные к профилю участника. Standard Scope
Identity user.follows.read Прочтите отношения подписчиков и подписок для видимых участников. Standard Scope
Identity user.follows.write Follow or unfollow other members on behalf of the user. Sensitive Scope
Content user.content.read Read public posts and status updates authored by the user. Standard Scope
Content user.content.write Create, update, and publish posts on behalf of the user. Sensitive Scope
Content user.reactions.write Add or toggle likes and reactions to content on behalf of the user. Standard Scope
Content user.comments.write Publish comments and replies on posts on behalf of the user. Sensitive Scope
Messaging user.messages.read Read private direct message conversations belonging to the user. Sensitive Scope
Messaging user.messages.write Send private direct messages on behalf of the user. Sensitive Scope
Messaging user.notifications.read Read account notifications, alerts, and unread counters. Standard Scope
Economy user.wallet.read Read user points balance, rewards, and wallet details. Sensitive Scope
Economy user.badges.read Read member badges, unlocked achievements, and quest status. Standard Scope
Community user.clips.read Browse short video clips feed and saved clips in user account. Standard Scope
Community user.clips.write Save and unsave short video clips on behalf of the user. Standard Scope
Community user.forums.read Read forum categories, topics, discussions, and replies. Standard Scope
Community user.forums.write Create new topics and post replies in forums on behalf of the user. Sensitive Scope
Commerce user.store.read Browse marketplace products, offerings, and store knowledgebase. Standard Scope
Commerce user.orders.read Read user purchase orders history and submitted offers. Sensitive Scope
Commerce user.ads.read Read ad impression counts, clicks, and campaign performance statistics. Standard Scope
Owner owner.profile.read Прочтите профиль авторизованного владельца через API разработчика. Standard Scope
Owner owner.content.read Прочтите ленту контента авторизованного владельца и опубликованные обновления. Standard Scope
Owner owner.follow.write Подписывайтесь на участников или отписывайтесь от их имени от имени уполномоченного владельца. Sensitive Scope
Owner owner.messages.read Читайте личные сообщения, принадлежащие авторизованному владельцу. Sensitive Scope
Owner owner.messages.write Отправляйте личные сообщения от имени авторизованного владельца. Sensitive Scope
6

Embeddable JavaScript Widgets

Вставьте наши виджеты на свой веб-сайт, чтобы показать свой профиль MyAds , контент или кнопку подписки.

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://testxxc.lockr.sbs/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://testxxc.lockr.sbs/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://testxxc.lockr.sbs/embed/developer/YOUR_APP_ID/content.js"></script>
7

External Web Share API

Используйте Share API, чтобы предварительно заполнить компоновщик сообщений текстом и ссылками.

GET /share Endpoint
https://testxxc.lockr.sbs/share?text=Check+out+this+article!+https://example.com
8

Rate Limiting & Security

API requests are limited to 30 requests per minute per client IP. Bearer tokens must be kept confidential.

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