Connect API

The Connect API provides endpoints for managing social media network connections and integrations.

App Endpoints

Get Networks

Retrieve user’s connected social networks.

POST /api/get/networks/

Response:

{
  "networks": [
    {
      "id": 123,
      "network": "instagram",
      "network_id": "user123",
      "network_url": "https://instagram.com/user123",
      "status": "accepted",
      "followers": 5000,
      "verified": true,
      "connected_at": "2024-01-01T00:00:00Z"
    },
    {
      "id": 124,
      "network": "facebook",
      "network_id": "page456",
      "network_url": "https://facebook.com/page456",
      "status": "pending",
      "followers": 2000,
      "verified": false,
      "connected_at": "2024-01-15T00:00:00Z"
    }
  ]
}

Network Actions

Update Network Extra

Update additional information for a social network connection.

POST /api/action/network-extra/update/

Request Body:

network_id=123
extra_data[bio]=Updated bio information
extra_data[website]=https://example.com
extra_data[category]=fashion
extra_data[engagement_rate]=3.5

Response:

{
  "status": "success",
  "message": "Network extra information updated successfully"
}

Social Authentication

Facebook Authentication

Connect Facebook account.

POST /api/auth/facebook/

Request Body:

access_token=facebook_access_token
user_id=facebook_user_id

Response:

{
  "status": "success",
  "message": "Facebook account connected successfully",
  "network_id": 123
}

Google Authentication

Connect Google account.

POST /api/auth/google/

Request Body:

access_token=google_access_token
user_id=google_user_id

Response:

{
  "status": "success",
  "message": "Google account connected successfully",
  "network_id": 124
}

Instagram Authentication

Connect Instagram account.

POST /api/auth/instagram/

Request Body:

access_token=instagram_access_token
user_id=instagram_user_id

Response:

{
  "status": "success",
  "message": "Instagram account connected successfully",
  "network_id": 125
}

Twitter Authentication

Connect Twitter account.

POST /api/auth/twitter/

Request Body:

access_token=twitter_access_token
user_id=twitter_user_id

Response:

{
  "status": "success",
  "message": "Twitter account connected successfully",
  "network_id": 126
}

Network Management

Network Approval

Submit network for approval.

POST /api/action/network/approval/

Request Body:

{
  "network_type": "instagram",
  "network_id": "user123",
  "network_url": "https://instagram.com/user123",
  "followers": 5000,
  "category": "fashion"
}

Response:

{
  "status": "success",
  "message": "Network submitted for approval",
  "approval_id": 789
}

Network Status

Get network connection status.

POST /api/network/status/

Request Body:

network_id=123

Response:

{
  "status": "accepted",
  "verified": true,
  "followers": 5000,
  "engagement_rate": 3.5,
  "last_updated": "2024-08-01T10:00:00Z"
}

Network Disconnect

Disconnect a social network.

POST /api/network/disconnect/

Request Body:

network_id=123

Response:

{
  "status": "success",
  "message": "Network disconnected successfully"
}

Social Pages

Get Social Pages

Retrieve user’s social pages.

POST /api/get/social-pages/

Response:

{
  "pages": [
    {
      "id": 456,
      "network": "facebook",
      "page_id": "page123",
      "page_name": "Fashion Blog",
      "page_url": "https://facebook.com/page123",
      "status": "accepted",
      "followers": 10000,
      "category": "fashion",
      "connected_at": "2024-01-01T00:00:00Z"
    }
  ]
}

Add Social Page

Add a new social page.

POST /api/add/social-page/

Request Body:

network=facebook
page_id=page456
page_name=Beauty Blog
page_url=https://facebook.com/page456
followers=8000
category=beauty

Response:

{
  "status": "success",
  "message": "Social page added successfully",
  "page_id": 457
}

Social Walls

Get Social Walls

Retrieve user’s social walls.

POST /api/get/social-walls/

Response:

{
  "walls": [
    {
      "id": 789,
      "network": "instagram",
      "wall_id": "wall123",
      "wall_name": "Fashion Wall",
      "wall_url": "https://instagram.com/wall123",
      "status": "accepted",
      "followers": 5000,
      "category": "fashion",
      "connected_at": "2024-01-01T00:00:00Z"
    }
  ]
}

Add Social Wall

Add a new social wall.

POST /api/add/social-wall/

Request Body:

network=instagram
wall_id=wall456
wall_name=Beauty Wall
wall_url=https://instagram.com/wall456
followers=3000
category=beauty

Response:

{
  "status": "success",
  "message": "Social wall added successfully",
  "wall_id": 790
}

Social Channels

Get Social Channels

