cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

File Exchange programmic download token.

 

Recently, my token, for programmically uploading and downloading files to the FileExchange Center, expired.

 

I have tried to re-authorize that token, using the normal link that I have used in the past. It now redirects to the FileExchange subsciption page. Naturally, there is no option there to authorize a token.

 

Has this option been discontinued? I use the programmatic upload/download multiple times a day. It makes store and item maintenence much easier.

eBay is continually updating this site. Some advice given may have changed. Please reply to this thread, to let us know if this advice works for you. The links on the bottom of any eBay page can help you deal with most eBay issues. Contact eBay Customer Service on Facebook.com/eBay or Twitter.com/AskeBay
Message 1 of 8
latest reply
1 BEST ANSWER

Accepted Solutions

Re: File Exchange programmic download token.

Anonymous
Not applicable

Hey @dollybeauty

 

Sorry to hear you're seeing a redirect! I tried to recreate the issue but I didn't have the same result. Are you using this URL to generate the token?

 

https://signin.ebay.com/ws/eBayISAPI.dll?SignIn&runame=F-FILEEXL51P1EHH6L899Q9B969GE134DK-FileUpload

 

 

edit: removed invisible non-breaking space from link which was, in fact, breaking the link

View Best Answer in original post

Message 2 of 8
latest reply
7 REPLIES 7

Re: File Exchange programmic download token.

Anonymous
Not applicable

Hey @dollybeauty

 

Sorry to hear you're seeing a redirect! I tried to recreate the issue but I didn't have the same result. Are you using this URL to generate the token?

 

https://signin.ebay.com/ws/eBayISAPI.dll?SignIn&runame=F-FILEEXL51P1EHH6L899Q9B969GE134DK-FileUpload

 

 

edit: removed invisible non-breaking space from link which was, in fact, breaking the link

Message 2 of 8
latest reply

Re: File Exchange programmic download token.

No, the link I used was from some dated info that I obtained fromm the community archive (it work up until about 18-20 months ago).

 

Your link did not work for me either. It give me a Third Party Authorization error.

thirderror.PNG

 

eBay is continually updating this site. Some advice given may have changed. Please reply to this thread, to let us know if this advice works for you. The links on the bottom of any eBay page can help you deal with most eBay issues. Contact eBay Customer Service on Facebook.com/eBay or Twitter.com/AskeBay
Message 3 of 8
latest reply

Re: File Exchange programmic download token.

The old link I used - http://pages.ebay.com/file_exchange/programmaticupload.html?id=1

eBay is continually updating this site. Some advice given may have changed. Please reply to this thread, to let us know if this advice works for you. The links on the bottom of any eBay page can help you deal with most eBay issues. Contact eBay Customer Service on Facebook.com/eBay or Twitter.com/AskeBay
Message 4 of 8
latest reply

Re: File Exchange programmic download token.

Thank you, Brooke!! A whole page of thank you's could not express my glee at solving this issue.

 

Instead of using the old link I had, I went back to the (duh) AdvancedInstructions, and again followed those steps (double duh).

 

The link to generate a token was working, but I had not scrolled down far enough to see the token that was generated. All is good now. My scripts are working again!

 

Thank you again!

eBay is continually updating this site. Some advice given may have changed. Please reply to this thread, to let us know if this advice works for you. The links on the bottom of any eBay page can help you deal with most eBay issues. Contact eBay Customer Service on Facebook.com/eBay or Twitter.com/AskeBay
Message 5 of 8
latest reply

Re: File Exchange programmic download token.

Anonymous
Not applicable

Great! Glad to hear it's working for you now, @dollybeauty

 

 

 

For any future readers trying to refresh their token, it looks like the link I had posted above will show an error message when clicked. It might have something to do with the way the community boards handles links.   has been fixed.

 

 

You can copy and paste the URL into your browser for successful token generation, or

You can also find the instructions on page 67 of the File Exchange Advanced Instruction Guide here: 

http://pics.ebay.com/aw/pics/pdf/us/file_exchange/File_Exchange_Advanced_Instructions.pdf

 

 

edit: added additional information 

edit 2: link fixed, workaround no longer needed

Message 6 of 8
latest reply

Re: File Exchange programmic download token.

Having read a number of posts around the internet including this forum I resolved the problem of putting together php code to download programmatically a file.

 

I wanted to share this with anyone still searching for this solution.

 

<?php

/* © 2010 eBay Inc., All Rights Reserved */
/* Licensed under CDDL 1.0 - http://opensource.org/licenses/cddl1.php */

httpsDownload();

function httpsDownload(){

$endpoint = "https://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeProgrammaticDownload"; // For UK I fixed this by changing .com to .co.uk
//INSERT YOUR JOB ID HERE
$jobId = ; // recently referred to as refId when you place your mouse over a downloadable file in File Exchange.

//jobId should always be passed as a URL parameter
$url = $endpoint.'&jobId='.$jobId;

$headers = array(
'Connection: Keep-Alive',
'Content-Type: multipart/form-data'
);

$ch = curl_init();
$fp = fopen('test.csv', 'wb');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);

 $post = array(
"token" => 'yourtoken',);

curl_setopt($ch, CURLOPT_POSTFIELDS, $post);

$response = curl_exec($ch);

curl_close($ch);
fclose($fp);

}


?>

 

I was able to get my token from:

 

https://signin.ebay.com/ws/eBayISAPI.dll?SignIn&runame=F-FILEEXL51P1EHH6L899Q9B969GE134DK-FileUpload

 

After clicking 'Agree' when 'Grant application access: File Exchange' appears (you need to sign in with your appropriate eBay user'

 

I can assure you this is the solution I have fully working so I hope it helps someone out there in the eBay community.

 

Message 7 of 8
latest reply

Re: File Exchange programmic download token.

@preston-lacey

 

Sorry for the late reply. Here is a reprint from about 9 years ago. I have lost the original poster's name, but you may be able to find the post in the Archives, to verify this reprint.

 

The only difference between this and your post...You use Libcurl, this uses the command line (DOS) invocation of cURL. On the upload, using libcurl returns a cookie, using the command line version returns plain text. The RefID/JobID is contained in the returned plain text. Execute the cURL commands via the PHP exec function.

 

Substitute the info about authorizing a token mentioned in the previous posts. Otherwise, this info works as well today as it did nine years ago. I do the upload/download daily. Oh..the cURL version is of course, out of date, but the current version works just fine.

 

I have reformatted for readability.

 

Start reprint.
-------programmatic upload for beginners
Automatic Uploads and Downloads: A guide for beginners

 

07-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:

 

(use the link mentioned in previous post on this thread)

 

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 author is speaking of a previous post on the thread they replied to) 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!

 

End reprint.

 

 

 

 

eBay is continually updating this site. Some advice given may have changed. Please reply to this thread, to let us know if this advice works for you. The links on the bottom of any eBay page can help you deal with most eBay issues. Contact eBay Customer Service on Facebook.com/eBay or Twitter.com/AskeBay
Message 8 of 8
latest reply