# HTTP monitor: How do I validate on only parts of a JSON response?

**URL:** <https://community.dynatrace.com/t/http-monitor-how-do-i-validate-on-only-parts-of-a-json-response/36322>\
**Category:** Synthetic Monitoring\
**Tags:** http-monitor\
**Created:** [August 24, 2022, 12:58pm UTC](https://community.dynatrace.com/t/http-monitor-how-do-i-validate-on-only-parts-of-a-json-response/36322 "2022-08-24T12:58:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsmsdk](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@rsmsdk](https://community.dynatrace.com/u/rsmsdk)\
**Post date:** [August 24, 2022, 12:58pm UTC](https://community.dynatrace.com/t/http-monitor-how-do-i-validate-on-only-parts-of-a-json-response/36322/1 "2022-08-24T12:58:07Z")

</div>

I’m currently working on an HTTP monitor where I don’t know how to validate the JSON response.

It is a [status.io](http://status.io) endpoint that I would like to query, but the JSON response contains more info than I need. Is it possible to isolate two objects with post-execution scripts prior to validation? Let’s say I wanted to validate on **Voice DK** & **Agent application** status.

If anyone could point me in the right direction it would be much appreciated&nbsp;:blush:

**Endpoint** :  
[https://api.status.io/1.0/status/58207f2bf02471510e000303](https://api.status.io/1.0/status/58207f2bf02471510e000303)

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [August 24, 2022, 4:33pm UTC](https://community.dynatrace.com/t/http-monitor-how-do-i-validate-on-only-parts-of-a-json-response/36322/2 "2022-08-24T16:33:51Z")

</div>

You will need to parse the json with javascript code.

Example:

```markup
{
    "totalCount": 3,
    "nextPageKey": null,
    "resolution": "1m",
}

```

```javascript
body = response.getResponseBody();
obj = JSON.parse(body);
totalCount = obj.totalCount;
api.setValue("totalCount", totalCount);
if (totalCount == 0) {
    api.fail("Total Count is null");
} else {
    api.info("Total Count is not null");
}

```

You just need to proper parse the result json you get from the status page to get the proper field for validation.

Regards
