আপনার ক্রেতা অ্যাকাউন্ট এবং আপনার যেকোনো ক্লায়েন্টের চলমান ডিলগুলো দেখার জন্য আপনি নিম্নলিখিত পদ্ধতিগুলো ব্যবহার করতে পারেন।
পৃথক ডিল দেখুন
আপনি আপনার ক্রেতা অ্যাকাউন্ট বা আপনার কোনো ক্লায়েন্টের প্রস্তাবের সাথে যুক্ত একটি নির্দিষ্ট Deal খুঁজে পেতে buyers.proposals.deals.get মেথডটি ব্যবহার করতে পারেন।
নিম্নলিখিত নমুনাটি দেখায় কিভাবে আপনি get মেথড ব্যবহার করে কোনো একটি নির্দিষ্ট Deal পুনরুদ্ধার করতে পারেন।
বিশ্রাম
অনুরোধ
GET https://authorizedbuyersmarketplace.googleapis.com/v1/buyers/12345678/proposals/MP21673270/deals/52404?alt=json Authorization: Bearer ACCESS_TOKEN Content-Type: application/json
প্রতিক্রিয়া
{
"name": "buyers/12345678/proposals/MP21673270/deals/52404",
"createTime": "2036-12-27T04:02:39.731Z",
"updateTime": "2036-12-27T04:03:51.097Z",
"proposalRevision": "4",
"displayName": "test_deal_7435251",
"buyer": "buyers/12345678",
"publisherProfile": "buyers/12345678/publisherProfiles/PP54321",
"flightStartTime": "2036-12-28T00:00:00Z",
"flightEndTime": "2036-12-30T23:59:00Z",
"targeting": {
"inventorySizeTargeting": {
"targetedInventorySizes": [
{
"width": "1024",
"height": "768",
"type": "PIXEL"
}
]
}
},
"creativeRequirements": {
"creativePreApprovalPolicy": "SELLER_PRE_APPROVAL_NOT_REQUIRED",
"creativeSafeFrameCompatibility": "COMPATIBLE",
"programmaticCreativeSource": "ADVERTISER",
"creativeFormat": "DISPLAY"
},
"deliveryControl": {
"deliveryRateType": "EVENLY"
},
"billedBuyer": "buyers/12345678",
"dealType": "PROGRAMMATIC_GUARANTEED",
"programmaticGuaranteedTerms": {
"guaranteedLooks": "100",
"fixedPrice": {
"type": "CPM",
"amount": {
"currencyCode": "CNY",
"units": "10"
}
},
"reservationType": "STANDARD"
},
"sellerTimeZone": {
"id": "Asia/Shanghai"
}
}জাভা
/* * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.api.services.samples.authorizedbuyers.marketplace.v1.buyers.clients.users; import com.google.api.services.authorizedbuyersmarketplace.v1.AuthorizedBuyersMarketplace; import com.google.api.services.samples.authorizedbuyers.marketplace.v1.Utils; import java.io.IOException; import java.security.GeneralSecurityException; import net.sourceforge.argparse4j.ArgumentParsers; import net.sourceforge.argparse4j.inf.ArgumentParser; import net.sourceforge.argparse4j.inf.ArgumentParserException; import net.sourceforge.argparse4j.inf.Namespace; /** * This sample illustrates how to delete a client user for the given buyer, client, and user IDs. */ public class DeleteClientUsers { public static void execute(AuthorizedBuyersMarketplace marketplaceClient, Namespace parsedArgs) { Long accountId = parsedArgs.getLong("account_id"); Long clientId = parsedArgs.getLong("client_id"); Long clientUserId = parsedArgs.getLong("client_user_id"); String name = String.format("buyers/%d/clients/%d/users/%d", accountId, clientId, clientUserId); try { marketplaceClient.buyers().clients().users().delete(name).execute(); } catch (IOException ex) { System.out.printf("Marketplace API returned error response:%n%s", ex); System.exit(1); } System.out.printf("Deleted client user with name \"%s\":%n", name); } public static void main(String[] args) { ArgumentParser parser = ArgumentParsers.newFor("DeactivateClientUsers") .build() .defaultHelp(true) .description(("Delete a client user with the given buyer, client, and user ID.")); parser .addArgument("-a", "--account_id") .help( "The resource ID of the buyers resource under which the parent client was created. " + "This will be used to construct the name used as a path parameter for the " + "users.delete request.") .required(true) .type(Long.class); parser .addArgument("-c", "--client_id") .help( "The resource ID of the buyers.clients resource under which the client user was" + " created. This will be used to construct the name used as a path parameter for" + " the users.delete request.") .required(true) .type(Long.class); parser .addArgument("-u", "--client_user_id") .help( "The resource ID of the buyers.clients.users resource that is being deleted. " + "This will be used to construct the name used as a path parameter for the " + "users.delete request.") .required(true) .type(Long.class); Namespace parsedArgs = null; try { parsedArgs = parser.parseArgs(args); } catch (ArgumentParserException ex) { parser.handleError(ex); System.exit(1); } AuthorizedBuyersMarketplace client = null; try { client = Utils.getMarketplaceClient(); } catch (IOException ex) { System.out.printf("Unable to create Marketplace API service:%n%s", ex); System.out.println("Did you specify a valid path to a service account key file?"); System.exit(1); } catch (GeneralSecurityException ex) { System.out.printf("Unable to establish secure HttpTransport:%n%s", ex); System.exit(1); } execute(client, parsedArgs); } }
একাধিক ডিল তালিকাভুক্ত করুন
আপনার অ্যাকাউন্ট বা আপনার কোনো ক্লায়েন্টের জন্য কোনো প্রস্তাবের সাথে যুক্ত সমস্ত ডিল পর্যায়ক্রমে দেখতে আপনি buyers.proposals.deals.list পদ্ধতিটি ব্যবহার করতে পারেন।
নিম্নলিখিত নমুনাটি দেখায় যে আপনি কীভাবে list মেথড ব্যবহার করে ডিলগুলির তালিকা তৈরি করতে পারেন।
বিশ্রাম
অনুরোধ
GET https://authorizedbuyersmarketplace.googleapis.com/v1/buyers/12345678/proposals/MP21673270/deals?pageSize=50&alt=json Authorization: Bearer ACCESS_TOKEN Content-Type: application/json
প্রতিক্রিয়া
{
"deals": [
{
"name": "buyers/12345678/proposals/MP21673270/deals/52404",
"createTime": "2036-12-27T04:02:39.731Z",
"updateTime": "2036-12-27T04:03:51.097Z",
"proposalRevision": "4",
"displayName": "test_deal_7435251",
"buyer": "buyers/12345678",
"publisherProfile": "buyers/12345678/publisherProfiles/PP54321",
"flightStartTime": "2036-12-28T00:00:00Z",
"flightEndTime": "2036-12-30T23:59:00Z",
"targeting": {
"inventorySizeTargeting": {
"targetedInventorySizes": [
{
"width": "1024",
"height": "768",
"type": "PIXEL"
}
]
}
},
"creativeRequirements": {
"creativePreApprovalPolicy": "SELLER_PRE_APPROVAL_NOT_REQUIRED",
"creativeSafeFrameCompatibility": "COMPATIBLE",
"programmaticCreativeSource": "ADVERTISER",
"creativeFormat": "DISPLAY"
},
"deliveryControl": {
"deliveryRateType": "EVENLY"
},
"billedBuyer": "buyers/12345678",
"dealType": "PROGRAMMATIC_GUARANTEED",
"programmaticGuaranteedTerms": {
"guaranteedLooks": "100",
"fixedPrice": {
"type": "CPM",
"amount": {
"currencyCode": "CNY",
"units": "10"
}
},
"reservationType": "STANDARD"
},
"sellerTimeZone": {
"id": "Asia/Shanghai"
}
}
]
}জাভা
/* * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.api.services.samples.authorizedbuyers.marketplace.v1.buyers.proposals.deals; import com.google.api.services.authorizedbuyersmarketplace.v1.AuthorizedBuyersMarketplace; import com.google.api.services.authorizedbuyersmarketplace.v1.model.Deal; import com.google.api.services.authorizedbuyersmarketplace.v1.model.ListDealsResponse; import com.google.api.services.samples.authorizedbuyers.marketplace.v1.Utils; import java.io.IOException; import java.security.GeneralSecurityException; import java.util.List; import net.sourceforge.argparse4j.ArgumentParsers; import net.sourceforge.argparse4j.inf.ArgumentParser; import net.sourceforge.argparse4j.inf.ArgumentParserException; import net.sourceforge.argparse4j.inf.Namespace; /** This sample illustrates how to list deals for the given buyer's proposal. */ public class ListDeals { public static void execute(AuthorizedBuyersMarketplace marketplaceClient, Namespace parsedArgs) { Long accountId = parsedArgs.getLong("account_id"); String proposalId = parsedArgs.getString("proposal_id"); Integer pageSize = parsedArgs.getInt("page_size"); String parent = String.format("buyers/%d/proposals/%s", accountId, proposalId); String pageToken = null; System.out.printf("Found deals for proposal with name \"%s\":%n", parent); do { List<Deal> deals = null; try { ListDealsResponse response = marketplaceClient .buyers() .proposals() .deals() .list(parent) .setPageSize(pageSize) .setPageToken(pageToken) .execute(); deals = response.getDeals(); pageToken = response.getNextPageToken(); } catch (IOException ex) { System.out.printf("Marketplace API returned error response:%n%s", ex); System.exit(1); } if (deals == null) { System.out.println("No proposals found."); } else { for (Deal deal : deals) { Utils.printDeal(deal); } } } while (pageToken != null); } public static void main(String[] args) { ArgumentParser parser = ArgumentParsers.newFor("ListDeals") .build() .defaultHelp(true) .description(("Lists deals for the given buyer's proposal.")); parser .addArgument("-a", "--account_id") .help( "The resource ID of the buyers resource under which the deals are being retrieved. This" + " will be used to construct the parent used as a path parameter for the" + " deals.list request.") .required(true) .type(Long.class); parser .addArgument("--proposal_id") .help( "The resource ID of the buyers.proposals resource under which the deals are being" + " retrieved. This will be used to construct the parent used as a path parameter" + " for the deals.list request.") .required(true); parser .addArgument("-p", "--page_size") .help( "The number of rows to return per page. The server may return fewer rows than " + "specified.") .setDefault(Utils.getMaximumPageSize()) .type(Integer.class); Namespace parsedArgs = null; try { parsedArgs = parser.parseArgs(args); } catch (ArgumentParserException ex) { parser.handleError(ex); System.exit(1); } AuthorizedBuyersMarketplace client = null; try { client = Utils.getMarketplaceClient(); } catch (IOException ex) { System.out.printf("Unable to create Marketplace API service:%n%s", ex); System.out.println("Did you specify a valid path to a service account key file?"); System.exit(1); } catch (GeneralSecurityException ex) { System.out.printf("Unable to establish secure HttpTransport:%n%s", ex); System.exit(1); } execute(client, parsedArgs); } }