Retrieve user’s social channels.

POST /api/get/social-channels/

Response:

{
  "channels": [
    {
      "id": 101,
      "network": "youtube",
      "channel_id": "channel123",
      "channel_name": "Fashion Channel",
      "channel_url": "https://youtube.com/channel123",
      "status": "accepted",
      "subscribers": 15000,
      "category": "fashion",
      "connected_at": "2024-01-01T00:00:00Z"
    }
  ]
}

Add Social Channel

Add a new social channel.

POST /api/add/social-channel/

Request Body:

{
  "network": "youtube",
  "channel_id": "channel456",
  "channel_name": "Beauty Channel",
  "channel_url": "https://youtube.com/channel456",
  "subscribers": 8000,
  "category": "beauty"
}

Response:

{
  "status": "success",
  "message": "Social channel added successfully",
  "channel_id": 102
}

Data Models

Social Network

{
  "id": 123,
  "user_id": 456,
  "network": "instagram",
  "network_id": "user123",
  "network_url": "https://instagram.com/user123",
  "status": "accepted",
  "followers": 5000,
  "verified": true,
  "category": "fashion",
  "engagement_rate": 3.5,
  "connected_at": "2024-01-01T00:00:00Z",
  "last_updated": "2024-08-01T10:00:00Z",
  "extra_data": {
    "bio": "Fashion influencer",
    "website": "https://example.com",
    "verified_badge": true
  }
}

Social Page

{
  "id": 456,
  "user_id": 456,
  "network": "facebook",
  "page_id": "page123",
  "page_name": "Fashion Blog",
  "page_url": "https://facebook.com/page123",
  "status": "accepted",
  "followers": 10000,
  "category": "fashion",
  "engagement_rate": 2.8,
  "connected_at": "2024-01-01T00:00:00Z",
  "last_updated": "2024-08-01T10:00:00Z",
  "extra_data": {
    "description": "Fashion and lifestyle blog",
    "category": "Fashion",
    "verification_status": "verified"
  }
}

Social Wall

{
  "id": 789,
  "user_id": 456,
  "network": "instagram",
  "wall_id": "wall123",
  "wall_name": "Fashion Wall",
  "wall_url": "https://instagram.com/wall123",
  "status": "accepted",
  "followers": 5000,
  "category": "fashion",
  "engagement_rate": 4.2,
  "connected_at": "2024-01-01T00:00:00Z",
  "last_updated": "2024-08-01T10:00:00Z",
  "extra_data": {
    "description": "Curated fashion content",
    "posts_count": 150,
    "average_likes": 200
  }
}

Social Channel

{
  "id": 101,
  "user_id": 456,
  "network": "youtube",
  "channel_id": "channel123",
  "channel_name": "Fashion Channel",
  "channel_url": "https://youtube.com/channel123",
  "status": "accepted",
  "subscribers": 15000,
  "category": "fashion",
  "engagement_rate": 5.1,
  "connected_at": "2024-01-01T00:00:00Z",
  "last_updated": "2024-08-01T10:00:00Z",
  "extra_data": {
    "description": "Fashion and beauty videos",
    "videos_count": 50,
    "average_views": 5000
  }
}

Network Status Values

  • pending: Network is submitted but not yet reviewed

  • accepted: Network has been approved and is active

  • rejected: Network has been rejected

  • suspended: Network has been temporarily suspended

  • disconnected: Network has been disconnected by user

Supported Networks

  • Instagram: Instagram personal accounts and business accounts

  • Facebook: Facebook personal profiles and pages

  • Twitter: Twitter accounts

  • YouTube: YouTube channels

  • TikTok: TikTok accounts

  • LinkedIn: LinkedIn profiles and company pages

  • Pinterest: Pinterest accounts and boards

Error Responses

Authentication Errors

{
  "error": "authentication_required",
  "message": "Authentication is required for this endpoint"
}
{
  "error": "invalid_access_token",
  "message": "Invalid or expired access token"
}

Network Errors

{
  "error": "network_already_connected",
  "message": "This network is already connected to your account"
}
{
  "error": "network_not_found",
  "message": "Network not found"
}
{
  "error": "network_verification_failed",
  "message": "Failed to verify network credentials"
}

Validation Errors

{
  "error": "validation_error",
  "message": "Invalid network URL format",
  "field": "network_url"
}
{
  "error": "validation_error",
  "message": "Network type not supported",
  "field": "network"
}

Permission Errors

{
  "error": "permission_denied",
  "message": "You don't have permission to access this network"
}
{
  "error": "network_limit_reached",
  "message": "Maximum number of networks reached"
}