Hi,
I’m working on the “Day 12: Postman API” in the “30 days of Postman - for developers”.
When I sent a GET request on “Get a collection” and “Get an Environment”, I received the error message, “AssertionError: expected PostmanResponse{ …(10) } to have property ‘code’ of 200, but got 404”. Please refer to my one of screen shots attached here.
I believe that the wrong environment variables, collectionId and environmentId, causes this error. Please refer to the other screen shot attached here.
I entered the Variable and the Initial value and the Current value as they are written in the instruction.
Could someone advise me to solve this issue?
Best,
Hey @maintenance-saganis4
Which URLs are you using for those calls and are the ids that you’re using correct?
From the variables, I can see that these are not correct and you should be using the Id
of the element and not the name of the element.
Both of those say “with the Collection/Environment Id for…” so you need to get the id
of those named elements.
Those are used to call the Postman API, that has routes of:
You would get those by opening the element in a tab, then selecting the i
icon on the right sidebar to display the meta information of the element.
Hi,
Thank you for your instruction.
I have done as you mentioned, and I came across the following errors.
Kindly check my variables.
This is my collection ID for the “Day 12: Postman API.”
This is my environment ID.
This is my workspace ID.
I deleted the collection for Day 12 and have started it over. But I could not resolve what causes the errors.
Best,