Search code examples
jsonpath

JSONPath to get parameter from an array


I have a response body I believe is an array it looks like this:

{"id":982,"form_stage":"1","customer_hash":"fffae165253f494a95bdb753ca87716c"}

In this case I want to get "customer_hash" and I have tried every combination of $..customer_hash $.customer_hash, etc but none of them work because this doesn't start with "response" or "result" I guess it is an array not an object(?).

Can anyone tell me what would be the JSONPath mapping to get the parameter "customer_hash"?


Solution

  • Try using:

    $.customer_hash
    

    Output:

     [
      "fffae165253f494a95bdb753ca87716c"
    ]