# Http.json: unexpected end of JSON input

**URL:** <https://discuss.elastic.co/t/http-json-unexpected-end-of-json-input/357061>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [April 9, 2024, 11:58am UTC](https://discuss.elastic.co/t/http-json-unexpected-end-of-json-input/357061 "2024-04-09T11:58:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![h.d.intodata](https://avatars.discourse-cdn.com/v4/letter/h/c67d28/32.png) [@h.d.intodata](https://discuss.elastic.co/u/h.d.intodata)\
**Post date:** [April 9, 2024, 11:58am UTC](https://discuss.elastic.co/t/http-json-unexpected-end-of-json-input/357061/1 "2024-04-09T11:58:12Z")

</div>

Hi team,  
I am trying to get metrics on an API call. My call works on Postman, however, I am getting this error when I run metricbeat:

> {"log.level":"error","@timestamp":"2024-04-09T11:51:35.572Z","log.origin":{"function":"[github.com/elastic/beats/v7/metricbeat/mb/module.(\*metricSetWrapper).fetch","file.name":"module/wrapper.go","file.line":256},"message":"Error](http://github.com/elastic/beats/v7/metricbeat/mb/module.(*metricSetWrapper).fetch%22,%22file.name%22:%22module/wrapper.go%22,%22file.line%22:256%7D,%22message%22:%22Error) fetching data for metricset http.json: unexpected end of JSON input","service.name":"metricbeat","ecs.version":"1.6.0"}

My http,yml file is:

```auto
- module: http
  metricsets:
    - json
  period: 5s
  hosts: ["http://<ip_address>:<port>"]
  namespace: "tmc"
  path: "/metrics/json"
  ssl.verification_mode: "none"
  #body: ""
  headers:
  Authorization: "Bearer <token>"
  method: "GET"
  #username: "user"
  #password: "secret"
  request.enabled: true
  response.enabled: true
  json.is_array: true
  #dedot.enabled: false

```
