# Adding body in elastic heartbeat configuration

**URL:** <https://discuss.elastic.co/t/adding-body-in-elastic-heartbeat-configuration/257958>\
**Category:** Synthetics\
**Created:** [December 8, 2020, 9:21am UTC](https://discuss.elastic.co/t/adding-body-in-elastic-heartbeat-configuration/257958 "2020-12-08T09:21:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amr\_ibrahim](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@amr\_ibrahim](https://discuss.elastic.co/u/amr_ibrahim)\
**Post date:** [December 8, 2020, 9:21am UTC](https://discuss.elastic.co/t/adding-body-in-elastic-heartbeat-configuration/257958/1 "2020-12-08T09:21:05Z")

</div>

Hello  
Kindly we need to add api to elastic heartbeat configuration and we need to pass post body json object in the configuration so how can we do that

```auto
http://url-api
{
"GetFees": {
"CRNumber": "5555555",
"TransactionFromDate": "2018-01-01",
"TransactionToDate": "2021-10-13",
"PageIndex": 1,
"PageSize": 1000
}
}

```

so make the configuration like below but it fail so any help

```auto
- type: http
  name: GEstablishmentTransaction
  enabled: true
  schedule: "@every 5m"
  timeout: 60s
  urls: ["http://url-api"]
  check.response.status: [200,400,401,403,409,404]
  check.request:
    method: POST
    headers:
      'Content-Type': 'application/json'
    body:
      GetFees:
         CRNumber: "555555"
         TransactionFromDate: "2018-01-01"
         TransactionToDate: "2021-10-13"
         PageIndex: 1
         PageSize: 1000

```

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [December 8, 2020, 10:24am UTC](https://discuss.elastic.co/t/adding-body-in-elastic-heartbeat-configuration/257958/2 "2020-12-08T10:24:25Z")

</div>

Hi @amr_ibrahim,

have you tried supplying the body as a JSON-encoded string (i.e. `body: '{"GetFees": {...}}'`)?

---

<div class="post-metadata">

**Author:** ![amr\_ibrahim](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@amr\_ibrahim](https://discuss.elastic.co/u/amr_ibrahim)\
**Post date:** [December 8, 2020, 11:09am UTC](https://discuss.elastic.co/t/adding-body-in-elastic-heartbeat-configuration/257958/3 "2020-12-08T11:09:11Z")

</div>

Hi @weltenwort,  
Thank you I try your recommendation and working fine  
Thank you

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 1, 2021, 11:09am UTC](https://discuss.elastic.co/t/adding-body-in-elastic-heartbeat-configuration/257958/4 "2021-01-01T11:09:20Z")

</div>

This topic was automatically closed 24 days after the last reply. New replies are no longer allowed.
