|
|
Programmatic Uploads and Downloads: A guide for beginners
Starting May 1—get up to 2,500 FREE listings* every month with an eBay Stores subscription
eBay has reduced the upfront cost to sell for Store sellers! With eBay’s new everyday rate plans, you get from up to 150 to 2,500 FREE listings* per month—no insertion fees, auction-style or fixed price—with an eBay Stores subscription. You pay a final value fee only when you sell! Plus, the final value fees for Stores have been streamlined to just 5 competitive category-based rates as low as 4%—and never more than 9%—regardless of how you sell.
Learn more about everything eBay Stores have to offer, then use the Fee Illustrator to find the best Store option for you! Watch this tutorial to learn how.
*Pay no insertion fees for your allotted free listings per calendar month. Optional fees, including advanced listing upgrades and supplemental service fees, still apply. Pay final value fees only when you sell. Motors Vehicles, Real Estate, Heavy Equipment, Concession Trailers & Carts, Imaging & Aesthetics Equipment and Commercial Printing Presses are excluded. 12 free pictures does not apply to Motors Vehicles listings. Terms are subject to change. Learn more.
|
|
Programmatic Uploads and Downloads: A guide for beginners
Jul 14, 2009 07:58 PM
|
Hi All, I've noticed that there seems to be quite a lack of information on how to get programmatic uploads and downloads working with File Exchange. I recently spent some time figuring this out, so I figured I'd share a few things in case other people someday need some basic instructions and examples of how to make it work. I decided that the easiest way to do programmatic uploads and downloads is by using the program cURL, which is a free, text based web browser, which you can just invoke from a command line. This is similar to how the Java uploader works that eBay provided, but it's a lot easier due to the fact that you don't have to compile it first. It also works for programmatic downloads as well, so it's win / win. If you're using Windows, you can download cURL here: http://curl.haxx.se/download/curl-7.19.5-win32-ssl-sspi.zip All you have to do is unzip this folder, and stick it somewhere, such as in c:curl or wherever else you'd like it. If you're running a Linux computer, you can probably apt-get curl and get a working version for your distribution. After cURL is installed, if you haven't already done so, you'll need to get a token to use. You can get a token by going here: http://pages.ebay.com/file_exchange/programmaticupload.html?id=1 Click the "security token" link on that page. Sign into your account, give File Exchange permission to access your account, and you'll see your token in a text box on the following screen. Save the token somewhere safe. Once you have cURL installed, and have a token, you're ready to go. Some things to be aware of are: 1: Whenever you submit your token, it needs to be URL encoded. You can easily do this with cURL. 2: The URLs shown on the above programmatic upload instructions link are 50% wrong. The upload URL is correct, however, the download URL is as follows: https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeProgrammaticDownload Lets start with doing an upload. You can execute the following command, and it will upload the file test.csv: curl -k -o results.txt -F "token=**put your token here**" -F "file=@test.csv" https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeUpload --Please note that the discussion board turns the URL here into "Link". That URL just goes at the end of the string-- Just to explain things, the -k makes it ignore the fact that it can't verify who issued the SSL certificate. The -F command submits the token as "form data", which is required for the programmatic upload. So for this upload, we're submitting 2 pieces of form data: token + file. When you submit "form data" with cURL, it automatically URL encodes it, so we don't have to worry about that for the upload. The -o option makes it so that it outputs the results into a file called results.txt. If you omit the -o feature, it will just write the results to the screen. When you execute that, it will upload test.csv, and will reply confirming that the upload was successful, and you'll be given a reference number. You can then use that reference number to programmatically download the result of that upload, once File Exchange has processed it. Here is what you would execute to download the upload results of a file you uploaded: curl -k -o uploadresult.csv --data-urlencode "token=**put your token here**" --data "jobId=334455667" https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeProgrammaticDownload This time we have to specifically tell cURL to URL encode the token, so we use the --data-urlencode command. You'll also notice that the second piece of data we're submitting is "jobId" *not* "refId". For downloading the upload results of something you uploaded, you must use "jobId". If you use "refId" your results download will fail. So the number for the jobId is the reference number that eBay replied back with to your upload you submitted with the first upload we submitted above. Last of all, if you want to download your order files that are generated, then you would execute cURL like this: curl -k -o orders.csv --data-urlencode "token=**put your token here**" --data "refId=5566778" https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeProgrammaticDownload This time you'll use "refId", and it will work for downloading any files that you would normally find in your File Exchange "Completed Downloads" area (like orders or paid and awaiting shipment files, etc). Hope people find this information useful. Good luck, and have fun!
|
|
|
|
(1 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Jul 15, 2009 03:49 PM
|
Thank you very very much. Works like a charm. Best Wishes, Hal
|
|
|
|
(2 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Jul 27, 2009 11:23 AM
|
I tried to use Your method to upload csv data to a Germany based ebay account. As result.txt I allways get this information:
Upload File Programmatically
An unknown problem interrupted the file transfer. Please try again. ipt:void(0);" >Close
My steps
I installed Curl
than installed Microsoft Silverlight
Curl seems to run. Token seems to be correct.Do You have any idea what might be the problem ?
Thank You
Gert
|
|
|
|
(3 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Jul 28, 2009 04:42 AM
|
I get the same error for a a particular account. The code I use works fine for all other accounts, but for one account that error is received in the response.
|
|
|
|
(4 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Jul 28, 2009 05:04 AM
|
I just tried it with another account, result: the same error.
|
|
|
|
(5 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Jul 28, 2009 07:45 AM
|
 If I run Your proposed command without th "-F" option, I get the error report: curl: (6) Could not resolve host: token... The reported wrong token is my token, but 50% of the originaL token is cut in the error report next failure: curl: (6) Could not resolve host: xxx.csv; Host not found xxx.csv is the file that should be uploaded Thank You
|
|
|
|
(6 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Jul 31, 2009 06:48 AM
|
Hi Try changing the api call to .de if it's not already. In a number of uk accounts .com works fine but for one account I had to change it to .co.uk.
|
|
|
|
(7 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Aug 5, 2009 08:27 AM
|
This application has failed to start. errors
|
|
|
|
(8 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Oct 2, 2009 09:11 AM
|
Hi, I've followed all of the instructions above with regards to downloading the results file but all I seem to get is a file containing the message 'The file server is currently unavailable. Please try again after some time.' I'm assuming there is a problem with the server but am puzzled because I can download the file if I go to the file exchange area on the eBay site. Is anyone else having a problem with this or am I doing something stupid. Thanks Mike
|
|
|
|
(9 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Oct 4, 2009 04:34 AM
|
Thank You for the answer. It seems to run now.
|
|
|
|
(10 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Oct 11, 2009 03:30 PM
|
Thank you so much for the guide, it is an awesome resource, easy to understand and implement. I am stuck on one item... Would you possibly know how to programmaticly request a sold report (with the option of 'since the last sold report was made') through File Exchange? Any help would be greatly appreciated. Is this done through API only or is there a way to do this like you posted for uploading inventory/downloading sold reports? thanks for any help..
|
|
|
|
(11 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Oct 20, 2009 02:31 AM
|
Hi Does anyone know how to download the results in .Net?
|
|
|
|
(12 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Sep 18, 2010 06:47 AM
|
Whilst implementing this myself (and still not there yet) I have found some issues related to the "An unknown problem interrupted the file transfer" error: 1) Ensure the filename you try to upload is all lowercase. we tried to upload the file "filename.CSV" and it kept on returning the error, changed to "filename.csv" and worked. 2) Ensure number of columns for each row matches the number of header columns (you can do this using a data input with delimiter in excel) 3) Ensure you don't mix your delimiters, I use tabs, my descriptions have commas and some speechmarks in. Make sure this is the same in the header row as each of the action rows. Hope this helps someone.
|
|
|
|
(13 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Nov 16, 2010 07:20 AM
|
Thank you for the tutorial using curl. I'm trying to figure out a way to automatically retrieve the scheduled downloads in the "Awaiting Shipment" folder on my Ebay. I know I can download the files by using the RefID, but that requires I login to eBay to find out what the RefID is, and logging in, is the step I'm trying to avoid. I'd like to be able to automatically retrieve the daily "Awaiting Shipment" files each morning (without knowing what the RefID is), so they are on my computer ready for me to use. Any ideas?
|
|
|
|
(14 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Jan 12, 2011 02:45 PM
|
Greetings... I have just tried your process on Ubuntu and find that is works "Mostly" I am receiving data into the 'resultsFile.txt' that says "File upload successful." However it also says "Your ref # is." And there is No reference number given. Also there is no new files showing up in my eBay "View Uploads Results" folder. Does anybody have any suggestions as to what I should look for to resolve this problem.... Thanks in advance Rick
|
|
|
|
(15 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Jan 22, 2011 12:56 AM
|
This guide is great, however, how do you programatically get the refid of the order files that are generated? Obviously you can visit http://k2b-bulk.ebay.co.uk/ws/eBayISAPI.dll?SMDownloadPickup to get the refid but this is not very automated with respect to reading this page in via curl to retrieve all available downloads. Many thanks Stu
|
|
|
|
(16 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Jan 25, 2011 06:39 AM
|
valutunes wrote: Greetings... I have just tried your process on Ubuntu and find that is works "Mostly" I am receiving data into the 'resultsFile.txt' that says "File upload successful." However it also says "Your ref # is." And there is No reference number given. Also there is no new files showing up in my eBay "View Uploads Results" folder. Does anybody have any suggestions as to what I should look for to resolve this problem.... Thanks in advance Rick  We are experiencing the same problems. Have to manually upload inventory files, which is not a good solution. Hopefully we can get an answer back.
|
|
|
|
(17 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Feb 20, 2012 02:18 AM
|
Great guide! Still works 3 years later!
|
|
|
|
(18 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Jun 7, 2012 12:25 PM
|
I am obviously totally missing something here because I can’t get the cURL.exe file to install anything. I have tried on my Windows 7 PC and XP PC but nothing happens only errors. Due to this I started searching the internet for help and I found the site that provides cURL I even tried a 64 bit version but just got an MSVCR100.DLL file missing error. The info found on cURL’s website is also clear as mud After many more hours of searching I THINK but I’m not sure that I may need some additional software like xampp server or something like that?
What I am trying to do is Import Sold and Dispatched items into an Excel Spreadsheet, process it with VBA then upload tracking info without having to upload/download the files within eBay file exchange.
Hope you guys can help
Thanks in advance
Cheers
|
|
|
|
(19 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Sep 5, 2012 05:29 AM
|
Hi,
Thank you for your tutorial. I have been trying to get my head around this ebay API for a couple of days now, but it seems really confusing.
At the moment I want to be able to download my order files from the file exchange section and I believe your tutorial may be the answer, however I am looking to create a web based app. Your tutorial installs curl? does that mean its desktop based? Hope to hear from you soon.
Kind regards,
Moe
|
|
|
|
(20 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Sep 26, 2012 02:05 AM
|
Hello,
whe have tried your guide and the download works fine for a ouple of days using curl 7.27.0 on a linux box.
Upload seems very tricky and doesn't work. Error is always "An unknown problem interrupted the file transfer. Please try again."
Send all Header with -H option, using --http1.0 (same as -0), no errors shown in file created with --trace-ascii option, but no success.
Changing the upload file from dos to unix, delete all data (only using the header), converting delimiter from "," to ";" and to tab, no success.
Output from --trace-ascii is
0000: POST /ws/eBayISAPI.dll?FileExchangeUpload HTTP/1.0 0034: Referer: https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchange 0074: Upload 007c: Connection: Keep-Alive 0094: User-Agent: APP1.0 00a8: Host: https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeUpl 00e8: oad 00ed: Content-Length: 1302 0103: Content-Type: multipart/form-data; boundary=-------------------- 0143: --------d18817692e9c 0159: => Send data, 1106 bytes (0x452) 0000: ------------------------------d18817692e9c 002c: Content-Disposition: form-data; name="token" 005a: 005c: AgAAAA**AQAAAA**aAAAAA**UQJFUA**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6wF ..... 039c: x2Fgj36V/p/CsIgJpWEQw042ib0H8pAw+XIv9Z6m 03c6: ------------------------------d18817692e9c 03f2: Content-Disposition: form-data; name="file"; filename="listings. 0432: csv" 0438: Content-Type: text/csv 0450: => Send data, 51 bytes (0x33) 0000: Status,5555555555555,6666666666666,1,UPS,8888888888888 => Send data, 145 bytes (0x91) 0000: 0002: ------------------------------d18817692e9c 002e: Content-Disposition: form-data; name="submit" 005d: 005f: OK 0063: ------------------------------d18817692e9c-- <= Recv header, 26 bytes (0x1a) 0000: HTTP/1.1 400 Bad Request <= Recv header, 27 bytes (0x1b) 0000: Server: Apache-Coyote/1.1 <= Recv header, 37 bytes (0x25) 0000: Date: Wed, 26 Sep 2012 08:57:40 GMT <= Recv header, 19 bytes (0x13) 0000: Connection: close <= Recv header, 2 bytes (0x2) 0000: == Info: SSLv3, TLS alert, Client hello (1): <= Recv SSL data, 2 bytes (0x2) 0000: .. <= Recv data, 0 bytes (0x0) == Info: Closing connection #0 == Info: SSLv3, TLS alert, Client hello (1): => Send SSL data, 2 bytes (0x2)
If there is any option that i may try out, please send some information.
Many Thanks!
|
|
|
|
(21 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Oct 12, 2012 12:23 AM
|
|
|
|
|
|
(22 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Oct 15, 2012 09:09 AM
|
Did you find the solution for: how programatically get the refid of the order files that are generated?
|
|
|
|
(23 of 23)
Re: Programmatic Uploads and Downloads: A guide for beginners
Mar 18, 2013 11:58 AM
|
I am also wondering if there is a programmatic way to get the refId. Did anyone find a solution to this problem?
|
|
|