How to add a POST request in an existing collection? - postman

I am trying to add POST request to an existing collection, Here by default only get request available. How can i change that?

You could either
Open a new tab (cntrl + T for Win, Ubuntu), select the new blank tab, choose POST request from the drop to the left of the url. Once you enter all details click on the down arrow next to save (right of the URL). Click on save as and name your request, add an optional description and then select the collection you wish to add it to.
We have different postman versions so I am unable to see the Add Request option in my drop down, but I recon you could click that and follow above steps.

Related

How can I add multiple images in Postman with POST method

I want to add multiple images in the Postman for the POST API call.
You can go to Following steps:
Select body section in the request section
Select form-data
Add your key and hover on that key cell you will find the choice box with 2 choices(Text and File)
Select file in that choice box
Now you can find Select Files button in the Value cell (For select multiple file you can use ctrl+click)
You can see this image for a clear idea

Why does Postman change saved API requests

I'm using Postman to test API and like its GUI and ease of use. But some things it does are completely incomprehensible to me. Example: I save an API request to a collection. Sometime later I try to recall it and it has changed. Why?
Scenario: testing against ElasticSearch API
GET _cat/indices.
Save to collection ElasticSearch.
Send other ES API requests.
Delete an index: DELETE /index0
Recall saved _cat/indices
Instead DELETE /index0 is recalled. Why?
It is possible that you turned off the "Always ask when closing unsaved tabs" option in Settings -> General. When this is off, it does not require you to hit Save, it will automatically save when the tab is closed.
Postman has tabs along the top, where each tab holds the data for a given request. When you edit the contents of a tab, you are editing the saved request as well. If you manually hit "save", the changes to the request are saved.
The way to avoid this would be to make sure that any time you are writing a new request and not intending to make it a change to an existing one, you do it in a new request tab (click the + button on the tab line), which you can then optionally save as a new named request.
To Turn Off Autosave, do the following:
Go to Settings -> General
Turn On Always ask when closing unsaved tabs.
Open a saved request, then change something in the request.
Close the request tab. Postman will ask if you want to save the changes. There will be a checkbox "to always discard unsaved changes". Tick the checkbox.
Click on "Don't Save".

Postman collections: how do I save my requests into a collection?

I'd like to create a collection of requests in order to save them and share with collaborators.
I havent find any button, menu action to add new requests (or current request ) to the newly created folder Collection?
not so much intuitive...
I was able to do this by hitting the X to close a request. This popped up a warning asking if I want to save my request. I clicked on Save Changes, which then allowed me to save my request to a collection.
in the latest version of postman press ctrl+s -> and choose a collection to save into.
First create collection then create new request you will get option to save request "Save in existing collection" select your collection name and save it

Show only certain payload field in stackdriver logging webview

We use Stackdriver as our logging agent for a Docker environment that we have.
Payload comes in form:
structPayload: {
container: {…}
data: "[2016-11-16 08:15:49] INFO Domain xxx apiKey validation passed."
instance: {…}
}
The web view gives me when looking at the logs:
{"container":{"id":"xxx","created":"2016-11-15T05:35:05.533105502Z",...
Is there a way to make the web view give me the container data listed, since clicking it open on all of the events is just stupid and time consuming.. Sometimes randomly in has been giving me just the data, but I can't figure it out how to do it..
You can configure the logs viewer to display custom fields, as documented here. However, it is not possible to remove the default fields from being displayed -- that said, custom-configured fields that are not defaults appear earlier in the list, so they should be easier to keep visible.
There are 2 methods to add a custom field:
The first is to click on the "View Options" and Select "Modify Custom Fields"
You can then enter the name of the custom field you want to put on the main line, where it will be highlighted, for example, principalEmail. This can be a comma-separated list, and you can follow the JSON hierarchy with dots, if needed.
The other method is to open a single entry, click on the field you would like to add, and select "Add field to summary line", like so:
Either way, the field is added to the URL, as the customFacets parameter, so that you can share or bookmark the URL to the log viewer.

Get HITID on Mturk

I would like to know how can I Get the HITID of my surveys of Mturk ? It's easy to see on TurkPrime, but on MTurk I can't seem to find it.
Thank you !
The HITId is not easily accessible on the Requester website, which uses "batches" instead of HITs to organize the interface. If you visit the "Manage HITs Individually" page, you will find a listing of HITs. The HITIds for each are not visible, but you can find them by either:
Doing an "inspect element" action from your browser's context menu on the iframe displaying the HIT. The HITId will be in the URL of the iframe's src attribute, or
Click on "Delete this HIT" (or just copy the link to that page). The HITId is part of the URL.
Another option, which requires that you created the HIT in the requester website (not on TurkPrime or anywhere else) and requires downloading a file, is to click the "Download CSV" for the appropriate batch. The HITId will be listed in the CSV.
Navigate to Manage HIT and select the HIT you want to get her HITID. Press the results button and download the results CSV file. The first two columns in the CSV are HITId and HITTypeId.
You can get it by going here: https://requester.mturk.com/mturk/manageHITs
Then hover over "Delete this HIT":
Right click and copy the URL. Analyze the URL and you'll see the HIT ID as a parameter.
The format will be something like:
https://requester.mturk.com/mturk/manageHIT?viewableEditPane=manageHIT_delete&HITId=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
It's the value after &HITId=
This past week, Mechanical Turk made finding the HITTypeId easier when you use the Requester UI. Here's how it works:
Visit http://requester.mturk.com and login
Click the Create tab
Click "New Batch with Existing Project"
Click on the "Project Name"
A pop up lightbox will appear. It used to show only "Layout ID" and "Layout Parameters" but it now also shows "HITTypeId"
To get the HITIds, the best approach is to download the CSV results which include the HIT IDs for your batch.
Hope that helps!