You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Postman中筛选API响应里的子JSON对象

How to Filter API Requests by Nested Fields (Your "Sub-Objects") in Postman

Hey there! Sounds like you're trying to narrow down your API results based on nested fields (what you referred to as "sub-objects")—let's break this down step by step using your Convirza API call as an example.

First, let's recap what you've already got working:

  • Your current request URL: GET https://apicfa.convirza.com/v2/call/dni?filter=group_id=8361&limit=10
  • It returns a success response with a data array of call objects, each containing fields like call_id, group_id, and disposition (which I assume is the nested "sub-object" you want to filter on).

Here's how to filter by nested fields:

  1. Confirm the API's nested filtering syntax
    Most REST APIs use one of a few standard patterns to target nested fields:

    • Dot notation (e.g., disposition.status to target the status field inside the disposition object)
    • Bracket notation (e.g., disposition[status])
    • Semicolon-separated values if combining multiple filter conditions (e.g., group_id=8361;disposition.status=answered)
  2. Update your filter parameter
    Let's say you want to filter calls where the disposition sub-object has a status value of "answered". Here are a couple of valid URL formats depending on the API's requirements:

    • If the API supports multiple filter parameters:
      GET https://apicfa.convirza.com/v2/call/dni?filter=group_id=8361&filter=disposition.status=answered&limit=10
      
    • If the API expects combined filters in a single filter parameter:
      GET https://apicfa.convirza.com/v2/call/dni?filter=group_id=8361;disposition.status=answered&limit=10
      

    Pro tip: If your nested field's value has spaces or special characters, wrap it in quotes, like disposition.status="call completed".

  3. Test in Postman easily

    • Open your request in Postman and navigate to the "Params" tab.
    • Add a new key-value pair:
      • Key: filter
      • Value: group_id=8361;disposition.status=answered (or the syntax your API requires)
    • Postman will automatically handle URL encoding for you, so you don't have to manually escape special characters.
    • Send the request and check that the data array only includes calls matching your nested field criteria.
  4. Quick troubleshooting tips

    • Double-check field names in your API response (case sensitivity is a common gotcha!).
    • Some APIs require explicit operators like AND/OR, e.g., filter=group_id=8361 AND disposition.status=answered.
    • If you're stuck, look for filtering examples in the Convirza API docs—they’ll outline the exact syntax for nested objects.

内容的提问来源于stack exchange,提问作者user3708763

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 10:53:24