From 00ae1ac9ba033414e416a453892ca28e98533c19 Mon Sep 17 00:00:00 2001 From: ownAdx <135326256+ownAdx-prebid@users.noreply.github.com> Date: Mon, 12 Aug 2024 18:51:53 +0530 Subject: [PATCH] OwnAdx: Bidder param and URL updates (#3813) Co-authored-by: Hina Yadav --- adapters/ownadx/ownadx.go | 9 +++++---- adapters/ownadx/ownadx_test.go | 2 +- macros/macros.go | 3 +++ static/bidder-info/ownadx.yaml | 2 +- static/bidder-params/ownadx.json | 7 +------ 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/adapters/ownadx/ownadx.go b/adapters/ownadx/ownadx.go index 5c54b395ddc..59bc0b68fab 100644 --- a/adapters/ownadx/ownadx.go +++ b/adapters/ownadx/ownadx.go @@ -56,9 +56,9 @@ func createBidRequest(rtbBidRequest *openrtb2.BidRequest, imps []openrtb2.Imp) * } func (adapter *adapter) buildEndpointURL(params *openrtb_ext.ExtImpOwnAdx) (string, error) { endpointParams := macros.EndpointTemplateParams{ - ZoneID: params.SspId, - AccountID: params.SeatId, - SourceId: params.TokenId, + SspID: params.SspId, // Macro + SeatID: params.SeatId, + TokenID: params.TokenId, } return macros.ResolveMacros(adapter.endpoint, endpointParams) } @@ -124,6 +124,7 @@ func groupImpsByExt(imps []openrtb2.Imp) (map[openrtb_ext.ExtImpOwnAdx][]openrtb } func (adapter *adapter) MakeBids(internalRequest *openrtb2.BidRequest, externalRequest *adapters.RequestData, response *adapters.ResponseData) (*adapters.BidderResponse, []error) { + if response.StatusCode == http.StatusNoContent { return nil, nil } @@ -159,6 +160,7 @@ func (adapter *adapter) MakeBids(internalRequest *openrtb2.BidRequest, externalR seatBid := bidResp.SeatBid[0] bidResponse := adapters.NewBidderResponseWithBidsCapacity(len(bidResp.SeatBid[0].Bid)) + if len(seatBid.Bid) == 0 { return nil, []error{ &errortypes.BadServerResponse{ @@ -169,7 +171,6 @@ func (adapter *adapter) MakeBids(internalRequest *openrtb2.BidRequest, externalR for i := 0; i < len(seatBid.Bid); i++ { var bidType openrtb_ext.BidType bid := seatBid.Bid[i] - bidType, err := getMediaType(bid) if err != nil { return nil, []error{&errortypes.BadServerResponse{ diff --git a/adapters/ownadx/ownadx_test.go b/adapters/ownadx/ownadx_test.go index 07dc928b9b0..5995cdd10a7 100644 --- a/adapters/ownadx/ownadx_test.go +++ b/adapters/ownadx/ownadx_test.go @@ -11,7 +11,7 @@ import ( func TestJsonSamples(t *testing.T) { bidder, buildErr := Builder(openrtb_ext.BidderOwnAdx, config.Adapter{ - Endpoint: "https://pbs.prebid-ownadx.com/bidder/bid/{{.AccountID}}/{{.ZoneID}}?token={{.SourceId}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"}) + Endpoint: "https://pbs.prebid-ownadx.com/bidder/bid/{{.SeatID}}/{{.SspID}}?token={{.TokenID}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"}) assert.NoError(t, buildErr) adapterstest.RunJSONBidderTest(t, "ownadxtest", bidder) diff --git a/macros/macros.go b/macros/macros.go index 0c8d1428c67..2b0e29d6238 100644 --- a/macros/macros.go +++ b/macros/macros.go @@ -18,6 +18,9 @@ type EndpointTemplateParams struct { PageID string SupplyId string SspId string + SspID string + SeatID string + TokenID string } // UserSyncPrivacy specifies privacy policy macros, represented as strings, for user sync urls. diff --git a/static/bidder-info/ownadx.yaml b/static/bidder-info/ownadx.yaml index ee98a6c9517..073d75f0278 100644 --- a/static/bidder-info/ownadx.yaml +++ b/static/bidder-info/ownadx.yaml @@ -1,4 +1,4 @@ -endpoint: "https://pbs.prebid-ownadx.com/bidder/bid/{{.AccountID}}/{{.ZoneID}}?token={{.SourceId}}" +endpoint: "https://pbs.prebid-ownadx.com/bidder/bid/{{.SeatID}}/{{.SspID}}?token={{.TokenID}}" maintainer: email: prebid-team@techbravo.com capabilities: diff --git a/static/bidder-params/ownadx.json b/static/bidder-params/ownadx.json index f529e74cb01..e0e09a7e9f7 100644 --- a/static/bidder-params/ownadx.json +++ b/static/bidder-params/ownadx.json @@ -18,10 +18,5 @@ "description": "Token ID" } }, - - "oneOf": [ - { "required": ["sspId"] }, - { "required": ["feedId"] }, - { "required": ["token"] } - ] + "required": ["sspId","seatId","tokenId"] }