# Why can a network REST API reject valid JSON?

Exam: 200-301 — Implementing and Administering Cisco Solutions
Knowledge domain: Automation and Programmability
Updated: 2026-11-25T05:30:56.337705+00:00
HTML: https://learningpathx.com/faq/200-301/ccna200301-valid-json-vs-api-schema.html

## Also asked as

- What is the difference between valid JSON and a valid network API request body?
- How can a JSON payload parse correctly but fail a network API's schema checks?

JSON validity tells you whether a parser can read the body. The network API also checks the structure, fields, and values it expects for that operation.

In JSON, an object contains name-value pairs and an array holds values in order. A value can be a string, number, boolean, null, object, or array. For example, `{"vlanId":"10"}` can be parsed as JSON. If a hypothetical endpoint requires an integer for vlanId, the string version fails its schema check. The integer version would be `{"vlanId":10}`. The actual field name and allowed values come from the endpoint documentation.

When troubleshooting, check that the body parses, then compare its top-level shape, required properties, types, and accepted values with the API schema. A payload that passes those checks may still need the right permissions and resource state for the operation.

### References

* [RFC 8259: The JSON Data Interchange Format](https://www.rfc-editor.org/rfc/rfc8259.html)
* [JSON Schema: Creating Your First Schema](https://json-schema.org/learn/getting-started-step-by-step)

Source: [Network Automation, REST APIs, JSON, Ansible, Terraform, and AI](https://learningpathx.com/news/network-automation-rest-apis-json-ansible-terraform-and-ai.html)
