downloadFile

Downloads a file (typically a report) from eBay.

Using downloadFile with the Bulk Data Exchange API

If you are using Large Merchant Services, the most common uses of this call are to download responses to large-volume requests and to download reports.

After you have uploaded a data file that includes requests (such as multiple AddFixedPriceItem requests), you need to use the BDX getStatus call to determine when a response file is ready to download. After the BDX upload processing is complete, you call downloadFile to retrieve the response.

To get a report, you begin by using the Bulk Data Exchange API's startDownloadJob call, and then use startDownloadJob to start the report processing.

The Bulk Data Exchange API assigns a jobId for your report and you need to use the BDX getStatus call to determine when the report is ready to download. After the BDX download processing is complete, your application can call downloadFile to download the report.

Using downloadFile for Custom Item Specifics

You can also use downloadFile to download recommendations for custom Item Specifics. This is a very large data set that can't be retrieved through a more traditional synchronous call.

You do not use the Bulk Data Exchange API at all for this use case. (You also do not use uploadFile.) Instead, you call GetCategorySpecifics in the Trading API to obtain the necessary file and task reference IDs, and then pass them in the downloadFile call to retrieve the recommendations file. See GetCategorySpecifics for details.



Back to top

downloadFile Input

The box below lists all fields that could be included in the call request. To learn more about an individual field or its type, click its name in the box (or scroll down to find it in the table below the box).

See also Samples.

<?xml version="1.0" encoding="utf-8"?>
<downloadFileRequest xmlns="http://www.ebay.com/marketplace/services">
  <fileReferenceId> string </fileReferenceId>
  <taskReferenceId> string </taskReferenceId>
</downloadFileRequest>
Argument Type Occurrence Meaning
fileReferenceId string Required A unique Id assigned to a file. For example, the Bulk Data Exchange API assigns this ID to a file when startDownloadJob is called and then it creates the file.
lt;br> Pass the fileReferenceId into a File Transfer service downloadFile call. The File Transfer API uses this identifier to keep track of the files that are downloaded.
taskReferenceId string Required This is ID is determimed by a service (or API) that interacts with the File Transfer API.

For instance, the Bulk Data Exchange API uses a job ID as a primary identifier, so, if you're using the Bulk Data Exchange API, enter the job ID as the taskReferenceId.



Back to top

downloadFile Output

The box below lists all fields that might be returned in the response. To learn more about an individual field or its type, click its name in the box (or scroll down to find it in the table below the box).

See also Samples.

<?xml version="1.0" encoding="utf-8"?>
<downloadFileResponse xmlns="http://www.ebay.com/marketplace/services">
  <!-- Standard Output Fields -->
  <ack> AckValue </ack>
  <errorMessage> ErrorMessage
    <error> ErrorData
      <category> ErrorCategory </category>
      <domain> string </domain>
      <errorId> long </errorId>
      <exceptionId> token </exceptionId>
      <message> string </message>
      <parameter name="string"> ErrorParameter (string) </parameter>
      <!-- ... more parameter nodes here ... -->
      <severity> ErrorSeverity </severity>
      <subdomain> string </subdomain>
    </error>
    <!-- ... more error nodes here ... -->
  </errorMessage>
  <timestamp> dateTime </timestamp>
  <version> string </version>
  <!-- Call-specific Output Fields -->
  <fileAttachment> FileAttachment
    <Data> base64Binary </Data>
    <Size> long </Size>
  </fileAttachment>
</downloadFileResponse>
Return Value Type Occurrence Meaning
Standard Output Fields   [Jump to call-specific fields]
ack AckValue Always Indicates the success or failure of transferring data to eBay's servers.

Applicable values:

•   Failure

(out) The request that triggered the error was not processed successfully. When a serious application-level error occurs, the error is returned instead of the business data.

•   PartialFailure

(out) The request that triggered the error was processed successfully but there is some error in the application or data.

•   Success

(out) The request was processed successfully, but something occurred that may affect your application or the user.

•   Warning

(out) The request that triggered the error was processed successfully but with some warnings.


errorMessage ErrorMessage Conditionally Information for an error or warning that occurred when eBay processed the request.
errorMessage.error ErrorData Conditionally,
repeatable: [0..*]
Details about a single error.
errorMessage.error.category ErrorCategory Conditionally There are three categories of errors: request errors, application errors, and system errors.

Applicable values:

•   Application

