Bing Webmaster API IWebmasterApi.SubmitUrl Error 400

Answered Bing Webmaster API IWebmasterApi.SubmitUrl Error 400

  • Tuesday, November 06, 2012 1:52 AM
     
      Has Code

    Be "Body text cannot contain images or links until we are able to verify your account."

    I can't add links in this question,so i remove the URLS.

    API  Library IWebmasterApi.SubmitUrl

    PHP Code

    [

    $url="/* remove URL */ api.svc/pox/SubmitUrl?apikey=my apikey";
    
    $xml_data='<SubmitUrl xmlns="/* remove URL */">
    <siteUrl>my site</siteUrl>
    <url>my url</url>
    </SubmitUrl>';
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_POST, 1);
                            curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/xml"));
                            curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data);
                            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
                            $xmlhtml=curl_exec($ch);
                            curl_close($ch);

    ]

    last month before,it work,but this month,it was 400 error

    this is the header

    "

    HTTP/1.1 400 Bad Request
    Cache-Control: no-cache
    Pragma: no-cache
    Content-Type: application/xml; charset=utf-8
    Content-Encoding: gzip
    Expires: -1
    Content-Length: 99
    Date: Sat, 03 Nov 2012 12:13:03 GMT
    Connection: close

    "

    why?

    Thanks

All Replies

  • Thursday, November 08, 2012 2:01 AM
    Moderator
     
     

    Hi, it seems that you are in the wrong forum. I suggest you submit it into the following forum:

    Webmaster forums - General Questions & Feedback

    If the question is not answer in the new forum, please let me know.

    Best Regards

  • Thursday, November 08, 2012 9:04 AM
     
     

    I had submit this forum few days ago,but no answer

  • Thursday, November 08, 2012 9:29 AM
     
     
    Thanks   Johnson
  • Thursday, November 08, 2012 9:40 AM
    Moderator
     
     

    Hi, I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

    Best Regards

  • Saturday, November 10, 2012 7:24 AM
     
     
    Still no one answered my question
  • Wednesday, November 14, 2012 1:34 PM
     
     
    This question i had post more than 12 days,but no one answer
  • Thursday, November 15, 2012 4:14 AM
    Moderator
     
     Answered Has Code

    Hi, please make sure that the xmlns attribute of the SubmitUrl is set to http://schemas.datacontract.org/2004/07/Microsoft.Bing.Webmaster.Api

    $xml_data='<SubmitUrl xmlns=”http://schemas.datacontract.org/2004/07/Microsoft.Bing.Webmaster.Api">
             <siteUrl>my site</siteUrl>
             <url>my url</url>
             </SubmitUrl>';

    For more details, please refer to

    Breaking Change in Webmaster API (SOAP/POX Protocol) 

    Best Regards

  • Thursday, November 15, 2012 9:27 AM
     
     

    Thanks  Johnson,

    It's OK now,thanks again