# I am new to postman and i wanted to compare two responses from different API

**URL:** <https://community.postman.com/t/i-am-new-to-postman-and-i-wanted-to-compare-two-responses-from-different-api/2344>\
**Category:** Help Hub\
**Tags:** compare-two-response\
**Created:** [August 10, 2018, 1:03pm UTC](https://community.postman.com/t/i-am-new-to-postman-and-i-wanted-to-compare-two-responses-from-different-api/2344 "2018-08-10T13:03:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![farhan.quidwai](https://avatars.discourse-cdn.com/v4/letter/f/49beb7/32.png) [@farhan.quidwai](https://community.postman.com/u/farhan.quidwai)\
**Post date:** [August 10, 2018, 1:03pm UTC](https://community.postman.com/t/i-am-new-to-postman-and-i-wanted-to-compare-two-responses-from-different-api/2344/1 "2018-08-10T13:03:19Z")

</div>

Wanted to compare two responses from different API But i am facing issue :-

Response 1 :-  
{  
“errorDescription”: “”,  
“message”: “”,  
“resultCode”: “OK”,  
“resultObj”: {  
“ip”: “192.168.7.60”,  
“x-up-forwarded-for”: “”,  
“port”: “43307”  
}  
}

Response 2 :  
{  
“resultCode”: “OK”,  
“errorDescription”: “”,  
“message”: “”,  
“resultObj”: {  
“ip”: “10.0.0.4”,  
“port”: null,  
“x-up-forwarded-for”: “”  
},  
“systemTime”: 1533906004  
}

Here we are comparing all the keys present in both the responses but i am not able to compare it. I want to compare 1st and 2nd response and if anything is missing in 2nd response from 1st response then fail the test including keys inside the resultObj.  
Please help me out it will be a great help

---

<div class="post-metadata">

**Author:** ![kunagpal](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kunagpal/32/9_2.png) [@kunagpal](https://community.postman.com/u/kunagpal)\
**Post date:** [August 18, 2018, 9:13pm UTC](https://community.postman.com/t/i-am-new-to-postman-and-i-wanted-to-compare-two-responses-from-different-api/2344/3 "2018-08-18T21:13:35Z")

</div>

@farhan.quidwai This use case can be satisfied via response assertions, as follows:

Inside the test script for request 1:

```auto
pm.environment.set('res1', pm.response.text());

```

Inside the test script for request 2:

```auto
pm.test('should have identical responses', () => {
  pm.response.to.have.body(JSON.parse(pm.environment.get('res1')));
});

```

---

<div class="post-metadata">

**Author:** ![farhan.quidwai](https://avatars.discourse-cdn.com/v4/letter/f/49beb7/32.png) [@farhan.quidwai](https://community.postman.com/u/farhan.quidwai)\
**Post date:** [August 28, 2018, 1:45pm UTC](https://community.postman.com/t/i-am-new-to-postman-and-i-wanted-to-compare-two-responses-from-different-api/2344/4 "2018-08-28T13:45:38Z")

</div>

hey @kunagpal Thanks for your response , i want to ignore the systemTime in my assertion part ? is that possible to ignore the systemTime and check for the rest of the values ?
