# Send the data obtained from the public API to email

**URL:** <https://community.integray.com/t/send-the-data-obtained-from-the-public-api-to-email/205>\
**Category:** Handy solutions\
**Created:** [October 25, 2023, 9:07am UTC](https://community.integray.com/t/send-the-data-obtained-from-the-public-api-to-email/205 "2023-10-25T09:07:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam.tovara](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@adam.tovara](https://community.integray.com/u/adam.tovara)\
**Post date:** [October 25, 2023, 9:07am UTC](https://community.integray.com/t/send-the-data-obtained-from-the-public-api-to-email/205/1 "2023-10-25T09:07:00Z")

</div>

Hi all,  
for potential inspiration for other **Integray** users, I’m adding my integration here, where I retrieve data from a public API, convert it into MS Excel, and then send it via email. And all this within five simple steps. I believe it might help someone with their own integration:

I found an API for fetching currency exchange rates on the page [https://app.exchangerate-api.com](https://app.exchangerate-api.com/), where, after a simple registration, you get the **URL** and **API Key** required for the first integration step.

**Step 1: Get data from public API**  
I used the **Advanced Rest API Connector** , where I just entered the above-mentioned URL and API Key. I chose the JSON as the Output format type (see the configuration below).

 ![2023-10-25_10-47-52](https://europe1.discourse-cdn.com/flex017/uploads/integray/original/1X/bd504ee728c3d1fea3deda6b1978b5ce8101764e.png)

**Step 2: Data preparation for conversion to Excel**  
In the next step, I needed to prepare the retrieved data for conversion to MS Excel. I used the **JS Mapper** with the following configuration. As the Output schema, I again selected JSON. In Input mapping, it was necessary to map the data from the previous step.

 ![2023-10-25_10-49-44](https://europe1.discourse-cdn.com/flex017/uploads/integray/original/1X/e61655642eb42a456c80f6c5e8f34833b100ee79.png)

**Step 3: Data conversion to Excel**  
This step was the simplest - I chose the **JSON to Excel Converter** and only mapped the data from the previous step in the Input mapping. Integray itself prepared the **Data** schema for me.

 ![2023-10-25_10-51-30](https://europe1.discourse-cdn.com/flex017/uploads/integray/original/1X/4b7592c501f7f1cfd9ea7fac1fa88658df443367.png)

**Step 4: Preparing data for sending by email**  
I used the **JS Mapper** again, as preparation for the final step - sending via email.

 ![2023-10-25_10-52-17](https://europe1.discourse-cdn.com/flex017/uploads/integray/original/1X/853c27f095ab76a058e6d126e651beb5fdce7657.png)

**Step 5: Sending by email**  
To send the email, I used the **Seznam SMTP Sender Connector** , where I entered my login credentials and mapped the data from the previous step in the Input Mapping.

 ![2023-10-25_10-53-26](https://europe1.discourse-cdn.com/flex017/uploads/integray/original/1X/065ad9c3b8d2cccb9c3b59bd71a60e16641bcab6.png)

So, this is my configuration. There are undoubtedly many other ways to achieve the same result. I believe this can serve as a bit of inspiration to someone.

If you have any questions, don’t hesitate to contact me.

Have a nice day

Adam

---

<div class="post-metadata">

**Author:** ![Andrea](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Andrea](https://community.integray.com/u/Andrea)\
**Post date:** [October 27, 2023, 6:49am UTC](https://community.integray.com/t/send-the-data-obtained-from-the-public-api-to-email/205/2 "2023-10-27T06:49:00Z")

</div>

Hey, Adam,

I tried to do the integration according to your instructions and it worked beautifully! Thanks!

- I also added CRON (which [I learned how to set up here](https://community.integray.com/t/cron-settings-in-log-writer/99)) , which automatically emails me at 8:30 CET every weekday with a new [NASA Astronomy Picture of the Day](https://api.nasa.gov/).

It seems that integray is not only work but also fun 😃

 ![Snímek obrazovky 2023-10-27 v 8.47.10](https://europe1.discourse-cdn.com/flex017/uploads/integray/original/1X/7da09c72214a1b0dcb89f6a5d16d88d267c06ec6.jpeg)  
 ![Snímek obrazovky 2023-10-27 v 8.49.57](https://europe1.discourse-cdn.com/flex017/uploads/integray/original/1X/a25d07d1b181e367458b74f61ffcb437c5aa3710.jpeg)
