Skip to content

zoer/yandex-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Yandex Direct API

Build Status

Usage

package main

import (
	"github.com/zoer/yandex-api/direct"
)

func main() {
	token := os.Getenv("YANDEX_API_TOKEN")
	client := direct.NewClient(token)

	id := 123

	// Campaigns list
	campaigns, err := client.Campaigns.GetList()

	// Campaign archive
	err := client.Campaigns.Archive(id)

	// Campaign unarchive
	err := client.Campaigns.UnArchive(id)

	// Campaign stop
	err := client.Campaigns.Stop(id)

	// Campaign resume
	err := client.Campaigns.Resume(id)

	// Campaign delete
	err := client.Campaigns.Delete(id)

	// Campaign create or update
	c := CampaignParams{
		Login:                      "my-login",
		Name:                       "Eric",
		FIO:                        "Eric Cartman",
		StartDate:                  "2012-04-12",
		//...
	}
	id, err := client.Campaigns.CreateOrUpdate(&c)

Tests

$ go test -v ./...

About

Yandex Direct API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages