The api exposes the endpoint /collections but i cannot seem to find anything else with regards to an item within a collection i.e. /collections/items/itemId
What I am seeing is that each existing item has its own id which makes me believe there’s a way to refer to it and perform an edit?
What I would like to do is to update one item at the time not the entire collection.
My request examples are quite heavy and I hit a bad request error when my entire request exceeds 20~mb.
I have read that you do not allow more than 1mb in the body and also that also that compressing the request body is not yet supported by postman.
What I want to understand is if there’s a way to perform a delta update on a collection?
Any endpoint in this collection needs the header Accept: application/vnd.postman.v2+json (already set in the collection). This will soon be removed and it will be part of the normal postman api docs.
Hey @danny-dainton, I focused so hard on the Postman API collection I have totally missed this one!!
What is the correct way to use it? I am afraid that the collection will grow a bit over time and I wont be able to get it and then determine the item ids Id like to update.
hey @danny-dainton I am trying to post a new request object to /collections/id/requests
Although I am having - method as post, the request created always appears as GET, am I wrong in using the Request object which is nested into Collection?
Where can I see more information on the expected request body for requests and responses endpoints?
Can you please attach the request body you are using?
In addition, if you can provide a bit of context on what are you trying to achieve that would be great:
Why are you doing this (what is your problem), what do you want to achieve
What is the process you are following
… that would be great, so I could understand the problem better.
By the way, if you pass the “method” field in the request body when doing a POST on the collections/{id}/requests endpoint, it sets the request method to the method passed in the field (POST, PUT…)
We will add more examples to the documentation.
Hey @aerospace-geoscient2 I am playing a guessing game as I do not know what the request body model for both /requests and /responses should look like. I think I have wrongly assumed that it could use the ones listed here:
I have build a Collection object and cut the response/request pieces and tried to use them in the
/collections/id/requests
/collections/id/responses?request=requestId
I did manage to figure out the request body for /requests which is ultimately a flat json with name ;url;method fields
however I struggle with the request body for /responses as I have found out that for instance response code isn’t a code field but an entire object called responseCode.
Hence I requested some help in order to understand and use correctly the request body for both endpoints. Let me know if anything is unclear.
Providing some more answers to:
“Why are you doing this (what is your problem), what do you want to achieve”
I have a mock server to which I want to potentially add more items. By item I refer to an Item from the Collection object - Collection | Postman Collection Format - which consists of Request and Response objects. I am doing this programatically not manually hence I need to work with the API to achieve delta updates, rather than recreating the collection which is my current go to process.
So far I am recreating the whole collection (by sending PUT /collections/collectionId). When adding a new item (request with an example response pair) to the collection with my current process I receive a 400 error response because of the size of the request.
Each item’s response has a somewhat heavy body content and when they are all added together and then attempt to recreate the collection - the entire request to PUT /collections/collectionId - starts exceeding the maximum allowed size for the body of the request (from documentation is 1MB, I managed to push around 10+ mb).
Hence I started looking for ways to update items individually, but the documentation and ways to achieve that are scarce.
I had also tried to gzip the PUT /collections/collectionId request so that it’s lighter but that did not work out as I expected, i.e. nothing changed on the postman end and I still received the same 400 response
I believe you can use these examples to solve your problem.
As Danny said, we will be working on the examples and the existing documentation, and we will also work on a blog post to help people with these endpoints.
Please let me know if this works for you.