Skip to content

Fykec/yzgo

Repository files navigation

Youzan Golang SDK

通过App Id 和 App Secret来调用

client := YZClient{appID: "<AppID>", appSecret: "<AppSecret>"}
	ret := client.Invoke("kdt.shop.basic.get", "1.0.0", "GET", map[string]string{}, map[string]string{})
	println(ret)

通过OAuth 的access token 来调用 通过appId和appSecret获取accessToken

curl -X POST https://open.youzan.com/oauth/token -H 'content-type: application/x-www-form-urlencoded' -d 'client_id=testclient&client_secret=testclientsecret&grant_type=silent&kdt_id=88888'
    client := YZClient{isOAuth: true, accessToken: "<accessToken>"}
	ret := client.Invoke("kdt.shop.basic.get", "1.0.0", "GET", map[string]string{}, map[string]string{})
	println(ret)

Go Test

在shell中设置 YZAccessToken

export YZAccessToken=<Your Access Token>

Test

go test

About

Youzan Golang SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages