TikTok Publishing

Learn how to connect TikTok accounts and upload videos to TikTok.

Connecting TikTok Account

Prerequisites

Connection Steps

  1. Click the "Connect TikTok" button on the dashboard
  2. Sign in to TikTok (if not already logged in)
  3. Review and grant the required permissions:
    • video.upload - Upload videos to your account
    • video.publish - Publish videos
    • user.info.basic - Basic user information
    • user.info.profile - Profile information
    • user.info.stats - User statistics
    • video.list - List your videos
  4. Click "Authorize" to complete the authorization

Your TikTok account will now appear in the Authorized Accounts list with:

Token Information

Sandbox Mode Requirements

During TikTok's sandbox/development phase:

Supported Content Types

TikTok supports video uploads only (no photos or text-only posts):

Feature Description Required Limits
Video Video file URL Yes MP4 format recommended
Caption Video caption/description No Max 2200 characters
Privacy Privacy setting No SELF_ONLY (sandbox), PUBLIC_TO_EVERYONE, MUTUAL_FOLLOW_FRIENDS
File Size Maximum video size - Up to 4GB
Duration Video length - 10 minutes max

Publishing Examples

1. Basic Video Upload

{
  "post": {
    "accountId": "your-tiktok-account-id",
    "content": {
      "text": "Check out this amazing video! #tiktok #trending",
      "mediaUrls": ["https://example.com/video.mp4"],
      "platform": "tiktok"
    },
    "target": {
      "targetType": "tiktok"
    }
  }
}

Result: Video uploaded with caption.

2. Video with Hashtags

{
  "post": {
    "accountId": "your-tiktok-account-id",
    "content": {
      "text": "Dancing to the latest trend! πŸ’ƒ #dance #fyp #trending #viral",
      "mediaUrls": ["https://storage.googleapis.com/my-bucket/dance-video.mp4"],
      "platform": "tiktok"
    },
    "target": {
      "targetType": "tiktok"
    }
  }
}

Result: Video with caption and hashtags.

Implementation Details

Upload Process

TikTok uses a specialized chunked upload process:

  1. Download: Video is downloaded from the provided URL
  2. Chunk Calculation:
    • Files < 5MB: Uploaded as single chunk
    • Files β‰₯ 5MB: Split into 10MB chunks using floor division
    • Formula: total_chunks = floor(file_size / chunk_size)
    • Last chunk absorbs all remaining bytes (can exceed 10MB, max 128MB)
  3. Initialize: Upload session is initialized with chunk count
  4. Upload Chunks: Each chunk is uploaded with Content-Range headers
  5. Processing: TikTok processes the video (takes 10-30 seconds)
  6. Publish: Video is published to your account

Example Chunk Calculation

For a 29.9MB video (29,957,059 bytes):

Response Format

Successful Response

{
  "success": true,
  "postSubmissionId": "ca5b8e50-9376-4fbb-b2fc-b619849e3574",
  "platform": "tiktok",
  "post_type": "video",
  "publish_id": "v_pub_file~v2-1.7577571164748499000",
  "status": "PUBLISH_COMPLETE",
  "message": "Post published successfully"
}

Failed Response

{
  "success": false,
  "error": "Account is not a TikTok account",
  "platform": "tiktok"
}

Common Issues

1. "Account is not a TikTok account"

Cause: The provided accountId belongs to a different platform.

Solution:

2. "unaudited_client_can_only_post_to_private_accounts"

Cause: Your TikTok account is not set to Private (required for sandbox mode).

Solution:

  1. Go to TikTok app settings
  2. Set your account to Private
  3. Disconnect and reconnect your TikTok account in Boring
  4. Try publishing again

3. "total chunk count is invalid"

Cause: Internal error with chunk calculation (should not happen with current implementation).

Solution: Contact support if you encounter this error.

4. "url_ownership_unverified"

Cause: Trying to use PULL_FROM_URL method without domain verification.

Solution: This should not occur - Boring automatically uses FILE_UPLOAD method which doesn't require URL verification.

Performance Metrics

After publishing, you can view your TikTok video performance:

  1. Click "View Performance" next to your TikTok account
  2. View metrics for your videos:
    • Views: Number of times your video was viewed
    • Likes: Number of likes on your video
    • Comments: Number of comments
    • Shares: Number of times your video was shared
    • Video Description: Caption text
    • Duration: Video length in seconds
    • Create Time: When the video was published

Best Practices

  1. Video Format: Use MP4 format for best compatibility
  2. File Size: Keep videos under 100MB for faster upload
  3. Captions: Use engaging captions with relevant hashtags
  4. Hashtags: Include 3-5 relevant hashtags for better discoverability
  5. Video Quality: Upload in 1080p or higher for best quality
  6. Duration: Keep videos between 15-60 seconds for best engagement
  7. Testing: Use the "Test Upload" button before API integration

Rate Limits

TikTok API has the following rate limits:

Exceeding these limits will result in 429 Too Many Requests errors.

Next Steps