Layer7 API Management

Expand all | Collapse all

Extract JSON Data from Response

Jump to Best Answer
  • 1.  Extract JSON Data from Response

    Posted 10-23-2017 04:57 AM

    Hi guys I am using API Gateway 9.1 & I am trying to extract some json field from my json response.

     

    My JSON Response is,

    {
      "data": [
        {
          "title": "Json",
          "sub.topic": "extract this field"
        }
      ]
    }
    $.data[0].title gives Json
    $.data[0].sub.topic fails
    Using Evaluate Json Response I can extract "title" filed but I cannot extract "sub.topic" because of .(dot) inbetween sub & topic.
    How can I extract field such as sub.topic?
    Thanks


  • 2.  Re: Extract JSON Data from Response
    Best Answer

    Broadcom Employee
    Posted 10-26-2017 11:16 AM

    HI Siddharth,

     

    Try using: $.data[0].['sub.topic']

     

     

     

    Regards,

    Joe



  • 3.  Re: Extract JSON Data from Response

    Posted 10-26-2017 12:04 PM

    Thanks dasjo02, after posting the question I tried with an double quote $.data[0].["sub.topic"] which dinn work. Now it is working with single quote.