Posts tagged with java

I am new to Google AdWords API. There is no mention of Keyword in UpdateKeyword class of Google AdWords API, It is only used to update MaxCPC using criterionId. Normally Google AdWords API's are pretty simple, but I am not getting how to update keyword properties. How do I update keyword, KeywordmMatchType, and maxCPC?

  public static void runExample(       AdWordsServicesInterface adWordsServices,       AdWordsSession session,       Long adGroupId,       Long keywordId)       throws RemoteException {     // Get the AdGroupCriterionService.     AdGroupCriterionServiceInterface adGroupCriterionService =         adWordsServices.get(session, AdGroupCriterionServiceInterface.class);     // Create ad group criterion with updated bid.     Criterion criterion = new Criterion();     criterion.setId(keywordId);     BiddableAdGroupCriterion biddableAdGroupCriterion = new BiddableAdGroupCriterion();     biddableAdGroupCriterion.setAdGroupId(adGroupId);     biddableAdGroupCriterion.setCriterion(criterion);     // Create bids.     BiddingStrategyConfiguration biddingStrategyConfiguration = new BiddingStrategyConfiguration();     CpcBid bid = new CpcBid();     bid.setBid(new Money(null, 10000000L));     biddingStrategyConfiguration.setBids(new Bids[] {bid});     biddableAdGroupCriterion.setBiddingStrategyConfiguration(biddingStrategyConfiguration);     // Create operations.     AdGroupCriterionOperation operation = new AdGroupCriterionOperation();     operation.setOperand(biddableAdGroupCriterion);     operation.setOperator(Operator.SET);     AdGroupCriterionOperation[] operations = new AdGroupCriterionOperation[] {operation};     // Update ad group criteria.     AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations);     // Display ad group criteria.     for (AdGroupCriterion adGroupCriterionResult : result.getValue()) {       if (adGroupCriterionResult instanceof BiddableAdGroupCriterion) {         biddableAdGroupCriterion = (BiddableAdGroupCriterion) adGroupCriterionResult;         CpcBid criterionCpcBid = null;         // Find the criterion-level CpcBid among the keyword's bids.         for (Bids bids : biddableAdGroupCriterion.getBiddingStrategyConfiguration().getBids()) {           if (bids instanceof CpcBid) {             CpcBid cpcBid = (CpcBid) bids;             if (BidSource.CRITERION.equals(cpcBid.getCpcBidSource())) {               criterionCpcBid = cpcBid;             }           }         }         System.out.printf(             "Ad group criterion with ad group ID %d, criterion ID %d, type "                 + "'%s', and bid %d was updated.%n",             biddableAdGroupCriterion.getAdGroupId(),             biddableAdGroupCriterion.getCriterion().getId(),             biddableAdGroupCriterion.getCriterion().getCriterionType(),             criterionCpcBid.getBid().getMicroAmount());       }     }   } } 

i want to integrate Whatsapp Business API from facebook business manager.

As per the steps to create WhatsApp account, given in blog (https://www.facebook.com/business/help/2087193751603668?id=2129163877102343)

Steps done by me :

  • First i was created Facebook Business Manager account.
  • Then i was completed business verification in Business Manager.
  • As per above blog , after business verification "Whatsapp Account" option will enabled for me.like this image. (Whatsapp accounts option is enable (option show))
  • Here my business verification verified successfully.but after successfully verification i cant able to show "Whatsapp Accounts" option.like this image (Whatsapp accounts option is not show)

However, I don't see link of "WhatsApp Accounts" in "Accounts" section though my business is verified here. I don't how to proceed ahead without "WhatsApp Accounts" link.

Please guide us for further steps for creating "WhatsApp Accounts" and get the certificate.

I want to update existing feed records using JAVA AdWords API.

I tried but I am getting this error FeedError.DUPLICATE_FEED_NAME I want to make changes in SAME Feed.

Is this even possible?

Code Link: https://www.dropbox.com/home/my%20folder?preview=AddSiteLinksUsingFeeds.java

Error:

WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/C:/Users/Shoaib/.m2/repository/com/google/inject/guice/4.2.2/guice-4.2.2.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release [03 Oct 2019 03:17:59,332-requestInfoLogger:WARN:main] Request made: Service: FeedService Method: mutate clientCustomerId: 209-376-1609 URL: https://adwords.google.com/api/adwords/cm/v201809/FeedService Request ID: 000593fee235f2a202ab42d7be091ca3 ResponseTime(ms): 147 OperationsCount: 0 IsFault: true FaultMessage: ApiException{applicationExceptionType=ApiException, errors=[FeedError{apiErrorType=FeedError, errorString=FeedError.DUPLICATE_FEED_NAME, fieldPath=operations[0].operand.name, fieldPathElements=[FieldPathElement{field=operations, index=0}, FieldPathElement{field=operand}, FieldPathElement{field=name}], reason=DUPLICATE_FEED_NAME, trigger=Feed test 7.6}]} [03 Oct 2019 03:17:59,371-soapXmlLogger:INFO:main] SOAP request: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">     <soapenv:Header>         <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809" soapenv:mustUnderstand="0">             <ns1:clientCustomerId>209-376-1609</ns1:clientCustomerId>             <ns1:developerToken>REDACTED</ns1:developerToken>             <ns1:userAgent>unknown (AwApi-Java, AdWords-Axis/4.7.0, Common-Java/4.7.0, Axis/1.4, Java/12, maven)</ns1:userAgent>             <ns1:validateOnly>false</ns1:validateOnly>             <ns1:partialFailure>false</ns1:partialFailure>         </ns1:RequestHeader>     </soapenv:Header>     <soapenv:Body>         <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201809">             <operations>                 <operator>ADD</operator>                 <operand>                     <name>Feed test 7.6</name>                     <attributes>                         <name>Listing ID</name>                         <type>STRING</type>                     </attributes>                     <attributes>                         <name>Listing Name</name>                         <type>STRING</type>                     </attributes>                     <attributes>                         <name>Final URL</name>                         <type>URL_LIST</type>                     </attributes>                     <attributes>                         <name>Image URL</name>                         <type>URL</type>                     </attributes>                     <attributes>                         <name>City name</name>                         <type>STRING</type>                     </attributes>                     <attributes>                         <name>Description</name>                         <type>STRING</type>                     </attributes>                     <attributes>                         <name>Price</name>                         <type>STRING</type>                     </attributes>                     <attributes>                         <name>Property type</name>                         <type>STRING</type>                     </attributes>                     <attributes>                         <name>Listing type</name>                         <type>STRING</type>                     </attributes>                     <attributes>                         <name>Contextual keywords</name>                         <type>STRING_LIST</type>                     </attributes>                     <attributes>                         <name>Address</name>                         <type>STRING</type>                     </attributes>                     <origin>USER</origin>                 </operand>             </operations>         </mutate>     </soapenv:Body> </soapenv:Envelope> [03 Oct 2019 03:17:59,371-soapXmlLogger:INFO:main] SOAP response: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">     <soap:Header>         <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201809">             <requestId>000593fee235f2a202ab42d7be091ca3</requestId>             <serviceName>FeedService</serviceName>             <methodName>mutate</methodName>             <operations>0</operations>             <responseTime>147</responseTime>         </ResponseHeader>     </soap:Header>     <soap:Body>         <soap:Fault>             <faultcode>soap:Client</faultcode>             <faultstring>[FeedError.DUPLICATE_FEED_NAME @ operations[0].operand.name; trigger:'Feed test 7.6']</faultstring>             <detail>                 <ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201809">                     <message>[FeedError.DUPLICATE_FEED_NAME @ operations[0].operand.name; trigger:'Feed test 7.6']</message>                     <ApplicationException.Type>ApiException</ApplicationException.Type>                     <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="FeedError">                         <fieldPath>operations[0].operand.name</fieldPath>                         <fieldPathElements>                             <field>operations</field>                             <index>0</index>                         </fieldPathElements>                         <fieldPathElements>                             <field>operand</field>                         </fieldPathElements>                         <fieldPathElements>                             <field>name</field>                         </fieldPathElements>                         <trigger>Feed test 7.6</trigger>                         <errorString>FeedError.DUPLICATE_FEED_NAME</errorString>                         <ApiError.Type>FeedError</ApiError.Type>                         <reason>DUPLICATE_FEED_NAME</reason>                     </errors>                 </ApiExceptionFault>             </detail>         </soap:Fault>     </soap:Body> </soap:Envelope> Request failed due to ApiException. Underlying ApiErrors:   Error 0: FeedError{apiErrorType=FeedError, errorString=FeedError.DUPLICATE_FEED_NAME, fieldPath=operations[0].operand.name, fieldPathElements=[FieldPathElement{field=operations, index=0}, FieldPathElement{field=operand}, FieldPathElement{field=name}], reason=DUPLICATE_FEED_NAME, trigger=Feed test 7.6} 

I'm setting up a new connection between whatsapp and zendesk to support better Cust.service experience. The actual goal is to be able to sendout automated response through whatsapp that is triggered from salesforce, but I'm quite new to this and have limited knowledge about whatsapp API.

In our facebook business manager, I have created the Account API WhatsApp Business and also connected the phone number to the API whatsapp business, but the next step is confusing me, which I need to register the app using /v1/account node account. I dont understand this part.

further step is "Request a Registration Code" Send the telephone number and vname certificate string encoded in your base64 to request the registration code. You can request to receive your code via SMS or voice call.

Use endpoint / v1 / account to request your registration code.

POST /v1/account

{ "cc": "your-country-code", "phone_number": "your- phone-number-without-country-code", "method": "sms" | "voice", "cert": "your-verified-name-cert-in-base64", "pin": "your-existing-6-digit-pin" # required if two-factor verification is enabled }

I expect to have whatsapp template that can be used by our registered phone number and set up auto response, then later we can create trigger in salesforce using something (which I still dont know)