Skip to content

huangchunlong818/go-tiktok-shop-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tiktok Shop Api - Golang

Api Version

Tiktok Shop Api 202309

Install

# 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

Development Environment

go version go1.20.5

Example

Initialization

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

Authorization related

// Get auth url
authClient := shopClient.GetAuthClient()
authUrl := authClient.GetAuthUrl("us")

authApiClient := shopClient.GetAuthApiClient()
getAuthorizedShops := authApiClient.GetAuthorizedShops(ctx, "Access Token")

Products related

// 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")

Logistics related

// Get shop warehouses
widgetApiClient := shopClient.GetWidgetApiClient()
warehouses := widgetApiClient.GetWarehouses(ctx, "Access Token", query)

Supported APIs

Authorization

  1. Get Authorized Shops - GetAuthorizedShops

Product

  1. Get Brands - GetBrands
  2. Get Category Rules - GetCateRule
  3. Get Categories - GetCate
  4. Get Attributes - GetCateAttrs
  5. Check Listing Prerequisites - GetPrerequisites
  6. Search Products - GetProducts
  7. Get Product - GetProduct
  8. Create Product - CreateProduct
  9. Delete Products - DeleteProducts
  10. Deactivate Products - DeactivateProducts
  11. Activate Product - ActivateProducts
  12. Partial Edit Product - PartialEditProduct
  13. Update Price - UpdateProductPrice
  14. Upload Product Image - ImageUpload
  15. Optimized Images - OptimizedImages
  16. Upload Product File - FileUpload
  17. Check Product Listing - CheckProductListing

Logistics

  1. Get Warehouse List - GetWarehouses

More content to come

About

Related interfaces of tiktok shop api

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages