Publish video when app is in sandbox mode with SELF_ONLY for privacy_level

When using direct post : https://developers.tiktok.com/doc/content-posting-api-reference-direct-post

I send this body to the endpoint :

const response = await fetch('https://open.tiktokapis.com/v2/post/publish/video/init/', {
            method: 'POST',
            headers: {
                'Authorization': `Bearer ${accessToken}`,
                'Content-Type': 'application/json',
            },
            body: JSON.stringify({
                post_info: {
                    title: "In titre",
                    privacy_level: "SELF_ONLY", // Options possibles: PUBLIC, PRIVATE, MUTUAL_FOLLOW_FRIENDS
                    disable_duet: false,
                    disable_comment: false,
                    disable_stitch: false,
                    video_cover_timestamp_ms: 1000 
                },
                source_info: {
                    source: 'FILE_UPLOAD',
                    video_size: videoSize,
                    chunk_size:  videoSize,
                    total_chunk_count: 1
                }
            }),
        });

But I got :

{"error":{"code":"unaudited_client_can_only_post_to_private_accounts","message":"Please review our integration guidelines at https://developers.tiktok.com/doc/content-sharing-guidelines/","log_id":"20250204173051E077C4622B4DD2060769"}}

I'm aware that as long as my app is in a sandbox I can't post a public video, but how to send it as a "draft" ?

The doc says private_level can be :

PUBLIC_TO_EVERYONE
MUTUAL_FOLLOW_FRIENDS
FOLLOWER_OF_CREATOR
SELF_ONLY

I thought SELF_ONLY means private

I can use the upload feature instead of "direct post" :

https://developers.tiktok.com/doc/content-posting-api-get-started-upload-content

But I can't give a video description with those endpoints

Thanks

Upvotes: 0

Views: 40

Answers (0)

Related Questions