(out) An error occurred due to a problem with the request, such as missing or invalid fields. The problem must be corrected before the request can be made again. If the problem is due to something in the application (such as a missing required field), the application must be changed. Once the problem in the application or data is resolved, resend the corrected request to eBay.

•   Request

(out) An error occurred due to a problem with the request, such as invalid or missing data. The problem must be corrected before the request can be made again. If the problem is a result of end-user data, the application must alert the end-user to the problem and provide the means for the end-user to correct the data. Once the problem in the data is resolved, resend the request to eBay with the corrected data.

•   System

(out) Indicates that an error has occurred on the eBay system side, such as a database or server outage. An application can retry the request a reasonable number of times (eBay recommends twice). If the error persists, contact Developer Technical Support. Once the problem has been resolved, the request may be resent in its original form.


errorMessage.error.domain string Conditionally Name of the domain upon which the error occurred.
Domains include:
Marketplace
A business or validation error occurred for the Merchandising Service.
SOA
An exception occurred in the Service Oriented Architecture (SOA) framework.
errorMessage.error.errorId long Conditionally A unique code that identifies the particular error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms.
errorMessage.error.exceptionId token Conditionally Unique identifier for an exception associated with an error.
errorMessage.error.message string Conditionally A detailed description of the condition that resulted in the error.
errorMessage.error.parameter ErrorParameter (string) Conditionally,
repeatable: [0..*]
Some warning and error messages return one or more variables that contain contextual information about the error. This is often the field or value that triggered the error.
errorMessage.error.parameter
  [ attribute name ]
string Conditionally The name of the parameter in the list of parameter types returned within the error type.
errorMessage.error.severity ErrorSeverity Conditionally Indicates whether the error caused the request to fail (Error) or not (Warning).

If the request fails and the source of the problem is within the application (such as a missing required element), please change the application before you retry the request. If the problem is due to end-user input data, please alert the end-user to the problem and provide the means for them to correct the data. Once the problem in the application or data is resolved, you can attempt to re- send the request to eBay.

If the source of the problem is on eBay's side, you can retry the request as-is a reasonable number of times (eBay recommends twice). If the error persists, contact Developer Technical Support. Once the problem has been resolved, the request may be resent in its original form.

When a warning occurs, the error is returned in addition to the business data. In this case, you do not need to retry the request (as the original request was successful). However, depending on the cause or nature of the warning, you might need to contact either the end user or eBay to effect a long term solution to the problem to prevent it from reoccurring in the future.

Applicable values:

•   Error

(out) The request that triggered the error was not processed successfully. When a serious application-level error occurs, the error is returned instead of the business data.

•   Warning

(out) The request was processed successfully, but something occurred that may affect your application or the user. For example, eBay may have changed a value the user sent in. In this case, eBay returns a normal, successful response and also returns the warning.


errorMessage.error.subdomain string Conditionally Name of the subdomain upon which the error occurred.
Subdomains include:
Merchandising
The error is specific to the Merchandising service.
MarketplaceCommon
The error is common to all Marketplace services.
timestamp dateTime Always The date and time that the response was sent.
version string Always The version of the schema that your WSDL is based on.
Call-specific Output Fields
fileAttachment FileAttachment Always A zipped report file that is encoded in Base64 Binary format and included in the response according to the SOAP MTOM standard.
fileAttachment.Data base64Binary Always The data in the attached file. When this is returned in downloadFile and you are working with Large Merchant Services or GetCategorySpecifics, the attached file is a .zip file.
fileAttachment.Size long Always This is the size of the file you are attaching (that contains the Merchant Data API or Trading API requests that you want to upload) or of the file you are receiving as a download.

The default maximum size for a data file attachment in the File Transfer uploadJob call is 15MB, If you have a large call limit and you want to send more calls than would fit in a 15MB file, you will have to divide your data into multiple uploads.



Back to top

downloadFile Samples

New to making API calls? Please see Making an API Call.

Note: Some item IDs, user IDs, or other data in these samples might no longer be active on eBay. If necessary, you can substitute current eBay data in your requests.

Sample: Basic Call

Transfers data files from the eBay site with the Large Merchant Services solution. This sample represents a request to download a compressed data file using the File Transfer Service.

Description

User magicalbookseller wants to get a SoldReport for her Harry Potter books and music CD listngs on the eBay US site. Before she can download a report file, she has to make a Bulk Data Exchange startDownloadJob call and specify that she wants to download a SoldReport. After magicalbookseller uses the Bulk Data Exchange getJobStatus call to verify that the report (as a data file) is ready to download, she can use this File Transfer service call to get the report.

