# Project introduction
go get github.com/huangchunlong818/go-tiktok-shop-api
# Renew
go get -u github.com/huangchunlong818/go-tiktok-shop-api
# Specifying a version
go get -u github.com/huangchunlong818/go-tiktok-shop-api@v0.2.4
go version go1.20.5
import (
"context"
"github.com/huangchunlong818/go-tiktok-shop-api/tiktok/common/config"
)
ctx := context.Background()
config := config.WithApp(config.AppConfig{
AppId: "xxxx",
AppKey: "xxxx",
Secret: "xxxx",
})
// Get instance object
shopClient := tiktokShop.NewTiktokShopClient(config)
var query map[string]string
var body map[string]any
// Get auth url
authClient := shopClient.GetAuthClient()
authUrl := authClient.GetAuthUrl("us")
authApiClient := shopClient.GetAuthApiClient()
getAuthorizedShops := authApiClient.GetAuthorizedShops(ctx, "Access Token")
// Get shop brands
productApiClient := shopClient.GetProductApiClient()
brands := productApiClient.GetBrands(ctx, "Access Token", query)
// Upload Image
productApiClient := shopClient.GetProductApiClient()
imageUpload := productApiClient.ImageUpload(ctx, "Access Token", body, "image path")
// Get shop warehouses
widgetApiClient := shopClient.GetWidgetApiClient()
warehouses := widgetApiClient.GetWarehouses(ctx, "Access Token", query)
- Get Brands - GetBrands
- Get Category Rules - GetCateRule
- Get Categories - GetCate
- Get Attributes - GetCateAttrs
- Check Listing Prerequisites - GetPrerequisites
- Search Products - GetProducts
- Get Product - GetProduct
- Create Product - CreateProduct
- Delete Products - DeleteProducts
- Deactivate Products - DeactivateProducts
- Activate Product - ActivateProducts
- Partial Edit Product - PartialEditProduct
- Update Price - UpdateProductPrice
- Upload Product Image - ImageUpload
- Optimized Images - OptimizedImages
- Upload Product File - FileUpload
- Check Product Listing - CheckProductListing