API Newby
|
|
I am on a linux system, trying to test out the API with curl, I am getting a redirect to the login page. I’ve got the token in there, so what am I forgetting? Did something change? |
|
|
I just checked it, it works for me. Did you do the xml for the request correctly? Did you use the correct address? Remember that the URL for the page may be http://somethin.backpackit.com/pages/1 but it is http://somethin.backpackit.com/ws/page/1 to download it using the api. It’s hard to help when we don’t know how you did the command. Repost exactly how you called curl, but take out the token and the first part of the URL to your backpack site. |
|
|
Here is the Command… ?curl -H ‘Content-Type: application/xml’ -d ‘<request><token>nnnntokennnn</token></request>’ \https://[firstpart].backpackit.com/ws/page/1 Here is the response… ?<html><body>You are being redirected.</body></html>? |
|
|
It works on my MacBook running leopard. The curl is not working on a Redhat 2.1AS. Running curl ver 7.8, so I am assuming that I need a more updated ver. Anyone have any recommendations. I know 7.16 works on my MacBook. But 7.18 is out now, So i will Install newer ver and let y’all know. |
|
|
Take the s out of https in your URL. Is your account set to use SSL? I just tried changing my working URL of http://somethin.backpackit.com/ws/page/1 to https://somethin.backpackit.com/ws/page/1 and I got a redirect. |
|
|
I am running on SSL, but I have taken my account off SSL and tried it as an http, but same problem. I have also upgraded to the newest curl 7.18.1 and same problem. when I do a -v (verbose) it appears that my ‘Content-Type: application/xml’ is not being accepted. it is being defaulted to ‘Content-Type: application/x-www-form-urlencoded’. It works from my Mac, so I am thinking now that it is a RedHat Linux config issue. |
|
|
That is strange. Are you absolutely sure you’re using the exact same call to curl on the mac and the rh machine? That is the only thing I can think of. I’ve been running my tests from Fedora, so I have my doubts that it is configuration issues on RH’s part. Try taking the working command on the Mac, copy it to a file. Easiest way on the command line is to wrap the command like so Take that file over to your rh machine, cd to the directory it’s in, and run What happens? Also, the page will redirect if the API key is incorrect. |
|
|
Well now it’s working… I am using the same exact command that I was using before… ??? Thanks for the Help Core.B -Geoff |