A downloadFile request needs a task ID and a file reference ID.

As a result of this call, magicalbookseller has a report or response about her listings on eBay with the details provided in the data file she downloaded.

Input

The fields in the following downloadFile request are included to represent a report for magicalbookseller's listings.

XML format (HTTP POST). Also available are the .txt version of this XML and the SOAP equivalent.

<?xml version="1.0" encoding="utf-8"?>
<downloadFileRequest xmlns:="http://www.ebay.com/marketplace/services">
  <taskReferenceId>50000002226</taskReferenceId>
  <fileReferenceId>50000003106</fileReferenceId>
</downloadFileRequest>>

Output

The output sample shows the raw format of the download file response to illustrate how the data file is attached in the multi-part message. The root part (or body) contains the call response with the standard output fields, such as ack, timestamp, and version. The final part contains the compressed file attachment in base64binary format. The file attachment stream is referenced by content ID (i.e., cid) in the Data field of the body. When the ack value is "Success," the binary data of the file attachment must be saved as a zip file. The SoldReport XML file must, in turn, be extracted from the zip file.

XML format. Also available are the .txt version of this XML and the SOAP equivalent.

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-EBAY-SOA-MESSAGE-PROTOCOL: NONE
X-EBAY-SOA-SERVICE-NAME: {http://www.ebay.com/marketplace/services}FileTransferService
X-EBAY-SOA-RESPONSE-DATA-FORMAT: XML
X-EBAY-SOA-SERVICE-VERSION: 1.0.0
X-EBAY-SOA-OPERATION-NAME: downloadFile
X-EBAY-SOA-REQUEST-GUID: 11dad48a-4270-a08a-de40-17e0ffffe7d7
Content-Type: multipart/related;boundary=
MIMEBoundaryurn_uuid_9ADF5C1A6F530C078712269728985463257;type="application/xop+xml";start=
"<0.urn:uuid:9ADF5C1A6F530C078712269728985463258>";start-info="text/xml"
Transfer-Encoding: chunked
Date: Tue, 18 Nov 2008 01:48:18 GMT

2aa
--MIMEBoundaryurn_uuid_9ADF5C1A6F530C078712269728985463257
Content-Type: application/xop+xml; charset=utf-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.urn:uuid:9ADF5C1A6F530C078712269728985463258>

<?xml version='1.0' encoding='UTF-8'?><downloadFileResponse
xmlns:sct="http://www.ebay.com/soaframework/common/types"
xmlns="http://www.ebay.com/marketplace/services"><ack>Success</ack><version>
1.0.0</version><timestamp>2008-11-18T01:48:18.546Z</timestamp><fileAttachment><Size>
0</Size><Data><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include"
href="cid:urn:uuid:D8D75F18A8343F8FC61226972901992" /></Data></fileAttachment>
</downloadFileResponse>
3c

--MIMEBoundaryurn_uuid_9ADF5C1A6F530C078712269728985463257
f44

Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID: <urn:uuid:D8D75F18A8343F8FC61226972901992>

PKÙÔG²x7œÿwšÌÐÛ?žû›ÚE0uRßÔçÒ©]SŒçÔU mSkèSkèS«·SÏ[M=o•Z¿N­_§þ:Kýu–úë,õÌ]
ê[ÈS'%¦¾Ù'uTcjGêÁÏÔ$IjKjKjKê¸ÎÔóV©ôÔzê?¯Ôdij²4uF\6݈ôÌ]jIjÂ<µ‹#õÕB©¯J=
ö˜:¨0».C-åiÙèl¢Ijå(õÜ_jÆ>5cŸ:(/µ—&õØ]jÉ µd?ú^›Ô9?©‡þRý¥NJLí©Kí©Kí©K-¦–K‡cÃÒáØ0W¹



Back to top

downloadFile Change History
Version Description
1.0.0
2009-04-01
  • (modified) downloadFile is no longer only used with Large Merchant Services and the Bulk Data Exchange API. You can also use it to download a large GetCategorySpecifics response.
1.0.0
2008-11-29
  • (added) New call



Back to top

User-Contributed Notes
   
 
 
 

This document was generated with a customized version of the apireferencedocs tool.

© 2008–2010 eBay, Inc. All rights reserved. This documentation and the API may only be used in accordance with the eBay Developers Program and API License Agreement.