Php: KeywordUpdate API

 I have used below code for keyword updates api. When i try with status it execute correctly & update. if i set bid its not update...there is no changes..
Note: i have set my keyword bid is current adgroup bid. 
include 'bingads/CampaignManagementClasses.php';
include 'bingads/ClientProxy.php';
// Specify the BingAds\Reporting objects that will be used.
use BingAds\CampaignManagement\UpdateKeywordsRequest;
// Specify the BingAds\Proxy object that will be used.
use BingAds\Proxy\ClientProxy;
// Disable WSDL caching.
ini_set("soap.wsdl_cache_enabled", "0");
ini_set("soap.wsdl_cache_ttl", "0");
// Specify your credentials.
$AuthenticationToken = $accessToken;
$DeveloperToken = "*********";
$AccountId = ******;
$CustomerId = ******;
$AdGroupId = ******;
// Reporting WSDL.
$wsdl = "https://api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/V9/CampaignManagementService.svc?singleWsdl";
try
    $proxy = ClientProxy::ConstructWithAccountAndCustomerId($wsdl, null, null, $DeveloperToken, $AccountId, $CustomerId, $AuthenticationToken);
 $UpdateKeywordsRequest = new UpdateKeywordsRequest();   
 $UpdateKeywordsRequest->AdGroupId = $AdGroupId;
 $UpdateKeywordsRequest->Keywords[0]['Id'] = 123456;
 $UpdateKeywordsRequest->Keywords[0]['Bid'] = 2;
 $UpdateKeywordsResponse = UpdateKeywordsRequest(
    $proxy, 
    $UpdateKeywordsRequest
if($UpdateKeywordsResponse != '')    
    print_r($UpdateKeywordsResponse); 
catch (SoapFault $e)
// Output the last request/response.
print "\nLast SOAP request/response:\n";
print $proxy->GetWsdl() . "\n";
print $proxy->GetService()->__getLastRequest()."\n";
print $proxy->GetService()->__getLastResponse()."\n";
// Reporting service operations can throw AdApiFaultDetail.
if (isset($e->detail->AdApiFaultDetail))
// Log this fault.
print "The operation failed with the following faults:\n";
$errors = is_array($e->detail->AdApiFaultDetail->Errors->AdApiError)
? $e->detail->AdApiFaultDetail->Errors->AdApiError
: array('AdApiError' => $e->detail->AdApiFaultDetail->Errors->AdApiError);
// If the AdApiError array is not null, the following are examples of error codes that may be found.
foreach ($errors as $error)
print "AdApiError\n";
printf("Code: %d\nError Code: %s\nMessage: %s\n", $error->Code, $error->ErrorCode, $error->Message);
switch ($error->Code)
case 0:    // InternalError
break;
case 105:  // InvalidCredentials
break;
default:
print "Please see MSDN documentation for more details about the error code output above.\n";
break;
// Reporting service operations can throw ApiFaultDetail.
elseif (isset($e->detail->ApiFaultDetail))
// Log this fault.
print "The operation failed with the following faults:\n";
// If the BatchError array is not null, the following are examples of error codes that may be found.
if (!empty($e->detail->ApiFaultDetail->BatchErrors))
$errors = is_array($e->detail->ApiFaultDetail->BatchErrors->BatchError)
? $e->detail->ApiFaultDetail->BatchErrors->BatchError
: array('BatchError' => $e->detail->ApiFaultDetail->BatchErrors->BatchError);
foreach ($errors as $error)
printf("BatchError at Index: %d\n", $error->Index);
printf("Code: %d\nError Code: %s\nMessage: %s\n", $error->Code, $error->ErrorCode, $error->Message);
switch ($error->Code)
case 0:     // InternalError
break;
default:
print "Please see MSDN documentation for more details about the error code output above.\n";
break;
// If the OperationError array is not null, the following are examples of error codes that may be found.
if (!empty($e->detail->ApiFaultDetail->OperationErrors))
$errors = is_array($e->detail->ApiFaultDetail->OperationErrors->OperationError)
? $e->detail->ApiFaultDetail->OperationErrors->OperationError
: array('OperationError' => $e->detail->ApiFaultDetail->OperationErrors->OperationError);
foreach ($errors as $error)
print "OperationError\n";
printf("Code: %d\nError Code: %s\nMessage: %s\n", $error->Code, $error->ErrorCode, $error->Message);
switch ($error->Code)
case 0:     // InternalError
break;
case 106:   // UserIsNotAuthorized
break;
case 2100:  // ReportingServiceInvalidReportId
break;
default:
print "Please see MSDN documentation for more details about the error code output above.\n";
break;
catch (Exception $e)
    if ($e->getPrevious())
        ; // Ignore fault exceptions that we already caught.
    else
        print $e->getCode()." ".$e->getMessage()."\n\n";
        print $e->getTraceAsString()."\n\n";
// Request the report. Use the ID that the request returns to
// check for the completion of the report.
function UpdateKeywordsRequest($proxy, $UpdateKeywordsRequest)
    return $proxy->GetService()->UpdateKeywords($UpdateKeywordsRequest)->PartialErrors;
?>

Hello.
You'll need to set the Bid->Amount as shown in this AddKeywords example:
https://msdn.microsoft.com/en-US/library/bing-ads-keywords-php-code-example.aspx 
$keywords = array();
$keyword = new Keyword();
$keyword->Bid = new Bid();
$keyword->Bid->Amount = 0.47;
$keyword->Param2 = "10% Off";
$keyword->MatchType = MatchType::Phrase;
$keyword->Text = "Brand-A Gloves";
$keywords[] = $keyword;
If it still doesn't work for you please feel free to
escalate to support with the SOAP request and response i.e. place this code immediately after your call to UpdateKeywords:
print "\nLast SOAP request/response:\n";
print $proxy->GetWsdl() . "\n";
print $proxy->GetService()->__getLastRequest()."\n";
print $proxy->GetService()->__getLastResponse()."\n";
I hope this helps!

Similar Messages

  • PHP Podcast API (for playback)

    I don't know if this is the right place for this question, but hopefully someone can answer it or point me in the right direction.
    I'm creating a web based player for a site, that will go throug a list of Podcast RSS Feeds.
    I know that if I were on my iPhone, the Podcast owner's stats would show that there was another download or play from my region.
    Is there something like a code or API  for the web (that I can use in my code) that will show in the owner's stats?

    Hello.
    You'll need to set the Bid->Amount as shown in this AddKeywords example:
    https://msdn.microsoft.com/en-US/library/bing-ads-keywords-php-code-example.aspx 
    $keywords = array();
    $keyword = new Keyword();
    $keyword->Bid = new Bid();
    $keyword->Bid->Amount = 0.47;
    $keyword->Param2 = "10% Off";
    $keyword->MatchType = MatchType::Phrase;
    $keyword->Text = "Brand-A Gloves";
    $keywords[] = $keyword;
    If it still doesn't work for you please feel free to
    escalate to support with the SOAP request and response i.e. place this code immediately after your call to UpdateKeywords:
    print "\nLast SOAP request/response:\n";
    print $proxy->GetWsdl() . "\n";
    print $proxy->GetService()->__getLastRequest()."\n";
    print $proxy->GetService()->__getLastResponse()."\n";
    I hope this helps!

  • Invalid API Key Error in Ecosign API

    I'm using the sample soap code(Developer kit) given by echosign api for testping, but it always show invalid api key error while i'm executing from terminal. Please give the solution as soon as possible, and i'm not able to get solution from google also.
    This is my API Key:
    Client Secret:
    6IaJHev8N48JbsZcM4Itggzt0pAHF0iS
    I tried with this comment in terminal:
    php demo.php https://secure.echosign.com/services/EchoSignDocumentService20?wsdl 6IaJHev8N48JbsZcM4Itggzt0pAHF0iS test
    This is demo.php file:
    <?php
    // get input
    array_shift($_SERVER['argv']);
    $Url = array_shift($_SERVER['argv']);
    $ApiKey = array_shift($_SERVER['argv']);
    $cmd = array_shift($_SERVER['argv']);
    $params = $_SERVER['argv'];
    if (!$cmd) print_usage();
    $S = new SOAPClient($Url);
    call_user_func("cmd_$cmd", $params);
    function cmd_test() {
        global $Url, $ApiKey, $S;
        print "Testing basic connectivity...\n";
        $r = $S->testPing(array('apiKey' => $ApiKey));
        print "Message from server: {$r->documentKey->message}\n";
        print "Testing file transfer...\n";
        $text = file_get_contents('../test.pdf');
        $r = $S->testEchoFile(array('apiKey' => $ApiKey, 'file' => base64_encode($text)))->outFile;
        if (base64_decode($r) === $text) {
            print "Woohoo! Everything seems to work.\n";
        else {
            die("ERROR: Some kind of problem with file transfer, it seems.\n");
    function cmd_send() {
        global $Url, $ApiKey, $S;
        list($filename, $recipient) = reset(func_get_args());
        $r = $S->sendDocument(array(
            'apiKey' => $ApiKey,
            'documentCreationInfo' => array(
                    'fileInfos' => array(
                        'FileInfo' => array(
                            'file'     => file_get_contents($filename),
                            'fileName' => $filename,
                    'message' => "This is neat.",
                    'name'    => "Test from SOAP-Lite: $filename",
                    'signatureFlow' => "SENDER_SIGNATURE_NOT_REQUIRED",
                    'signatureType' => "ESIGN",
                    'tos' => array( $recipient ),
        print "Document key is: {$r->documentKeys->DocumentKey->documentKey}\n";
    function cmd_info() {
        global $Url, $ApiKey, $S;
        list($doc_key) = reset(func_get_args());
        $r = $S->getDocumentInfo(array('apiKey' => $ApiKey, 'documentKey' => $doc_key))->documentInfo;
        print "Document is in status: {$r->status}\n";
        print "Document History: ";
        foreach($r->events->DocumentHistoryEvent as $_) {
            $keytext =
              $_->documentVersionKey
              ? " (versionKey: {$_->documentVersionKey})"
            print "{$_->description} on {$_->date}$keytext\n";
        print "Latest versionKey: {$r->latestDocumentKey}\n";
    function cmd_latest() {
        global $Url, $ApiKey, $S;
        list ($doc_key, $filename) = reset(func_get_args());
        $r = $S->getLatestDocument(array('apiKey' => $ApiKey, 'documentKey' => $doc_key))->pdf;
        //$r = base64_decode($r);
        file_put_contents($filename, $r);
    function print_usage() {
        die(<<<__USAGE__
    Usage:
      demo.php <URL> <API key> <function> [parameters]
    where the function is one of:
      test
      send <filename> <recipient_email>
      info <documentKey>
      latest <documentKey> <filename>
    test will run basic tests to make sure you can communicate with the web service
    send will create a new agreement in the EchoSign system, and returns a documentKey
    info returns the current status and all the history events for a given documentKey
    latest saves the latest version of the document as a PDF with the given filename
    __USAGE__
    --------------------------  End of file ---------------------------------------------------------------

    This is my API Key:
    Client Secret:
    6IaJHev8N48JbsZcM4Itggzt0pAHF0iS
    Client secret is not the same as an api key!
    in addition to the above, integration key or access codes can be had by going to personal preferences>access code and clicking the plus sign.

  • PHP and Oracle Workflow

    Hi everyone,
    Is it possible to use PHP and Oracle Workflow together? I means use PHP to generate user-interface and PHP-OCI8 API to call WFEngine PL/SQL code?

    All of the public documented Workflow Engine PL/SQL APIs and Java APIs enable customers to build their own screens based on workflow, such as building your own specialized worklist.
    Hi everyone,
    Is it possible to use PHP and Oracle Workflow together? I means use PHP to generate user-interface and PHP-OCI8 API to call WFEngine PL/SQL code?

  • DW9, PHP, and Oracle

    We've just installed DWCS3 and now our Oracle (Oracle Thin
    Client) database connections are no longer available with DWCS3. We
    have just learned that DWCS3 will not work with Phakt and that PHP
    now only supports MySQL. Dropping Phakt without any PHP-to-Oracle
    alternatives is a serious threat to our continued use of Adobe web
    products because TCO / ROI concerns, facing the fact we may have to
    rebuild our websites.
    We need to continue to use PHP to access our Oracle dBs. Does
    anyone have any recomendations for a work-around to this sorry
    behavior?

    All of the public documented Workflow Engine PL/SQL APIs and Java APIs enable customers to build their own screens based on workflow, such as building your own specialized worklist.
    Hi everyone,
    Is it possible to use PHP and Oracle Workflow together? I means use PHP to generate user-interface and PHP-OCI8 API to call WFEngine PL/SQL code?

  • PHP Library for Kuler

    I find it amazing that the only PHP libraries for Kuler are being sold (doesn't that violate the terms?). So I created one over the weekend, you can find it in Github: https://github.com/gabrielsomoza/KulerPHP
    Of course anybody is welcome to contribute to make it better! We need to add Unit Tests and a little more documentation (event though the code has been quite thoroughly commented). Anybody willing to help?
    You can see the library at work on my homepage: http://gabrielsomoza.com (loads the effect colors from Kuler).
    Cheers!
    Gabriel Somoza.

    Also wrote a small article to introduce the library: PHP Kuler API Library.

  • Writing a php code to send email link

    Hi guys-
    I have a php Fulfillment API that downloads a book. I want to write a code that sends an email (like one of those email address verification emails) with a random link that will run the code. I want to place the link in Paypal so that when a transaction is completed they get sent the email with the download link- Only problem- I just learned the term php- still don’t quite know what it means. Any thought of where I can start? I’m using cs6. Thanks in advance.

    Here is what php is:
    It is interpreted code that runs on your server.
    According to the folks that are responsible for it, "PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML."
    It is open source and free, so if your hosting provider does not support it, you need to change your hosting provider.
    But you have a fulfillment API (Application Programming Interface). You need to use sample code supplied with that API to create a script that will do what you want. Since you do not know php, you're looking at probably a month's worth of work in learning enough to be able to write in this scripting language, testing it and applying the sample code you have been supplied to do what you want.
    Go to http://us.php.net/  to learn how to use php or, better still, sign up for a course.
    Or hire a professional to build what you want.
    -Mark

  • Latest Flash Player does not recognise an Old Script

    Hi, here's hoping this is in the right Forum. Some time ago I added an excellent Flash widget to a page -  recently I went back to the widget code to add it to a new page, unfortunately now, the element displays in the page as an error message - "You have an old version of Flash Player. Please visit adobe.com and get a new one". I tried in vain to reinstall the latest version of Flash to no avail - it was already installed, as I suspected. Then I remembered that the code was old, so I began to backgrade my Flashplayer - bingo! The excellent 'Facehugger' (form the Alien series of films) appeared. Only now I had an old version of Flash on my pc and nothing else would load. hhhmmmm dilemma, every other Flash I tried to load would require the latest Flash player EXCEPT my beloved Facehugger. So, my question is, are there any Flash code experts out there who would be able to take a look at the widget code and make it compatible with Flash 10+?
    heres the code:- <script type="text/javascript">
    AC_FL_RunContent( 'height','528','width','385','allowscriptaccess','never','allownetwor king','internal','src','http://www.avp-r.com/EN/widgets/facehugger.php?api=html','wmode','tran sparent','menu','false','quality','best','scale','noscale','movie','ht tp://www.avp-r.com/EN/widgets/facehugger.php?api=html' ); //end AC code
    </script><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" height="528" width="385">
    <param name="allowScriptAccess" value="never" />
    <param name="allowNetworking" value="internal" />
    <param name="movie" value="http://www.avp-r.com/EN/widgets/facehugger.swf.php?api=html" />
    <param name="wmode" value="transparent" />
    <param name="menu" value="false" />
    <param name="quality" value="best" />
    <param name="scale" value="noscale" />
    <embed type="application/x-shockwave-flash" allowScriptAccess="never" allowNetworking="internal" src="http://www.avp-r.com/EN/widgets/facehugger.swf.php?api=html" height="528" width="385" wmode="transparent" menu="false" quality="best" scale="noscale" />
    </object></noscript>

    i think the problem is with your html code rather than the swf itself.
    there is now a better way of embedding swfs called SWFObject. Theres a tutorial here: http://www.adobe.com/devnet/flashplayer/articles/swfobject.html and an online code generator here: http://www.bobbyvandersluis.com/swfobject/generator/index.html

  • Code to automatically sms send and receive by sql server

    I want you to tell me the necessary code in vb and sql to automatically send and receive sms from sql database.i know only that i have to create one table for it in the database.please anybody who knows post the code for me.

    Hi mintesnot h.benti,
    According to your description, since the issue regards VB code, as other post, you need to post the related problem on Visual Basic forum at
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vbgeneral. It is appropriate and more experts will assist you.
    In addition, if you want to use a SQL Server database, and it makes SMS sending and receiving possible through database tables in your VB.NET application. You may need to use the 3<sup>rd</sup> tools, such as OZEKI NG SMS Gateway or others.
    http://www.ozekisms.com/php-sms-api-asp-sms-A/index.php?owpn=586&sms_gateway=sms_VB.NET_database_sms_example_guide
    Note: Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality,
    safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and please be cautious and ensure you have completely understood the risk before retrieving any software from the
    Internet.
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • HTTP 403 with WL6.1

    Hello,
    I am trying to set up access to my application. There is a firewall before you get to the application. It works for some time and then gives the HTTP 403 Forbidden error all of the time. Where could I be wrong in configuring the weblogic server ? Please help.
    Thanks,
    Gopal.

    Hi Tina,
    I have not tried this directly.  To date, I have always pulled tweets and other social chatter from social media aggregators like DataSift or Collective Intellect.  That said, based on my brief sleuthing, it seems you might try the 1.0 API with this URL format too.
    php - Twitter API returns error 215, Bad Authentication Data - Stack Overflow
    Thanks,
    Dan
    http://branchbird.com

  • Kuler now only 50% stable

    It would seem that Kuler has had it's share of sever problems
    lately. 1 out of 2 time I get a sever communication error that
    requests that I refresh the page. On top of that today I upgraded
    to the new flash player beta to find that this is now happening
    more then 90% of the time with a new problem of comments not
    showing after I post them. I realize that Kuler it's self is still
    beta so don't take this as a complaint but an update from the
    enduser point of view. On the same note all the mash ups I'v made
    lately works fine via the rest API. That leave me to think this is
    an isolated problem with the flash front end.
    Do you guys use a sever time out? if so maybe try to allow
    for more of a delay before that time out.

    Two minutes ago, I did a request (
    http://kuler.adobe.com/kuler/API/rss/get.cfm?listtype=recent)
    and got the right namespace in the xml file. The last time I did
    (see posting above), I got both (randomly). Perhaps a load balancer
    problem?
    But I don't know if the problem still exists. My workaround
    is the following one: I read the namespace of the sent file, write
    it into a variable and use this variable for parsing the feed. So
    it doesn't matter which namespace it is :)
    To answer your question: Before, I didn't get a error
    message. Sometimes, I just couldn't parse the feed, because the
    namespace wasn't
    http://kuler.adobe.com/kuler/API/rss/.
    By the way, here is the result: SWX (
    http://swxformat.org/) + Kuler
    http://www.video-flash.de/wp-content/uploads/2007/09/swxkuler/swxkulerdemonstration.html
    http://www.video-flash.de/index.php/kuler-api-fur-swx/
    (German)

  • How i can deal with oracle file by using php api

    how I can deal with oracle file by using php api ?

    What has this to do with Reflections and Reference Objects?

  • How can I use the latest Berkeley DB with SQL API in PHP app?

    Hi,
    I'm a PHP developer and I already use Berkeley DB in my applications using the [DBA Functions|http://www.php.net/manual/en/ref.dba.php] . I'm very interested in the latest Berkeley DB release. How can I write a PHP program that uses the SQL API of the latest Berkeley DB release?

    Hi Kurt,
    I'm not a PHP expert (far from it), but the simplest way to get started with the Berkeley DB SQL interface is to run Berkeley DB's <tt>configure</tt> script with the <tt>--enable-sql_compat</tt> flag.  This will create a library called <tt>libsqlite3.so</tt> that you can use as a drop-in replacement for SQLite at the API level.  Database files still need to be converted with a SQLite <tt>.dump</tt> followed by a <tt>.read</tt> with the <tt>dbsql</tt> tool.
    This should then allow the existing PHP driver and application code to switch over to Berkeley DB without any code changes by setting <tt>LD_LIBRARY_PATH</tt> to find the Berkeley DB version of <tt>libsqlite3.so</tt> ahead of SQLite. Note that any other code that relies on SQLite will also run against Berkeley DB with this configuration, which can cause problems if the system libraries use SQLite (for example, on Mac OS X). For that reason, a better long term solution would be for the PHP SQLite driver to have a mode where it loads <tt>libdbsql.so</tt> rather than <tt>sqlite3.so</tt>.
    I hope this helps, please let us know how you go because I'm sure lots of other PHP developers will be interested in the answer.
    Regards,
    Michael Cahill, Oracle Berkeley DB.

  • Ineed on add-on for php api files

    to view and open php api files

    I'm not familiar with API as a type of file. Can you give an example URL?

  • "Hook" to call RAS API's from PHP application

    Is there a way to call the RAS API's from a PHP application to generate a Crystal Report PDF file?  Examples would be helpful.
    Thanks!

    Do you need to use RAS?  I you have Crystal Reports Server or BusinessObjects Enterprise, then you can use URL reporting (i.e., create a URL to the report on InfoView).
    Sincerely,
    Ted Ueda

Maybe you are looking for

  • Can I run my iPad to a projector wirelessly with no internet?

    Before I start, you need to know that I don't know what things like "WAN" and "LAN" mean, this seems to be the cause of my misunderstanding so far.  If you could help me out in common English words, that would be fantastic! I'm a music teacher, I tea

  • HELP! All of my style disapeared- How can I recover it?

    So I have nearly finished my webpage when Dreamweaver just shut down. I reopened Dreamweaver to find that all of my pages are the same except for my homepage. My homepage still contains the text and my spry menu but has completely lost all of the sty

  • Print front panel does strange things

    Hi everyone, I am having some difficulty in printing the front panel of a vi. It seems to print the panel as it appears when the vi starts, and not as how it appears at the end of the vi's execution. This is a problem because new data is loaded into

  • Burning DVD Plug-in?

    When I open iDVD 6 it says that that i don't have the plug-in to burn a DVD. What plug-in do I need? Where can I get it?

  • [help]checking code

    can anyone point out what is wrong with the code below? this code is used to calculate a person's weight on earth and on other planets. how to use return statement?? import java.io.*; import cs1.*; public class Planets { double weight; double newweig