API Documentation


Welcome to El-Makina API Documentation. Integrate our powerful marketing automation features into your own applications.


Getting Started


Authentication

All API requests require authentication using an API key. You can generate your API key from your account dashboard.

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
				

Base URL

All API endpoints are relative to the base URL:

https://www.tijaratech.store/api/v1/
				

Core Endpoints


1. Facebook Pages

List Connected Pages

GET /pages
				

Returns a list of all Facebook pages connected to your account.

Get Page Details

GET /pages/{page_id}
				

2. Messenger Bot

Create Bot Flow

POST /bot/flows
{
  "page_id": "123456789",
  "flow_name": "Welcome Flow",
  "trigger": "keyword",
  "responses": [...]
}
				

List Bot Flows

GET /bot/flows?page_id={page_id}
				

Update Bot Flow

PUT /bot/flows/{flow_id}
				

Delete Bot Flow

DELETE /bot/flows/{flow_id}
				

3. Broadcasting

Send Broadcast Message

POST /broadcast
{
  "page_id": "123456789",
  "message": "Your message here",
  "subscribers": ["user1", "user2"],
  "schedule_time": "2024-01-01 12:00:00"
}
				

Get Broadcast History

GET /broadcast/history?page_id={page_id}
				

4. Subscribers

List Subscribers

GET /subscribers?page_id={page_id}
				

Get Subscriber Details

GET /subscribers/{subscriber_id}
				

Add Tags to Subscriber

POST /subscribers/{subscriber_id}/tags
{
  "tags": ["vip", "customer"]
}
				

5. Social Posting

Create Post

POST /posts
{
  "page_id": "123456789",
  "message": "Your post content",
  "image_url": "https://example.com/image.jpg",
  "schedule_time": "2024-01-01 12:00:00"
}
				

List Scheduled Posts

GET /posts/scheduled?page_id={page_id}
				

Response Format


Success Response

{
  "success": true,
  "data": {...},
  "message": "Operation completed successfully"
}
				

Error Response

{
  "success": false,
  "error": {
    "code": 400,
    "message": "Invalid request parameters"
  }
}
				

Rate Limits


  • Free Plan: 100 requests per hour
  • Pro Plan: 1,000 requests per hour
  • Business Plan: 10,000 requests per hour
  • Enterprise Plan: Custom limits

Webhooks


Configure webhooks to receive real-time notifications for events:

  • New subscriber
  • Message received
  • Comment posted
  • Broadcast completed
  • Bot conversation ended

Webhook Endpoint Setup

POST /webhooks
{
  "url": "https://your-domain.com/webhook",
  "events": ["message.received", "subscriber.new"],
  "secret": "your_webhook_secret"
}
				

Code Examples


PHP Example

<?php
$api_key = 'YOUR_API_KEY';
$url = 'https://www.tijaratech.store/api/v1/pages';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $api_key,
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
print_r($data);
?>
				

JavaScript Example

fetch('https://www.tijaratech.store/api/v1/pages', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
				

Support


For API support and questions:

  • Email: contact@tijaratech.store
  • Support Tickets: Submit a ticket
  • Developer Forum: Coming soon

Note: This API is currently in beta. Features and endpoints may change. We'll notify all API users of any breaking changes at least 30 days in advance.