MirageCHATEngagePublishGrow
Answered

TikTok music selection through the white-label API

62 views · 3 replies · started

EDErtin D

Hi,

I signed up for the white-label/reseller API and have been testing publishing to Facebook, TikTok and Instagram. All three are working fine so far.

I’m a bit unsure about the music part for TikTok though. In the API docs I can see “select music”, but I couldn’t find an endpoint to browse or get music suggestions based on the video I’m uploading. How is that supposed to work through the API? Is there a seperate endpoint for this, or do I need to choose the track another way first?

Thanks,
Ertin D

JoeTeamDeveloper Relations & Integrations

Hi Ertin,

Joe here, from the MirageCHAT dev team. Thanks for testing the API, and glad Facebook, TikTok and Instagram are all working for you.

For TikTok music there are three steps, no separate upload needed:

  1. Find a sound: GET /api/ext/v1/music?platform=tiktok. Add trending=true&country=US for what's trending in a country, genre=POP to filter, or q=summer to search titles and artists (2+ letters). Every TikTok sound there comes from TikTok's Commercial Music Library, so commercial_ok is true for business accounts.
  2. See how a sound is used (new today): GET /api/ext/v1/music/{id}/videos?country=US returns the TikTok videos trending with that sound: url, embed_url for TikTok's player, author and cover. So you can check it fits before you pick it.
  3. Post with it: on POST /posts add "sound": { "tiktok": "<id>" }. A TikTok sound goes on video posts, through TikTok Business, with privacy set to Everyone.

There's no endpoint yet that suggests music from the video itself. For now you browse or search the catalogue and pick the track. With a reseller key, send X-Workspace-Id on these calls just like the others.

Docs: miragechat.io/developers/publishing/ (Music section), and the OpenAPI file at miragechat.io/developers/publishing/openapi.json

If anything doesn't behave as described, send me the request and the response and I'll look at it.

Cheers,
Joe
MirageCHAT Developer

EDErtin D

Hi Joe, thanks, that clears it up. Being able to see videos using each sound is helpful. I’ll try those endpoints with X-Workspace-Id.

One thing I’m still unsure about: does the API return a preview URL so users can listen to the track before choosing it?

Thanks,
Ertin D

JoeTeamDeveloper Relations & Integrations

Hi Ertin,

Good question, and yes, now it does. Every sound from GET /api/ext/v1/music carries preview_url, an audio preview of the track on TikTok's CDN that you can play in any audio player before choosing it, plus cover_url for the artwork. The same two fields are on sound in GET /api/ext/v1/music/{id}/videos.

A couple of notes:

  • preview_url is there for TikTok sounds. For Instagram it's null, because Instagram doesn't give one.
  • It's only for listening in your own interface. When you post, keep sending the id in "sound": { "tiktok": "<id>" } as before.

The docs are updated: miragechat.io/developers/publishing/ (GET /music).

Cheers,
Joe
MirageCHAT Developer

?
Sign in with your MirageCHAT account to reply. Your name and business show with your reply.