Skip to content

Latest commit

 

History

History
223 lines (143 loc) · 6.41 KB

DirectDealsAPI.md

File metadata and controls

223 lines (143 loc) · 6.41 KB

\DirectDealsAPI

All URIs are relative to https://up.go-adserver.com

Method HTTP request Description
ApiV1CampaignsDirectdealIdCancelPut Put /api/v1/campaigns/directdeal/{id}/cancel Cancel a direct deal.
ApiV1DirectDealsAdzonesGet Get /api/v1/direct-deals/adzones Ad zones a direct deal can be booked on.
ApiV1DirectDealsGet Get /api/v1/direct-deals List direct deals with their derived status.

ApiV1CampaignsDirectdealIdCancelPut

ApiV1CampaignsDirectdealIdCancelPut(ctx, id).Execute()

Cancel a direct deal.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/goadserver/goadserver-go"
)

func main() {
	id := int32(56) // int32 | The direct deal (campaign) id.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.DirectDealsAPI.ApiV1CampaignsDirectdealIdCancelPut(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DirectDealsAPI.ApiV1CampaignsDirectdealIdCancelPut``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id int32 The direct deal (campaign) id.

Other Parameters

Other parameters are passed through a pointer to a apiApiV1CampaignsDirectdealIdCancelPutRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ApiV1DirectDealsAdzonesGet

ApiV1DirectDealsAdzonesGet(ctx).WebsiteId(websiteId).Execute()

Ad zones a direct deal can be booked on.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/goadserver/goadserver-go"
)

func main() {
	websiteId := int32(56) // int32 | Only zones on this site. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.DirectDealsAPI.ApiV1DirectDealsAdzonesGet(context.Background()).WebsiteId(websiteId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DirectDealsAPI.ApiV1DirectDealsAdzonesGet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiApiV1DirectDealsAdzonesGetRequest struct via the builder pattern

Name Type Description Notes
websiteId int32 Only zones on this site.

Return type

(empty response body)

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ApiV1DirectDealsGet

ApiV1DirectDealsGet(ctx).Page(page).PerPage(perPage).Status(status).WebsiteIds(websiteIds).AdType(adType).TagIds(tagIds).FilterName(filterName).SortBy(sortBy).SortDir(sortDir).Execute()

List direct deals with their derived status.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/goadserver/goadserver-go"
)

func main() {
	page := int32(56) // int32 |  (optional) (default to 1)
	perPage := int32(56) // int32 |  (optional) (default to 20)
	status := "status_example" // string | CSV of active, paused, pending, completed, ended, cancelled, rejected. (optional)
	websiteIds := "websiteIds_example" // string | CSV of site ids (the booked zone's site). (optional)
	adType := "adType_example" // string | CSV of ad type ids. (optional)
	tagIds := "tagIds_example" // string | CSV of tag ids; a folder tag also matches its sub-tags. (optional)
	filterName := "filterName_example" // string | Name substring. (optional)
	sortBy := "sortBy_example" // string |  (optional) (default to "id")
	sortDir := "sortDir_example" // string |  (optional) (default to "desc")

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.DirectDealsAPI.ApiV1DirectDealsGet(context.Background()).Page(page).PerPage(perPage).Status(status).WebsiteIds(websiteIds).AdType(adType).TagIds(tagIds).FilterName(filterName).SortBy(sortBy).SortDir(sortDir).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DirectDealsAPI.ApiV1DirectDealsGet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiApiV1DirectDealsGetRequest struct via the builder pattern

Name Type Description Notes
page int32 [default to 1]
perPage int32 [default to 20]
status string CSV of active, paused, pending, completed, ended, cancelled, rejected.
websiteIds string CSV of site ids (the booked zone's site).
adType string CSV of ad type ids.
tagIds string CSV of tag ids; a folder tag also matches its sub-tags.
filterName string Name substring.
sortBy string [default to "id"]
sortDir string [default to "desc"]

Return type

(empty response body)

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]