Skip to content

Commit

Permalink
added constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan-Nava authored Jul 25, 2024
1 parent 891d828 commit 8e21e5c
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tiktok/constants.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package tiktok

const (

BASE_URL = "https://open.tiktokapis.com"
)
50 changes: 50 additions & 0 deletions tiktok/content.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package tiktok

/*
Query Creator Info
To initiate a direct post to a creator's account, you must first use the Query Creator Info endpoint to get the target creator's latest information. For more information about why creator information is necessary, refer to these UX guidelines.
Request:
curl --location --request POST 'https://open.tiktokapis.com/v2/post/publish/creator_info/query/' \
--header 'Authorization: Bearer act.example12345Example12345Example' \
--header 'Content-Type: application/json; charset=UTF-8'
*/
func (o *tiktok) CreatorInfo() {

}

/*
Post a video
To initiate video upload on TikTok's server, you must invoke the Direct Post Video endpoint. You have the following two options:
If you have the video file locally, set the source parameter to FILE_UPLOAD in your request.
If the video is hosted on a URL, set the source parameter to PULL_FROM_URL.
Example
Example using source=FILE_UPLOAD:
Request:
curl --location 'https://open.tiktokapis.com/v2/post/publish/video/init/' \
--header 'Authorization: Bearer act.example12345Example12345Example' \
--header 'Content-Type: application/json; charset=UTF-8' \
--data-raw '{
"post_info": {
"title": "this will be a funny #cat video on your @tiktok #fyp",
"privacy_level": "MUTUAL_FOLLOW_FRIENDS",
"disable_duet": false,
"disable_comment": true,
"disable_stitch": false,
"video_cover_timestamp_ms": 1000
},
"source_info": {
"source": "FILE_UPLOAD",
"video_size": 50000123,
"chunk_size": 10000000,
"total_chunk_count": 5
}
}'
*/
func (o *tiktok) PostVideo() {

}
1 change: 1 addition & 0 deletions tiktok/tiktok.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ func NewTikTok(clientKey, clientSecret string, isDebug bool) (ITiktok, error) {
debug: isDebug,
}
o.restClient.SetDebug(isDebug)
c.restClient.SetBaseURL(BASE_URL)

Check failure on line 27 in tiktok/tiktok.go

View workflow job for this annotation

GitHub Actions / build (1.19.x)

undefined: c

Check failure on line 27 in tiktok/tiktok.go

View workflow job for this annotation

GitHub Actions / build (1.20.x)

undefined: c

Check failure on line 27 in tiktok/tiktok.go

View workflow job for this annotation

GitHub Actions / build (1.21.x)

undefined: c
return o, nil
}

0 comments on commit 8e21e5c

Please sign in to comment.