Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 785 Bytes

README.md

File metadata and controls

43 lines (34 loc) · 785 Bytes

A package for Amazon Advertising API

Installing

go get -u github.com/gzp233/amazon_advertising

This will retrieve the library.

example

package main

import (
	"fmt"

	"github.com/gzp233/amazon_advertising"
)

func main() {
	c, err := amazon_advertising.NewClient(amazon_advertising.ClientOption{
		Region:       "NA",
		ClientId:     "amzn1.application-oa2-client.xxxxxxxxxx",
		ClientSecret: "xxxxxxxxxxxxxxxx",
		RefreshToken: "Atzr|cxxxxxxxxxxxxxxxxxxxxxxxxxx",
	})
	if err != nil {
		fmt.Println(err)
	}

	c.SetProfileId(12345678901111)
	c.SetDebug(true)
	r, err := c.SpListAdGroupsEx()
	if err != nil {
		fmt.Println(err)
	}
	if r != nil {
		fmt.Printf("%s %d", r.Body, r.StatusCode)
	}
}