Skip to content

delightroom/go-mopub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🔖 go-mopub

go-mopub is a library to make MoPub Api requests with golang

Version Info: v0.1.8

How to get

    go get github.com/delightroom/go-mopub

MoPub Publishment Management Api

How to initiate a client

apiClient := client.NewClient(MOPUB_API_KEY, MOPUB_API_URL)


To make client with given url

apiClient := GenerateApiClient(MOPUB_API_KEY)

Currently available methods

  1. lineitem get request
resp, err := apiClient.GetLineItem(lineItemID)
  1. lineitem put (Bid) request
lineItem := client.LineItemPutBodyData{
    Bid: 0.1 //new bid value
}
resp, err := apiClient.PutLineItem(lineItemID, lineItem)
This library supports below fields for lineitem put request

type LineItemPutBodyData struct {
Name         string   `json:"name,omitempty"`
Bid          float64  `json:"bid,omitempty"`
//Possible values: non_video, all, video
AllowVideo   string   `json:"allowVideo,omitempty"`   
//Possible values: both, non_skippable, skippable
VideoSetting string   `json:"videoSetting,omitempty"` 
//Enabled doesn't exist on get&put response -> needs to be tested in the browser for now
Enabled      bool     `json:"enabled,omitempty"`      
//true -> status(archived) & false ->status(campaign-archived)
Archived     bool     `json:"archived,omitempty"`     
//to see the output of Archived field...! not to change status directly(not supported)
Status       string   `json:"status,omitempty"`       
//Must specify budget if budget type not unlimited
Budget       int64    `json:"budget,omitempty"`       
//if budgtType is limited, budget becomes null
BudgetType   string   `json:"budgetType,omitempty"`   
AdUnitKeys   []string `json:"adUnitKeys,omitempty"`


About

go-mopub is a client to help handling MoPub API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages