Loading ...
Sorry, an error occurred while loading the content.

Getting basic report in PHP

Expand Messages
  • Hari
    Hi, I need your help in setting up reports management using API. I am using PHP to develop this. Below is the code I am using for basic report generation. When
    Message 1 of 1 , Jul 3 10:28 AM
    • 0 Attachment
      Hi,

      I need your help in setting up reports management using API. I am
      using PHP to develop this. Below is the code I am using for basic
      report generation. When I executed this, I am seeing $RESULT value as
      null. As per the documentation, it should display report id. Is there
      anything wrong/missing in this code ? Please advice.

      <?php
      require_once('lib/nusoap.php');

      //Create client and set action parameters
      $SOAPClient = new nusoapclient("https://
      sandbox.marketing.ews.yahooapis.com/services/V2/
      BasicReportService?wsdl");
      $SOAPACTION = "https://sandbox.marketing.ews.yahooapis.com/services/
      V2/BasicReportService";

      //Set Body for AC account
      $SOAPMESSAGE = '<?xml version="1.0" encoding="UTF-8"?>
      <soap:Envelope xmlns:namesp1="http://marketing.ews.yahooapis.com/V2"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema""
      soap:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/
      "><soap:Header><wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/
      ws/2002/04/secext"><wsse:UsernameToken
      soapenc:arrayType="xsd:string[2]"
      xsi:type="soapenc:Array"><wsse:Username xsi:type="xsd:string">xxxxxx</
      wsse:Username><wsse:Password xsi:type="xsd:string">xxxxx</
      wsse:Password></wsse:UsernameToken>
      </wsse:Security><license xmlns="http://marketing.ews.yahooapis.com/
      V2" xsi:type="xsd:string">xxxxxxxx</license><masterAccountID
      xmlns="http://marketing.ews.yahooapis.com/V2"
      xsi:type="xsd:string">xxxxxx</masterAccountID></soap:Header>
      <soap:Body><addReportRequestForAccountID xmlns="http://
      marketing.ews.yahooapis.com/V2"><accountID
      xsi:type="xsd:string">2028786225</accountID><reportRequest>
      <endDate xsi:type="xsd:dateTime">2007-05-01T00:00:00-05:00</
      endDate><reportName xsi:type="xsd:string">account report</
      reportName><reportType
      xsi:type="tns:BasicReportType">CampaignSummary</reportType><endDate
      xsi:type="xsd:dateTime">2007-05-01T00:00:00-05:00</endDate></
      reportRequest> </addReportRequestForAccountID></soap:Body></
      soap:Envelope>';

      $RESULT = $SOAPClient->send($SOAPMESSAGE, $SOAPACTION);
      echo $RESULT;
      ?>

      Please advice.

      Thanks,
      Hari
    Your message has been successfully submitted and would be delivered to recipients shortly.