SOAP Request/Response for the adCenter API V6 GetNotifications operation
Below you will find raw a successful SOAP request generated by PHP and NuSOAP/0.7.3 and the subsequent successful SOAP request that was returned by adCenter API V6 for accessing the GetNotifications operation of the NotificationManagement service. There are a couple important things to note here
when the SOAP request is being built out. Unlike generating SOAP requests in the CampaignService, for example, your do not have to append the word ‘Request’ at the end of the operation name when creating the body of the SOAP message. In the case of the GetNotifications operation, the body of the message should look similar to:
<SOAP-ENV:Body>
<GetNotifications xmlns=”http://adcenter.microsoft.com/syncapis”>
…
</GetNotifications>
</SOAP-ENV:Body>
The other point to mention is that you only pass one parameter to the GetNotifications operation. This parameter is APIFlags. MSN notes that this current parameter is ‘Reserved for future use’ and needs to be ‘Set to 0.’
Without any further or do, here is a successfully built SOAP request for accessing the GetNotifications operation of the NotificationManagement service of the adCenter API V6:
POST /Api/Advertiser/v6/NotificationManagement/NotificationManagement.asmx HTTP/1.0
Host: adcenterapi.microsoft.com
User-Agent: NuSOAP/0.7.3 (1.114)
Content-Type: text/xml; charset=utf-8
SOAPAction: “http://adcenter.microsoft.com/syncapis/GetNotifications”
Content-Length: 688
<?xml version=”1.0″ encoding=”utf-8″?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:SOAP-ENC=”http://schemas.xmlsoap.org/soap/encoding/” xmlns:ns5901=”http://tempuri.org”>
<SOAP-ENV:Header>
<ApiUserAuthHeader xmlns=”http://adcenter.microsoft.com/syncapis”>
<UserName>XXXXXXXX</UserName>
<Password>XXXXXXXX</Password>
<UserAccessKey>XXXXXXXX</UserAccessKey>
</ApiUserAuthHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<GetNotifications xmlns=”http://adcenter.microsoft.com/syncapis”>
<APIFlags>0</APIFlags>
</GetNotifications>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Below you will find the subsequent response sent back using the above SOAP request. (There were no notifications available at this time, so the returned GetNotificationsResult array was empty.)
HTTP/1.1 200 OK
Date: Thu, 11 Jun 2009 12:32:40 GMT
Server: Microsoft-IIS/6.0
P3P:CP=”BUS CUR CONo FIN IVDo ONL OUR PHY SAMo TELo”
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 372
<?xml version=”1.0″ encoding=”utf-8″?>
<soap:Envelope xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>
<soap:Body>
<GetNotificationsResponse xmlns=”http://adcenter.microsoft.com/syncapis”>
<GetNotificationsResult />
</GetNotificationsResponse>
</soap:Body>
</soap:Envelope>