API connection

 

Once you have setup your account you are ready to do your first authenticated connection.

In this section, we propose you to proceed manually step by step to your first connection. Then, you will be able to adapt your system to call the Cdiscount Marketplace API

 

Get a valid Token

To be accepted by our system, your call need to embed a security key, named Token. This token is generated with you API login and password.

An easy way to generate a valid token is to use the Postman Chrome App:

  1. Specify the URL of the token generator : https://sts.cdiscount.com/users/httpIssue.svc/?realm=https://wsvc.cdiscount.com/MarketplaceAPIService.svc
  2. Set up you login/Password
  3. Send your request
  4. Get your valid token

 

postman

 

 

 

 

Proceed your first call

In this section, we will explain the steps to send manually an API request in order to get your Seller’s information.

To do so, we propose you to use the SoapUI OpenSource software :

  1. The first step is to install and open SoapUI.
  2. Create a new SOAP project by specifying the Cdiscount Marketplace WSDL : https://wsvc.cdiscount.com/MarketplaceAPIService.svc?wsdl
    soap-new-project
  3. Once the form validated, SoapUI will create a new project including a call for each method of the API
  4. Search and open the request generated by SoapUI, associated to GetSellerInformation method. It is possible to note that all the fields available for the call of this method are listed by SoapUI
    soap-generated-request-for-the-getsellerinformation-method
  5. To proceed our first request, the best way is to refer samples provided for each method. These samples include the main useful fields of each method, and will be easier to adapt in our context.
    Please replace the XML content of this request by the content below, in which you need to replace “${#Project#token}” by the valid Token obtained previously :

<s:Envelope xmlns:s=”http://schemas.xmlsoap.org/soap/envelope/”>

<s:Body>

<GetSellerInformation xmlns=”http://www.cdiscount.com”>

<headerMessage xmlns:a=”http://schemas.datacontract.org/2004/07/Cdiscount.Framework.Core.Communication.Messages” xmlns:i=”http://www.w3.org/2001/XMLSchema-instance”>

<a:Context>

<a:CatalogID>1</a:CatalogID>

<a:CustomerPoolID>1</a:CustomerPoolID>

<a:SiteID>100</a:SiteID>

</a:Context>

<a:Localization>

<a:Country>Fr</a:Country>

<a:Currency>Eur</a:Currency>

<a:DecimalPosition>2</a:DecimalPosition>

<a:Language>Fr</a:Language>

</a:Localization>

<a:Security>

<a:DomainRightsList i:nil=”true” />

<a:IssuerID i:nil=”true” />

<a:SessionID i:nil=”true” />

<a:SubjectLocality i:nil=”true” />

<a:TokenId>${#Project#token}</a:TokenId>

<a:UserName i:nil=”true” />

</a:Security>

<a:Version>1.0</a:Version>

</headerMessage>

</GetSellerInformation>

</s:Body>

</s:Envelope>

6. Finally, submit the request and check the content of the Xml resturned

soapui-submit-getsellerinfo