title: Ansible JSON parsing error - FAILED! => {"msg": "template error while templating string: expected name or number
body: <p>I'm trying to parse my JSON using Ansible but hitting issues. I need the pincode from the JSON response</p>
  
  <p>My sample JSON response is </p>
  
  <pre><code>{
  "James Params": {
  "01. name": "james bond",
  "02. phone": "334455667788",
  "03. height": "5.10",
  "04. country": "UK",
  "05. pincode": "10000",
  "06. city": "london",
  }
  }
  </code></pre>
  
  <p>My playbook code is</p>
  
  <pre><code>- name: Submit and read the JSON response
    uri:
      method: GET
      url: "http://URL_UNDER_TEST"
      return_content: yes
      headers:
        Accept: application/json
    register: response
  
  - debug:
      msg: "{{response.json.'James Params'.'05. pincode'}}"
  </code></pre>
  
  <p>I'm getting the below error:</p>
  
  <blockquote>
    <p>fatal: [localhost]: FAILED! => {"msg": "template error while templating string: expected name or number. String: {{response.json | json_query(\"James Params\".\"05. pincode\")}}"}</p>
  </blockquote>
  
  <p>Request help on this.</p>