Skip to content

TikTok Photo Posts Lose Title & Description When Using UPLOAD MethodΒ #1059

@thanhson13

Description

@thanhson13

πŸ“œ Description

When users select the "UPLOAD" content posting method for TikTok photo posts, their title and description are lost even though the TikTok API supports these fields. The title and description are only preserved when using "DIRECT_POST" method, creating inconsistent user experience.

πŸ‘Ÿ Reproduction steps

  1. Go to create a new TikTok post with photo content
  2. Select "UPLOAD" as the content posting method
  3. Add a title (for photos) and description in the provided fields
  4. Publish the post
  5. Check the resulting TikTok post - title and description are missing

Alternative reproduction:

  1. Use "DIRECT_POST" method with same photo, title, and description
  2. Publish the post
  3. Title and description are properly included

πŸ‘ Expected behavior

Both "UPLOAD" and "DIRECT_POST" methods should preserve title and description for photo posts since both use the same TikTok API endpoint (/content/init/) which supports these fields according to the TikTok API documentation.

πŸ‘Ž Actual Behavior

  • UPLOAD method: Title and description are stripped from the API request
  • DIRECT_POST method: Title and description are included correctly
  • Both methods use identical /content/init/ endpoint but only one includes the post metadata

πŸ“ƒ Additional context

Technical Details

  • File affected: libraries/nestjs-libraries/src/integrations/social/tiktok.provider.ts
  • Root cause: Conditional logic on lines 457-458 only includes post_info when content_posting_method === 'DIRECT_POST'
  • Both methods use same endpoint but have different metadata inclusion logic

Current problematic code

...((firstPost?.settings?.content_posting_method || 'DIRECT_POST') === 'DIRECT_POST'
  ? { post_info: { title, description, ... } }
  : {})

API endpoint usage

  • UPLOAD photos: /content/init/ βœ“ supports title/description
  • DIRECT_POST photos: /content/init/ βœ“ supports title/description
  • Current code: Only includes post_info for DIRECT_POST ❌

User Impact

  • Users who prefer UPLOAD method for draft/manual review lose their content metadata
  • Inconsistent behavior between two posting methods for the same content type
  • Users must manually re-add titles/descriptions in TikTok app after upload

API Reference

According to TikTok API documentation, the /content/init/ endpoint supports:

  • title: string (optional, max 90 UTF-16 runes)
  • description: string (optional, max 4000 UTF-16 runes)
  • Both post_mode: "DIRECT_POST" and post_mode: "MEDIA_UPLOAD" (UPLOAD)

Proposed Solution

Update the conditional logic to include post_info for all photo posts regardless of posting method:

// Include post_info for photos regardless of posting method
...(isPhoto ? {
  post_info: this.createPostInfo(postDetails, true)
} : ((firstPost?.settings?.content_posting_method || 'DIRECT_POST') === 'DIRECT_POST' ? {
  post_info: this.createPostInfo(postDetails, false)
} : {})),

This ensures consistent behavior between UPLOAD and DIRECT_POST methods for photo posts while preserving existing video posting behavior.

βœ… I checked and didn't find similar issue

πŸ”§ Are you willing to submit PR?

Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions