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

如何为待调用的REST API JSON请求新增标签?

Adding a New Tag to Your JSON Request

Got it, let's walk through how to add a new tag (key-value pair) to your JSON request. First, here's your original request with the truncated BeneficiaryList section filled in with a placeholder for clarity:

{
  "Version": "1.0",
  "RequestingSystemName": "SFORCECS",
  "InsuredInformation": {
    "Zipcode": "12335",
    "StateProvinceCode": "CA",
    "PhoneNumber": "(111) 111-2222",
    "MiddleName": null,
    "LastName": "ABC",
    "FirstName": "DEF",
    "City": "PLACEWI",
    "BirthDate": "1950-01-01",
    "AddressLine3": null,
    "AddressLine2": null,
    "AddressLine1": "111 123 Drive"
  },
  "BeneficiaryList": [
    {
      "Relationship": "Spouse",
      "Name": "GHI JKL"
    }
  ]
}

To add a new tag, you first need to decide where it logically belongs—top-level of the request, inside the InsuredInformation object, or within a beneficiary entry. Here are common examples:

Example 1: Adding a top-level tag

If the new data applies to the entire request (like a unique identifier), insert it alongside other top-level keys:

{
  "Version": "1.0",
  "RequestingSystemName": "SFORCECS",
  "RequestID": "REQ-2024-001", // New top-level tag
  "InsuredInformation": {
    "Zipcode": "12335",
    "StateProvinceCode": "CA",
    "PhoneNumber": "(111) 111-2222",
    "MiddleName": null,
    "LastName": "ABC",
    "FirstName": "DEF",
    "City": "PLACEWI",
    "BirthDate": "1950-01-01",
    "AddressLine3": null,
    "AddressLine2": null,
    "AddressLine1": "111 123 Drive"
  },
  "BeneficiaryList": [
    {
      "Relationship": "Spouse",
      "Name": "GHI JKL"
    }
  ]
}

Example 2: Adding a tag inside InsuredInformation

If the new data is specific to the insured (like an email address), add it within the InsuredInformation object:

{
  "Version": "1.0",
  "RequestingSystemName": "SFORCECS",
  "InsuredInformation": {
    "Zipcode": "12335",
    "StateProvinceCode": "CA",
    "PhoneNumber": "(111) 111-2222",
    "MiddleName": null,
    "LastName": "ABC",
    "FirstName": "DEF",
    "City": "PLACEWI",
    "BirthDate": "1950-01-01",
    "AddressLine3": null,
    "AddressLine2": null,
    "AddressLine1": "111 123 Drive",
    "EmailAddress": "def.abc@example.com" // New tag for insured
  },
  "BeneficiaryList": [
    {
      "Relationship": "Spouse",
      "Name": "GHI JKL"
    }
  ]
}

Key Syntax Rules to Follow

  • All keys and string values must use double quotes ("), not single quotes.
  • Separate key-value pairs with commas, but never add a trailing comma after the last pair in an object or array.
  • For non-string values (numbers, booleans, null), skip the quotes (e.g., "IsPrimary": true or "PolicyAmount": 50000).

Just pick the location that aligns with your assignment's requirements, add the new key-value pair following these rules, and you’ll have a valid updated JSON request.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.26 10:31:48