Media type: Multipart/form-data and value as query type
Refer to the attached file for more detail
Please refer to multipart field: https://github.com/intuit/karate#multipart-field
And if you have query params, use param. But it is hard to understand from just a screenshot.
If you are still stuck, please provide a cURL command (you can export from Postman, browser etc.) and we can figure this out.
Related
While making access token request from Headers, I'm getting below error.
Error-
{
"error": "unsupported_grant_type",
"error_description": "grant type not supported"
}
Am I doing something wrong or missing something?
Please help!
Attached screenshot-
enter image description here
You used wrong tab.
Headers should be just 1-2:
Content-Type:application/x-www-form-urlencoded
Accept:application/json
Your actual params are supposed to go to the body. Which you can type in manually or in postman's bulk edit syntax it'll be
grant_type:password
client_id:3MVG97sr...
client_secret:CE6C05...
username:example#example.com
password:Hunter2
If you're stuck - edit your question with the postman's "code" output (HTTP or cURL are probably best for wider audience to help you), just edit out the sensitive bits.
P.S. Check https://github.com/forcedotcom/postman-salesforce-apis out. It's bit more work to set the environment variables up, create an account with Postman to fork the repository... But in the long run saves reading documentation and typing all calls by hand.
I'm trying to use Postman and replicate the following POST request from this link:
https://www.msc.com/en/track-a-shipment?params=dHJhY2tpbmdOdW1iZXI9YXNkYSZ0cmFja2luZ01vZGU9MA%3D%3D
The payload necessary to get a response from this API is something like:
{trackingNumber: "asda", trackingMode: "0"}
With the following payload, I expect to receive the following response:
{IsSuccess: false, Data: "Container not found"}
Here, you can see my Postman request:
All I seem to get from this is an empty string, which is not the same result I would see If I checked my Network tab from developer tools.
I'm wondering what do I need to do in order to get the same result. Change headers? Change payload format? What else could it be?
The request works for me, what's the difference that depends. But the easiest way to find the correct answer is to import the request as is from the Developer Tools.
Find the request on the request list and click Copy as cURL (bash):
Then on Postman click Import (top left main window) and select the Raw Text option:
The request will be on the current window and you can just click Send:
So you can now diff your request with this one. There's a lot of headers so I would remove them one by one and see where the request fails. Without having the API at hand, this is really a trial-and-error exercise.
Hope this helps.
I was checking on Postman and newman and how to automate the api testing. I have checked on assertions and the report generations that show results of assertion failures and pass status. We can check the status code by writing a an assertion. But is there a way where in we can capture the request and response directly for an api and generate a report that shows (say) 3 apis were tested and the requests agve 200 for first call 201 fro second an d then 400 for third without writing any assertions. The overall result will show request url and corresponding response code for the api.
This will be helpful in a way when we run a collection and then can see a html report stating the response code corresponding to the request url.
Thank you all in advance for your patience reading and extremely helpful insight to the problem. Thank You.
this already exists in Postman, through its command line interface Newman.
Have a look here and here as well.
You'll be able to set options, depending on the kind of reports you want.
Personaly I can use newman in TFS and get JUnit style reports that fit for my continuous integration purpose. You can generate also HTML reports.
Check the different options.
To handle response data, have a look here :
This takes place in the Tests tab of the Postman request, though
You can obtain informations about HTTP code (responseCode.code), description (responseCode.detail), etc.
You can also parse the JSON body to get more information
var jsonData = JSON.parse(responseBody);
You can output this data in the console
I have a Google spreadsheet published to the web, and I'm trying to read and write list-based feeds. I have not authenticated.
I can read data using a GET request just fine.
curl https://spreadsheets.google.com/feeds/list/1WngGKZHauwBqRxgC5E6DFMiJ-J8BDsadfwerF4RE0M/1/public/full
However, all my post requests to write data come back with an error
curl --data '' https://spreadsheets.google.com/feeds/list/1WngGKZHauwBqRxgC5E6DFMiJ-J8BDlN3mMaBfF4RE0M/1/public/full
curl --data '<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gsx="http://schemas.google.com/spreadsheets/2006/extended"><gsx:id>1</gsx:id><gsx:status>1</gsx:status><gsx:user_email>1</gsx:user_email><gsx:url domain>1</gsx:url domain><gsx:highlighted_text>1</gsx:highlighted_text><gsx:complete_text comments>1</gsx:complete_text comments><gsx:created_date>1</gsx:created_date><gsx:updated_date>1</gsx:updated_date><gsx:created_by>1</gsx:created_by><gsx:updated_by>1</gsx:updated_by></entry>' https://spreadsheets.google.com/feeds/list/1WngGKZHauwBqRxgC5E6DFMiJ-J8BDlN3mMaBfF4RE0M/1/public/full
The error I'm getting is: "Sorry, the file you have requested does not exist. Please check the address and try again."
Do POST request require authentication? I can't find anything in the docs that say so.
Any help would be appreciated. Thanks.
Two things:
I think you need to use the private feed (.../private/full), not the public one (.../public/full) like you're using now. More on the private-versus-public distinction is in the API docs.
You will need an Authorization header. (That process gets pretty complicated, but there's a lot of good info here. Remember to select the appropriate scopes.)
Both are mentioned in the example about adding a list row in the Sheets API docs. (I'd link directly, but I don't have enough rep to add more than two links. Just search for "Adding a list row".)
Hi i need to use https://api.facebook.com/method/fql.query?query= to get user profile picture and other user information on PHP.
i know that https://api.facebook.com/method/fql.query?query= return some json or XML.
but i don't know how to get json to use.
thank you
PHP has built in json support. See json_decode manual.
And if you are wondering how to run FQL from PHP - it was just asked.
You can add a parameter format=json to get result in json format. So the url will be
https://api.facebook.com/method/fql.query?query=fql&format=json&access_token=t
By default format is xml.
The REST API has been deprecated. To make FQL queries you should use the Graph API. To do so, just issue an HTTP GET request to https://graph.facebook.com/fql?q= and provide your FQL statement as the value of the q parameter. For more info, check out the FQL documentation. You can use the Graph API Explorer to easily test FQL queries.