Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Module: Complex Product API

Method:
  • product_downloadable_link.list (SOAP V1)
  • catalogProductDownloadableLinkList (SOAP V2)

Allows you to retrieve a list of links of a downloadable product.

Arguments:

TypeNameDescription
stringsessionIdSession ID
stringproductIdProduct ID or SKU
stringstoreStore view ID or code (optional)
stringidentifierTypeDefines whether the product ID or SKU is passed in the request

Return:

TypeNameDescription
arrayresultArray of catalogProductDownloadableLinkListEntity

The catalogProductDownloadableLinkListEntity content is as follows:

TypeNameDescription
arraylinksArray of catalogProductDownloadableLinkEntity
arraysamplesArray of catalogProductDownloadableLinkSampleEntity

The catalogProductDownloadableLinkEntity content is as follows:

TypeNameDescription
stringlink_idLink ID
stringtitleLink title
stringpriceDownloadable link price value
intnumber_of_downloadsMaximum number of possible downloads
intis_unlimitedDefines whether the number of downloads is unlimited
intis_shareableDefines whether the link is shareable
stringlink_urlLink URL address
stringlink_typeType of the link data source. Can have one of the following values: “file” or “url”
stringsample_fileSample file name
stringsample_urlSample URL
stringsample_typeType of sample data source. Can have one of the following values: “file” or “url”
intsort_orderLink sort order
arrayfile_saveArray of catalogProductDownloadableLinkFileInfoEntity
arraysample_file_saveArray of catalogProductDownloadableLinkFileInfoEntity

The catalogProductDownloadableLinkSampleEntity content is as follows:

TypeNameDescription
stringsample_idSample ID
stringproduct_idProduct ID
stringsample_fileSample file name
stringsample_urlSample URL
stringsample_typeSample type. Can have one of the following values: “file” or “url”
stringsort_orderSort order
stringdefault_titleDefault title
stringstore_titleStore title
stringtitleSample title

The catalogProductDownloadableLinkFileInfoEntity content is as follows:

TypeNameDescription
stringfileFile
stringnameFile name
intsizeFile size
stringstatusStatus

Faults:
No Faults

Examples

Request Example SOAP V1
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');

$downloadableProductId = '5';

$resultList = $proxy->call(
    $sessionId,
    'product_downloadable_link.list',
    array($downloadableProductId)
);
Request Example SOAP V2
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy->login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

$result = $proxy->catalogProductDownloadableLinkList($sessionId, '5', null, 'sku');
var_dump($result);
Request Example SOAP V2 (WS-I Compliance Mode)
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

$sessionId = $proxy->login((object)array('username' => 'apiUser', 'apiKey' => 'apiKey'));

$result = $proxy->catalogProductDownloadableLinkList((object)array('sessionId' => $sessionId->result, 'productId' => '5'));

var_dump($result->result);
Response Example SOAP V1
array
  'links' =>
    array
      0 =>
        array
          'link_id' => string '1' (length=1)
          'title' => string 'link 1' (length=11)
          'price' => string '30.0000' (length=7)
          'number_of_downloads' => string '0' (length=1)
          'is_shareable' => string '1' (length=1)
          'link_url' => null
          'link_type' => string 'file' (length=4)
          'sample_file' => string '/s/o/software.jpg' (length=17)
          'sample_url' => null
          'sample_type' => string 'file' (length=4)
          'sort_order' => string '1' (length=1)
          'file_save' =>
            array
              ...
          'sample_file_save' =>
            array
              ...
          'is_unlimited' => int 1
  'samples' =>
    array
      0 =>
        array
          'sample_id' => string '1' (length=1)
          'product_id' => string '5' (length=1)
          'sample_url' => null
          'sample_file' => string '/s/o/software.jpg' (length=17)
          'sample_type' => string 'file' (length=4)
          'sort_order' => string '2' (length=1)
          'default_title' => string 'Sample 1' (length=8)
          'store_title' => string 'Sample 1' (length=8)
          'title' => string 'Sample 1' (length=8)