@robinpath/tiktok
0.1.1Node.jsPublicTikTok module for RobinPath.
TikTok
TikTok module for RobinPath.
Package: @robinpath/tiktok | Category: Social Media | Type: Integration
Authentication
tiktok.setCredentials "your-credentials"
Call this once at the start of your script before using any other function. Credentials persist for the duration of the script execution.
Use Cases
Use the tiktok module when you need to:
- getUserInfo -- Use
tiktok.getUserInfoto perform this operation - listVideos -- Use
tiktok.listVideosto perform this operation - getVideoById -- Use
tiktok.getVideoByIdto perform this operation - initVideoPublish -- Use
tiktok.initVideoPublishto perform this operation - queryCreatorInfo -- Use
tiktok.queryCreatorInfoto perform this operation
Quick Reference
| Function | Description | Returns |
|---|---|---|
setCredentials | Configure tiktok credentials. | object |
getUserInfo | getUserInfo | object |
listVideos | listVideos | object |
getVideoById | getVideoById | object |
initVideoPublish | initVideoPublish | object |
queryCreatorInfo | queryCreatorInfo | object |
getVideoComments | getVideoComments | object |
replyToComment | replyToComment | object |
getVideoInsights | getVideoInsights | object |
searchVideos | searchVideos | object |
getTrendingHashtags | getTrendingHashtags | object |
getHashtagInfo | getHashtagInfo | object |
getUserFollowers | getUserFollowers | object |
getUserFollowing | getUserFollowing | object |
likeVideo | likeVideo | object |
unlikeVideo | unlikeVideo | object |
getAccountStats | getAccountStats | object |
Functions
setCredentials
Configure tiktok credentials.
Module: tiktok | Returns: object -- API response.
tiktok.setCredentials
| Parameter | Type | Required | Description |
|---|---|---|---|
accessToken | string | Yes | accessToken |
getUserInfo
getUserInfo
Module: tiktok | Returns: object -- API response.
tiktok.getUserInfo
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listVideos
listVideos
Module: tiktok | Returns: object -- API response.
tiktok.listVideos
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getVideoById
getVideoById
Module: tiktok | Returns: object -- API response.
tiktok.getVideoById
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
initVideoPublish
initVideoPublish
Module: tiktok | Returns: object -- API response.
tiktok.initVideoPublish
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
queryCreatorInfo
queryCreatorInfo
Module: tiktok | Returns: object -- API response.
tiktok.queryCreatorInfo
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getVideoComments
getVideoComments
Module: tiktok | Returns: object -- API response.
tiktok.getVideoComments
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
replyToComment
replyToComment
Module: tiktok | Returns: object -- API response.
tiktok.replyToComment
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getVideoInsights
getVideoInsights
Module: tiktok | Returns: object -- API response.
tiktok.getVideoInsights
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
searchVideos
searchVideos
Module: tiktok | Returns: object -- API response.
tiktok.searchVideos
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getTrendingHashtags
getTrendingHashtags
Module: tiktok | Returns: object -- API response.
tiktok.getTrendingHashtags
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getHashtagInfo
getHashtagInfo
Module: tiktok | Returns: object -- API response.
tiktok.getHashtagInfo
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getUserFollowers
getUserFollowers
Module: tiktok | Returns: object -- API response.
tiktok.getUserFollowers
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getUserFollowing
getUserFollowing
Module: tiktok | Returns: object -- API response.
tiktok.getUserFollowing
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
likeVideo
likeVideo
Module: tiktok | Returns: object -- API response.
tiktok.likeVideo
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
unlikeVideo
unlikeVideo
Module: tiktok | Returns: object -- API response.
tiktok.unlikeVideo
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getAccountStats
getAccountStats
Module: tiktok | Returns: object -- API response.
tiktok.getAccountStats
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
Error Handling
All functions throw on failure. Common errors:
| Error | Cause |
|---|---|
Tiktok API error (${res.status}): ${t} | Check the error message for details |
tiktok.setCredentials requires accessToken. | Check the error message for details |
tiktok.unlikeVideo requires an ID. | Check the error message for details |
Tiktok: "..." not configured. Call tiktok.setCredentials first. | Check the error message for details |
@desc "Get user info and validate result"
do
set $result as tiktok.getUserInfo
if $result != null
print "Success"
else
print "No result"
end
enddo
Recipes
1. List and iterate UserInfo
Retrieve all items and loop through them.
@desc "Setup authentication"
do
tiktok.setCredentials $token
enddo
@desc "Get user info and iterate results"
do
set $result as tiktok.getUserInfo
each $item in $result
print $item
end
enddo
2. Multi-step TikTok workflow
Chain multiple tiktok operations together.
@desc "Setup authentication"
do
tiktok.setCredentials $token
enddo
@desc "Get user info, list videos, and more"
do
set $r_getUserInfo as tiktok.getUserInfo
set $r_listVideos as tiktok.listVideos
set $r_getVideoById as tiktok.getVideoById
print "All operations complete"
enddo
3. Safe getUserInfo with validation
Check results before proceeding.
@desc "Setup authentication"
do
tiktok.setCredentials $token
enddo
@desc "Get user info and validate result"
do
set $result as tiktok.getUserInfo
if $result != null
print "Success: " + $result
else
print "Operation returned no data"
end
enddo
Related Modules
- facebook -- Facebook module for complementary functionality
- instagram -- Instagram module for complementary functionality
- twitter -- Twitter/X module for complementary functionality
- linkedin -- LinkedIn module for complementary functionality
- pinterest -- Pinterest module for complementary functionality
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.1 | latest | 1 months ago |
Related Modules
activecampaign
JS@robinpathv0.1.2
ActiveCampaign -- contacts, automations, campaigns, deals, lists, and tags via the ActiveCampaign REST API v3.
brevo
JS@robinpathv0.1.2
Brevo module for RobinPath.
convertkit
JS@robinpathv0.1.1
Convertkit module for RobinPath.
@robinpathv0.1.1
Facebook module for RobinPath.
$ robinpath add @robinpath/tiktok
