Documentation
¶
Index ¶
- Constants
- Variables
- func CheckPostMode(mode string) bool
- func CheckPrivacyLevel(level string) bool
- type AccessTokenManagement
- type AdPublishedDateRange
- type DataPublishVideo
- type DataQueryCreatorInfo
- type DataUserInfo
- type DataVideoList
- type ErrorObject
- type ITiktok
- type PhotoSourceInfo
- type PostInfo
- type PostModeOptions
- type PostPhotoInfo
- type PrivacyLevelOptions
- type PublishPhotoRequest
- type PublishStatusFetch
- type PublishStatusFetchRequest
- type PublishStatusFetchResponse
- type PublishVideoRequest
- type PublishVideoResponse
- type QueryCreatorInfoResponse
- type ResearchAdQueryFilter
- type ResearchAdQueryRequest
- type SourceInfo
- type UserInfo
- type UserInfoResponse
- type Video
- type VideoListRequest
- type VideoListResponse
Constants ¶
View Source
const ( BASE_URL = "https://open.tiktokapis.com" QUERY_CREATOR_INFO = "/v2/post/publish/creator_info/query/" POST_PUBLISH_VIDEO_INIT = "/v2/post/publish/video/init/" PUBLISH_STATUS_FETCH = "/v2/post/publish/status/fetch/" POST_PUBLISH_CONTENT_INIT = "/v2/post/publish/content/init/" USER_INFO = "/v2/user/info/" VIDEO_LIST = "/v2/video/list/" RESEARCH_VIDEO_QUERY = "/v2/research/video/query/" RESEARCH_AD_QUERY = "/v2/research/adlib/ad/query/" )
Variables ¶
View Source
var ( API_QUERY_CREATOR_INFO = fmt.Sprintf("%s%s", BASE_URL, QUERY_CREATOR_INFO) API_POST_PUBLISH_VIDEO_INIT = fmt.Sprintf("%s%s", BASE_URL, POST_PUBLISH_VIDEO_INIT) API_PUBLISH_STATUS_FETCH = fmt.Sprintf("%s%s", BASE_URL, PUBLISH_STATUS_FETCH) API_POST_PUBLISH_CONTENT_INIT = fmt.Sprintf("%s%s", BASE_URL, POST_PUBLISH_CONTENT_INIT) API_USER_INFO = fmt.Sprintf("%s%s", BASE_URL, USER_INFO) API_VIDEO_LIST = fmt.Sprintf("%s%s", BASE_URL, VIDEO_LIST) API_RESEARCH_VIDEO_QUERY = fmt.Sprintf("%s%s", BASE_URL, RESEARCH_VIDEO_QUERY) API_RESEARCH_AD_QUERY = fmt.Sprintf("%s%s", BASE_URL, RESEARCH_AD_QUERY) )
View Source
var ( PrivacyLevelWrong = errors.New("Privacy Level is not correct!") PhotoModeWrong = errors.New("Photo mode is not correct!") )
View Source
var Endpoint = oauth2.Endpoint{
AuthURL: "https://www.tiktok.com/v2/auth/authorize/",
TokenURL: "https://open.tiktokapis.com/v2/oauth/token/",
}
Endpoint is TikTok's OAuth 2.0 endpoint.
Functions ¶
func CheckPostMode ¶ added in v0.2.2
CheckPostMode checks if the given string matches any PostModeOptions
func CheckPrivacyLevel ¶ added in v0.2.0
CheckPrivacyLevel checks if the given string matches any PrivacyLevelOptions
Types ¶
type AccessTokenManagement ¶ added in v0.2.4
type AdPublishedDateRange ¶ added in v0.2.5
type DataPublishVideo ¶ added in v0.2.0
type DataPublishVideo struct {
PubblishId string `json:"publish_id"`
}
type DataQueryCreatorInfo ¶ added in v0.2.0
type DataQueryCreatorInfo struct { CreatorAvatarUrl string `json:"creator_avatar_url"` CreatorUsername string `json:"creator_username"` CreatorNickname string `json:"creator_nickname"` PrivacyLevelOptions []string `json:"privacy_level_options"` CommentDisabled bool `json:"comment_disabled"` DuetDisabled bool `json:"duet_disabled"` StitchDisabled bool `json:"stitch_disabled"` }
type DataUserInfo ¶ added in v0.2.2
type DataUserInfo struct {
User UserInfo `json:"user"`
}
type DataVideoList ¶ added in v0.2.3
type DataVideoList struct {
Videos []Video `json:"videos"`
}
type ErrorObject ¶ added in v0.2.0
type ITiktok ¶
type ITiktok interface { // HealthCheck() error IsDebug() bool CodeAuthUrl() string SetAccessToken(token string) GetAccessToken() string // GetClientAccessTokenManagement() (*AccessTokenManagement, error) CreatorInfo() (*QueryCreatorInfoResponse, error) PostVideoInit(title, description, videoUrl string, privacyLevel string, disableDuet, disableComment, disableStitch bool) (*PublishVideoResponse, error) PublishVideo(publishId string) (*PublishStatusFetchResponse, error) GetVideoList(count int64) (*VideoListResponse, error) PostPhotoInit(title, description, privacyLevel string, photoUrls []string, photoMode string) (*PublishStatusFetchResponse, error) UserInfo() (*UserInfoResponse, error) }
type PhotoSourceInfo ¶ added in v0.2.2
type PostInfo ¶ added in v0.2.0
type PostInfo struct { Title string `json:"title"` Description string `json:"description"` PrivacyLevel string `json:"privacy_level"` DisableDuet bool `json:"disable_duet"` DisableComment bool `json:"disable_comment"` DisableStitch bool `json:"disable_stitch"` VideoCoverTimestampMS int64 `json:"video_cover_timestamp_ms"` }
type PostModeOptions ¶ added in v0.2.2
type PostModeOptions string
const ( DIRECT_POST PostModeOptions = "DIRECT_POST" MEDIA_UPLOAD PostModeOptions = "MEDIA_UPLOAD" )
type PostPhotoInfo ¶ added in v0.2.2
type PrivacyLevelOptions ¶ added in v0.2.0
type PrivacyLevelOptions string
const ( PUBLIC_TO_EVERYONE PrivacyLevelOptions = "PUBLIC_TO_EVERYONE" MUTUAL_FOLLOW_FRIENDS PrivacyLevelOptions = "MUTUAL_FOLLOW_FRIENDS" FOLLOWER_OF_CREATOR PrivacyLevelOptions = "FOLLOWER_OF_CREATOR" SELF_ONLY PrivacyLevelOptions = "SELF_ONLY" )
type PublishPhotoRequest ¶ added in v0.2.2
type PublishPhotoRequest struct { PostInfo PostPhotoInfo `json:"post_info"` SourceInfo PhotoSourceInfo `json:"source_info"` PostMode string `json:"post_mode"` // DIRECT_POST | MEDIA_UPLAOD MediaType string `json:"media_type"` // PHOTO }
type PublishStatusFetch ¶ added in v0.2.0
type PublishStatusFetchRequest ¶ added in v0.2.0
type PublishStatusFetchRequest struct {
PublishId string `json:"publish_id"`
}
type PublishStatusFetchResponse ¶ added in v0.2.0
type PublishStatusFetchResponse struct { Data PublishStatusFetch `json:"data"` Error ErrorObject `json:"error"` }
type PublishVideoRequest ¶ added in v0.2.0
type PublishVideoRequest struct { PostInfo PostInfo `json:"post_info"` SourceInfo SourceInfo `json:"source_info"` }
type PublishVideoResponse ¶ added in v0.2.0
type PublishVideoResponse struct { Data DataPublishVideo `json:"data"` Error ErrorObject `json:"error"` }
type QueryCreatorInfoResponse ¶ added in v0.2.0
type QueryCreatorInfoResponse struct { Data DataQueryCreatorInfo `json:"data"` Error ErrorObject `json:"error"` }
type ResearchAdQueryFilter ¶ added in v0.2.5
type ResearchAdQueryFilter struct { AdvertiserBusinessIDs []int64 `json:"advertiser_business_ids"` AdPublishedDateRange AdPublishedDateRange `json:"ad_published_date_range"` CountryCode string `json:"country_code"` }
type ResearchAdQueryRequest ¶ added in v0.2.5
type ResearchAdQueryRequest struct { Filters ResearchAdQueryFilter `json:"filters"` SearchTerm string `json:"search_term"` }
type SourceInfo ¶ added in v0.2.0
type UserInfoResponse ¶ added in v0.2.2
type UserInfoResponse struct { Data DataUserInfo `json:"data"` Error ErrorObject `json:"error"` }
type VideoListRequest ¶ added in v0.2.3
type VideoListRequest struct {
MaxCount int64 `json:"max_count"`
}
type VideoListResponse ¶ added in v0.2.3
type VideoListResponse struct { Data DataVideoList `json:"data"` Error ErrorObject `json:"error"` }
Click to show internal directories.
Click to hide internal directories.