# Validate the content of the JSON response in HTTP Synthetic Monitoring for an API

**URL:** <https://community.dynatrace.com/t/validate-the-content-of-the-json-response-in-http-synthetic-monitoring-for-an-api/49900>\
**Category:** Synthetic Monitoring\
**Tags:** http-monitor, synthetic-monitoring\
**Created:** [January 24, 2025, 3:27am UTC](https://community.dynatrace.com/t/validate-the-content-of-the-json-response-in-http-synthetic-monitoring-for-an-api/49900 "2025-01-24T03:27:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sisapy09](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@Sisapy09](https://community.dynatrace.com/u/Sisapy09)\
**Post date:** [January 24, 2025, 3:27am UTC](https://community.dynatrace.com/t/validate-the-content-of-the-json-response-in-http-synthetic-monitoring-for-an-api/49900/1 "2025-01-24T03:27:47Z")

</div>

How can I validate a JSON response in the HTTP monitor? I only need to check if the JSON contains a key with the text “xyz”. The executions are failing when I run the monitor with content validation. Additionally, the page redirects to an SSO login page and asks for a password. Do I need to make any changes to address this?

---

<div class="post-metadata">

**Author:** ![p\_devulapalli](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/p_devulapalli/32/41590_2.png) [@p\_devulapalli](https://community.dynatrace.com/u/p_devulapalli)\
**Post date:** [January 24, 2025, 4:18am UTC](https://community.dynatrace.com/t/validate-the-content-of-the-json-response-in-http-synthetic-monitoring-for-an-api/49900/2 "2025-01-24T04:18:24Z")

</div>

[@Sisapy09](https://community.dynatrace.com/user/83727)&nbsp;- One way to achieving it is by creating multiple HTTP requests in the HTTP monitor. First one would be for authentication which includes the URL and authentication and the second request would be to query the response and validate , you can use the scripts to retrieve the content and validate.

> **[Configure HTTP monitors in Classic](https://docs.dynatrace.com/docs/observe/digital-experience/synthetic-monitoring/http-monitors-classic/configure-http-monitors-classic)**
>
> Learn about configuring HTTP monitors.

> **[Pre- and post-execution scripts for HTTP monitors in Classic](https://docs.dynatrace.com/docs/observe/digital-experience/synthetic-monitoring/http-monitors-classic/pre-and-post-scripting-for-http-monitors-classic)**
>
> Learn how to apply pre and post scripts to your requests
