go-mopub
is a library to make MoPub Api requests with golang
Version
Info: v0.1.8
go get github.com/delightroom/go-mopub
apiClient := client.NewClient(MOPUB_API_KEY, MOPUB_API_URL)
To make client with given url
apiClient := GenerateApiClient(MOPUB_API_KEY)
- lineitem get request
resp, err := apiClient.GetLineItem(lineItemID)
- 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"`