79307008

Date: 2024-12-25 06:44:15
Score: 0.5
Natty:
Report link

Thanks to the answer, I have added the json-bigint to transform the response in my axios request.

export function getTikTokPublishStatus(id: string, tkn: string) { return axios .post( https://open.tiktokapis.com/v2/post/publish/status/fetch/, { publish_id: id, }, { headers: {Authorization: Bearer ${tkn}}, transformResponse: [ (data) => { // Parse response with json-bigint to handle large numbers correctly const jsonData = JSONbig.parse(data); return jsonData; }, ], } ) .then((resp) => { const {data} = resp; // Convert BigInt to string to preserve full number precision const publicId = data.data.publicaly_available_post_id?.[0]?.toString(); return publicId }); }

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Pulkit saini