Skip to content

Commit

Permalink
OwnAdx: Bidder param and URL updates (prebid#3813)
Browse files Browse the repository at this point in the history
Co-authored-by: Hina Yadav <hina.yadav@vertoz.com>
  • Loading branch information
2 people authored and bevenio committed Aug 22, 2024
1 parent 80c7492 commit 00ae1ac
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
9 changes: 5 additions & 4 deletions adapters/ownadx/ownadx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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{
Expand All @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion adapters/ownadx/ownadx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions macros/macros.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion static/bidder-info/ownadx.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
7 changes: 1 addition & 6 deletions static/bidder-params/ownadx.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,5 @@
"description": "Token ID"
}
},

"oneOf": [
{ "required": ["sspId"] },
{ "required": ["feedId"] },
{ "required": ["token"] }
]
"required": ["sspId","seatId","tokenId"]
}

0 comments on commit 00ae1ac

Please sign in to comment.