# Failed: Verify Status code is 200

**URL:** <https://community.postman.com/t/failed-verify-status-code-is-200/18154>\
**Category:** Help Hub\
**Created:** [December 1, 2020, 9:25pm UTC](https://community.postman.com/t/failed-verify-status-code-is-200/18154 "2020-12-01T21:25:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chandana](https://avatars.discourse-cdn.com/v4/letter/c/b5a626/32.png) [@Chandana](https://community.postman.com/u/Chandana)\
**Post date:** [December 1, 2020, 9:25pm UTC](https://community.postman.com/t/failed-verify-status-code-is-200/18154/1 "2020-12-01T21:25:14Z")

</div>

Code that I have in postman API works fine

pm.test(“Verify Status code is 200”, function () {  
pm.response.to.have.status(200);  
});

It throws 2 errors while the same script runs in a monitor  
Failed: Verify Status code is 200  
expected { Object (id, \_details, …) } to have property ‘code’

Any help is appreciated

---

<div class="post-metadata">

**Author:** ![amit](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/amit/32/2056_2.png) [@amit](https://community.postman.com/u/amit)\
**Post date:** [December 3, 2020, 4:21am UTC](https://community.postman.com/t/failed-verify-status-code-is-200/18154/2 "2020-12-03T04:21:56Z")

</div>

Hey @Chandana 👋 , Welcome to Postman Community!

I was unable to understand the full context, but from what I understood, looks like the place where things fail, the URL in questions is not reachable.

Do things work locally on your Postman app and fail on Monitor? Or is it the reverse?

Check the Postman console and provide a screenshot here, that would help people understand where and what is failing.

Console may be opened by clicking on the “Console” icon, located at the bottom left  
 ![Screen Shot 2020-12-03 at 5.17.49 PM](https://us1.discourse-cdn.com/getpostman/original/3X/7/7/77a5f03d0fe659fdb55075295e54baac8a16105b.png)

Alternatively, you may open the Console Window by navigating to `View → View Postman Console` from the Postman app ([native app](https://www.postman.com/downloads/) only)

Also check this, to find out how to troubleshoot common errors when sending requests fails: [Troubleshooting requests | Postman Learning Center](https://learning.postman.com/docs/sending-requests/troubleshooting-api-requests/)

---

<div class="post-metadata">

**Author:** ![Chandana](https://avatars.discourse-cdn.com/v4/letter/c/b5a626/32.png) [@Chandana](https://community.postman.com/u/Chandana)\
**Post date:** [December 3, 2020, 3:26pm UTC](https://community.postman.com/t/failed-verify-status-code-is-200/18154/3 "2020-12-03T15:26:07Z")

</div>

Amit,

Thank you for the quick response. Things work fine in Postman app, Console doesn’t throw any errors, but **they fail in Monitor**. Console Log that can be viewed from Monitor throws the above error.

![image](https://us1.discourse-cdn.com/getpostman/original/3X/b/3/b391d42dd7fb7ca3fed50d415c44e3f1723c36ec.png)

---

<div class="post-metadata">

**Author:** ![Chandana](https://avatars.discourse-cdn.com/v4/letter/c/b5a626/32.png) [@Chandana](https://community.postman.com/u/Chandana)\
**Post date:** [December 4, 2020, 6:26pm UTC](https://community.postman.com/t/failed-verify-status-code-is-200/18154/4 "2020-12-04T18:26:07Z")

</div>

I updated the code and new error comes up that value is ‘undefined’ ( Again only in monitor)

pm.test(“Verify Status code is 200”, function () {  
pm.expect(pm.response.code).to.eql(200);  
});

![image](https://us1.discourse-cdn.com/getpostman/original/3X/3/9/390006fec8225e1414bc460b5d0a38beed1479f7.png)

Print value in console is  
console.log(pm.response.code);

![image](https://us1.discourse-cdn.com/getpostman/original/3X/e/f/ef7961bf975c3b2bad79350f482cf8b0299dd9a9.png)

---

<div class="post-metadata">

**Author:** ![amit](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/amit/32/2056_2.png) [@amit](https://community.postman.com/u/amit)\
**Post date:** [December 4, 2020, 6:43pm UTC](https://community.postman.com/t/failed-verify-status-code-is-200/18154/5 "2020-12-04T18:43:25Z")

</div>

Hey @Chandana, thanks for sharing the screenshots that helps.

From this image, I understand that `ptdinttest1` is a server running locally on your machine  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/b/3/b391d42dd7fb7ca3fed50d415c44e3f1723c36ec.png)

[localhost](https://en.wikipedia.org/wiki/Localhost) (`127.0.0.1`), as the name suggests, is local to your machine and not visible externally on the internet. And the reason why things work fine when running locally on the Postman app.

Postman Monitor will not be able to access your locally running server, and thus the failures that you see.

---

<div class="post-metadata">

**Author:** ![Chandana](https://avatars.discourse-cdn.com/v4/letter/c/b5a626/32.png) [@Chandana](https://community.postman.com/u/Chandana)\
**Post date:** [December 4, 2020, 6:55pm UTC](https://community.postman.com/t/failed-verify-status-code-is-200/18154/6 "2020-12-04T18:55:30Z")

</div>

Can this be resolved if we have a plan with Static IP address?

---

<div class="post-metadata">

**Author:** ![amit](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/amit/32/2056_2.png) [@amit](https://community.postman.com/u/amit)\
**Post date:** [December 4, 2020, 7:25pm UTC](https://community.postman.com/t/failed-verify-status-code-is-200/18154/7 "2020-12-04T19:25:06Z")

</div>

@Chandana your server needs to be externally accessible over the Internet for Postman Monitor to be able to reach it.

You can limit access to just Postman monitors by selecting and allowing [Monitor’s static IPs](https://learning.postman.com/docs/designing-and-developing-your-api/monitoring-your-api/using-static-IPs-to-monitor/) on your Firewall/LB, if you are on the Business/Enterprise plan.
