Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

fix(tiktok): send an empty JSON object to creator_info (#224)

Mohammed Almuhannae52d1d7b258d
diff --git a/app/Services/Social/TikTokCreatorInfo.php b/app/Services/Social/TikTokCreatorInfo.php
index ce0586749..71ce1a4d6 100644
--- a/app/Services/Social/TikTokCreatorInfo.php
+++ b/app/Services/Social/TikTokCreatorInfo.php
@@ -65,7 +65,8 @@ class TikTokCreatorInfo
$this->accessToken = $account->access_token;
$response = $this->getHttpClient()
- ->post("{$this->baseUrl}/post/publish/creator_info/query/", []);
+ ->withBody('{}', 'application/json; charset=UTF-8')
+ ->post("{$this->baseUrl}/post/publish/creator_info/query/");
if ($response->failed()) {
Log::warning('TikTok creator_info query failed', [
diff --git a/tests/Feature/Services/Social/TikTokCreatorInfoTest.php b/tests/Feature/Services/Social/TikTokCreatorInfoTest.php
index f12bed08c..d25edfb7b 100644
--- a/tests/Feature/Services/Social/TikTokCreatorInfoTest.php
+++ b/tests/Feature/Services/Social/TikTokCreatorInfoTest.php
@@ -49,6 +49,18 @@ test('it returns full creator payload from api response', function () {
->and($info['max_video_post_duration_sec'])->toBe(600);
});
+test('it sends an empty json object as the request body', function () {
+ Http::fake([
+ $this->api.'/post/publish/creator_info/query/' => Http::response(['data' => []], 200),
+ ]);
+
+ $this->service->fetch($this->account);
+
+ Http::assertSent(function ($request) {
+ return $request->body() === '{}';
+ });
+});
+
test('it returns an empty payload when the api fails', function () {
Http::fake([
$this->api.'/post/publish/creator_info/query/' => Http::response(['error' => 'unauthorized'], 401),