DOTNET Getting Started Example

From Wiki.zanox.com

Jump to: navigation, search

Web Services > Getting Started Tutorial > DOTNET Getting Started Example

Contents

[edit] REST and SOAP Authentification for .NET C#

REST and SOAP Authentification for Dot NET C-Sharp


[edit] SOAP: Getting Ad Media

Example of an unsignated API call to get some admedias. Requires Web Reference to SOAP Endpoint "http://api.zanox.com/wsdl/2008-05-21/"

PublisherService service = new PublisherService();
GetAdmedia parameters = new GetAdmedia();
parameters.applicationId = "applicationid";
parameters.programId = 49;
parameters.categoryId = 0;
parameters.type = 0;
parameters.page = 0;
parameters.items = 5;
GetAdmediaResponse response = service.GetAdmedia(parameters);

[edit] SOAP: Getting your Adspaces

Example of an API call with Signature to get your Adspaces. Requires Web Reference to SOAP Endpoint "http://api.zanox.com/wsdl/2008-05-21/"

DateTime now = DateTime.Now;
GetAdspaces getAdspaces = new GetAdspaces();
getAdspaces.applicationId = "applicationid"; ;
getAdspaces.signature = Signature.SoapSignature(now, "shared key", "publisherservice", "getadspaces");
getAdspaces.timestamp = Signature.GetZDateTime(now);
GetAdspacesResponse Adspaces = service.GetAdspaces(getAdspaces);

[edit] SOAP: Product Search

Example of an API call to search for product data. Requires Web Reference to SOAP Endpoint "http://api.zanox.com/wsdl/2008-05-21/"

SearchProducts parameters = new SearchProducts();
parameters.applicationId = applicationId;
parameters.query = "Harddrive";
// optional parameters
parameters.adspaceId = 0; 
parameters.region = "DE";
parameters.maxPrice = 100;   
parameters.maxPriceSpecified = true;
parameters.minPrice = 0;
parameters.minPriceSpecified = true;
// paging
parameters.page = 0;
parameters.items = 10;
SearchProductsResponse response = service.SearchProducts(parameters);


Personal tools