Dashboard > ChannelAdvisor Developer Network > ... > Marketplace Ad Service Examples > AdMarketplaceAd Examples
Log In   View a printable version of the current page.
AdMarketplaceAd Examples
Added by Andy Berryman, last edited by Andy Berryman on May 11, 2007  (view change)
Labels: 
(None)






Raw Xml 

NOTE: Nodes in RED are "optional" and can be omitted if not needed.  

Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://api.channeladvisor.com/webservices/">
   <soapenv:Header>
      <web:APICredentials>
         <web:DeveloperKey>XXX</web:DeveloperKey>
         <web:Password>XXX</web:Password>
      </web:APICredentials>
   </soapenv:Header>
   <soapenv:Body>
      <web:AddMarketplaceAd>
         <web:accountID>XXX</web:accountID>
         <web:adProperties>
            <web:ID></web:ID>
            <web:Sku>SKU0001</web:Sku>
            <web:Title></web:Title>
            <web:PostingTemplate>My Favorite Posting Template</web:PostingTemplate>
            <web:AdTemplate>My Favorite Ad Template</web:AdTemplate>
            <web:Schedule></web:Schedule>
            <web:FlagStyle>NoFlag</web:FlagStyle>
            <web:FlagDescription></web:FlagDescription>
            <web:PrimaryCategory></web:PrimaryCategory>
            <web:SecondaryCategory></web:SecondaryCategory>
            <web:PrimaryStoreCategory></web:PrimaryStoreCategory>
            <web:SecondaryStoreCategory></web:SecondaryStoreCategory>
         </web:adProperties>
      </web:AddMarketplaceAd>
   </soapenv:Body>
</soapenv:Envelope>

Response

<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>
      <AddMarketplaceAdResponse xmlns="http://api.channeladvisor.com/webservices/">
         <AddMarketplaceAdResult>
            <Status>Success</Status>
            <MessageCode>0</MessageCode>
            <ResultData>1234567</ResultData>
         </AddMarketplaceAdResult>
      </AddMarketplaceAdResponse>
   </soap:Body>
</soap:Envelope>


C#

Request

// Create your credentials
CA_API_MarketplaceAdSvc.APICredentials cred = new CA_API_MarketplaceAdSvc.APICredentials();
cred.DeveloperKey = "dev-key-guid";
cred.Password = "pwd";

// Create the Web Service and attach the credentials
CA_API_MarketplaceAdSvc.MarketplaceAdService svc = new CA_API_MarketplaceAdSvc.MarketplaceAdService();
svc.APICredentialsValue = cred;

// Create the MarketplaceAd object
CA_API_MarketplaceAdSvc.MarketplaceAd ad = new CA_API_MarketplaceAdSvc.MarketplaceAd();
ad.Sku = "SKU0001";
ad.PostingTemplate = "My Favorite Posting Template";
ad.AdTemplate = "My Favorite Ad Template";
ad.FlagStyle = CA_API_MarketplaceAdSvc.FlagType.NoFlag;

// Now just call the method
CA_API_MarketplaceAdSvc.APIResultOfInt32 result = svc.AddMarketplaceAd("acct-guid", ad);

Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.1 Build:#806 May 06, 2007) - Bug/feature request - Contact Administrators