Contributions
Re: Where to put API key in RESTful request?
richie You are indeed correct that the syntax for a verbose cURL request involves a "-v". I ran the verbose cURL request and, while the output was very detailed (including, among other details, the Base64 encoding of the "API key"), it still offered no conclusive clues about what type of authentication the server was looking for in a SoapUI request. In fact, the verbose output seemed to confirm that the type of authorization was "Basic", but this was misleading because each time I tried a SoapUI request with Basic authorization, it failed. I even tried the Base64 encoding, but without the second factor (i.e., the password), Basic would never work. After some fiddling though, I discovered that api.easypost.com was actually looking for an OAuth 2 token. I entered the API key exactly as EasyPost gave it to me (no encoding) and made no other changes to SoapUI's default authorization settings...and it worked! It's frustrating that EasyPost failed to put anything about OAuth 2 in their documentation (and they refused to discuss this when I emailed them), but at least it's working now. And I've learned a bit more about moving between cURL and SoapUI. Thanks!1.3KViews0likes0CommentsWhere to put API key in RESTful request?
I am trying to use the easypost.com API (for reference, here: https://www.easypost.com/docs/api). One of the required request elements is an API key. I have the API key and it is working when I make a cURL request (see below), but I can't figure out how to enter it when making the corresponding request in SoapUI. Does it go in a header and, if so, how would I know what the Name should be? Or is this something I set in the Authorization tab? Or somewhere else? Basically this question amounts to, "How do I convert the cURL request below into a request I can make from SoapUI?" curl -X POST https://api.easypost.com/v2/addresses \ -u <YOUR_TEST/PRODUCTION_API_KEY>: \ -d "verify[]=delivery" \ -d "address[street1]=417 Montgomery Street" \ -d "address[street2]=5" \ -d "address[city]=SF" \ -d "address[state]=CA" \ -d "address[zip]=94104" \ -d "address[country]=US" \ -d "address[company]=EasyPost" \ -d "address[phone]=415-123-4567"1.4KViews0likes2Comments