Support Forum [ All Topics | New Topic ]

Thread: Using code generated by "Generate Code" button

I captured the code generated by the selection form, but when I click on it to download the file, I get a 401 Unauthorized error.  I am guessing that this is because the code does not include the username and password?  If so, how to include same?

Al;so, I noticed that the code uses http:// but based on other posts I read here, should it be https://?


>> add a comment
Allan Kirson for Orli Diamonds
01/23/2014 04:53


3 Replies:

Hi,

We are talking about our Download Listings Service (DLS) here.

First of all, you are correct, the link itself won't work without the username and password in the POST request to that link. There are two options, and this will also answer your http / https question.

Option A: do one request, whcih includeds the URL as you get it from above as the target URL, but change it to HTTPS. So the URL would for example be: https://technet.rapaport.com/HTTP/RapLink/download.aspx?ShapeIDs=1&SortBy=Owner&White=1&Fancy=1&Programmatically=yes&Version=1.0
 You would then pass the other parameters in your post data., which will look something like this:

formData["Username"] = "myUser";
formData["Password"] = "myPassword";
webRequest.Method = "POST";
webRequest.ContentType = "application/x-www-form-urlencoded";

Option B: do two requests, one over https to authenticate to https://technet.rapaport.com/HTTP/Authenticate.aspx retrieve the userticket from there, and connect this to the generate code URL, and then you can request over HTTP.

You can use this as a good example:

http://technet.rapaport.com/Info/RapLink/SampleCode/Full_Example.aspx

You can also try this manually, by going to this URL - https://technet.rapaport.com/HTTP/Authenticate.aspx  - type in your username and password, click logon, and then copy & paste your ticket - that long string of characters - after the url + &ticket=

so for example:

http://technet.rapaport.com/HTTP/RapLink/download.aspx?ShapeIDs=1&SortBy=Owner&White=1&Fancy=1&Programmatically=yes&Version=1.0&ticket=BC12123230F34045F02F2356166C95C2E96E9434CF44.........8F90F90C

Hope this helps

Regards,

Leo




>> add a comment
Leo
1/26/2014 12:33:00 AM
Dear Team,

I am working on the code which was given in the below link.
http://technet.rapaport.com/Info/RapLink/SampleCode/Full_Example.aspx

and using the link : 
http://technet.rapaport.com/HTTP/RapLink/download.aspx?ShapeIDs=1&Programmatically=yes

but it is not providing result properly.


Please do the needful.

>> add a comment
Amit Chavan
9/22/2014 9:14:00 AM
it seems that you didn't attached the ticket

>> add a comment
Ephraim
9/22/2014 9:39:00 AM