# Custom API integration

**URL:** <https://discuss.elastic.co/t/custom-api-integration/314538>\
**Category:** Elasticsearch\
**Created:** [September 15, 2022, 9:57pm UTC](https://discuss.elastic.co/t/custom-api-integration/314538 "2022-09-15T21:57:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alextg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alextg/32/137075_2.png) [@alextg](https://discuss.elastic.co/u/alextg)\
**Post date:** [September 15, 2022, 9:57pm UTC](https://discuss.elastic.co/t/custom-api-integration/314538/1 "2022-09-15T21:57:03Z")

</div>

Hello,  
I'm running into issues while implementing the Custom API integration which sends API get requests. I have setup successfully other integrations using the Custom Logs integration, however, the Custom API integration doesn't work for me. These are some of the details:

- I'm using basic authentication.
- The output of the API call doesn't need pagination
- The agent that the integration is running on is able to reach the API URL
- Certs from the application server are valid.

Can someone advise what I'm missing?

These are the log errors:

```auto
16:07:24.271
elastic_agent.filebeat
[elastic_agent.filebeat][error] request failed
16:07:24.271
elastic_agent.filebeat
[elastic_agent.filebeat][error] Error while processing http request: failed to execute rf.collectResponse: failed to execute http client.Do: failed to execute http client.Do: Get "https://myserver:1111/api/something": GET https://myserver:1111/api/something giving up after 6 attempts

```

 ![custom-api-integration](https://us1.discourse-cdn.com/elastic/original/3X/0/e/0e3939457f88a7ee9fc088ceef9875bbd6314d2f.png)

---

<div class="post-metadata">

**Author:** ![alextg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alextg/32/137075_2.png) [@alextg](https://discuss.elastic.co/u/alextg)\
**Post date:** [September 16, 2022, 11:51am UTC](https://discuss.elastic.co/t/custom-api-integration/314538/2 "2022-09-16T11:51:19Z")

</div>

Looking closer at the JSON output, I noticed the missing square brackets `[]` around the API response. Also, the ContentType from the Response Headers is `application/json;charset=UTF-8` which as per the Response decode settings comment is not supported. Can someone advise a workaround for this ContentType.

![image](https://us1.discourse-cdn.com/elastic/original/3X/7/8/780cab141dcf7ba5b747fd5b45c7368449c006a8.png)

---

<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:** [October 14, 2022, 11:52am UTC](https://discuss.elastic.co/t/custom-api-integration/314538/3 "2022-10-14T11:52:03Z")

</div>

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