> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ETL: Ingesting a Postman API Call

> How to translate a working Postman API request into an Integrate.io ETL REST API source component, mapping headers, query parameters, authentication.

Have you ever built a perfectly functional API call in Postman, only to scratch your head when trying to recreating it somewhere else? You're not alone. While integration tools are built to handle data ingestion, their approaches can differ. This guide will bridge that gap, showing you how to seamlessly translate your working Postman calls into robust Integrate.io ETL flows.

This article dives into the nitty-gritty of copying over essential elements like URLs, methods, headers, and data. We'll uncover how to handle certain features in Postman that require slightly different configuration in Integrate.io ETL, ensuring a smooth migration of your API calls. From URL encoding to OAuth 2.0 authorization, we'll equip you with the knowledge to conquer any integration challenge and get your API calls running successfully in Integrate.io.

## Moving Your Postman Calls to Integrate.io ETL

Ready to use your working Postman calls in Integrate.io (IIO)? Let's get started!

* In Postman, click the code button (`<>`) to see how it sends data. Select "cURL" from the dropdown menu:
  <Frame>
    <img src="https://mintcdn.com/integrateio/fpWCvrjvoCDC-WOb/images/how-do-i/image-29.webp?fit=max&auto=format&n=fpWCvrjvoCDC-WOb&q=85&s=2b2769aec7a80d2972a170238c139d09" alt="Postman code button with cURL output showing request details" width="1200" height="616" data-path="images/how-do-i/image-29.webp" />
  </Frame>
* **Find the URL (#1 in the screenshots)**
  * The first line shows the URL, including any automatic encoding. Copy and paste this directly into the URL field of the IIO REST API Source component (don't include the single quotes around this value.)
* **Find the Method - GET, POST, etc. (#2 in the screenshots)**
  * Select this from the Method dropdown menu in IIO.
* **Set up Headers (#3 and 4 in the screenshots)**
  * Headers provide additional information about your request. Postman will add some automatically. In IIO, you'll need to add them manually.
  * The first one is a 'Content-Type' header with a value of 'application/json.' This is telling the API that our call is sending data and the format of the data. Click "Add" under Headers in IIO. Enter "Content-Type" as the key and "application/json" as the value. Don't include the single quotes around this value.
  * The second one is an 'Authorization' header with a 'Bearer `<token>`' as the value. Click the + icon on the right side of the 'Content-Type : application/json' header in IIO. Type the key 'Authorization' on the left side and the value 'Bearer `<actual value of the token>`' on the right side. Don't include the single quotes around this value.
* **Copy the Data (#2 in the screenshots)**
  * The cURL code shows the data sent to the API (the `-data` part). Copy and paste this directly into the Body field of the IIO component.
  * **Important:** Don't include the single quotes around the data, but keep the double quotes within the JSON data itself.
* **In IIO REST API Source Component:**
  <Frame>
    <img src="https://mintcdn.com/integrateio/fpWCvrjvoCDC-WOb/images/how-do-i/image-30.webp?fit=max&auto=format&n=fpWCvrjvoCDC-WOb&q=85&s=f30b14602d483fd39d67a0dfd020a2e8" alt="REST API source component configured with URL, method, and headers" width="1200" height="921" data-path="images/how-do-i/image-30.webp" />
  </Frame>

## Things to Watch Out For

### Missing Headers

Postman adds headers automatically, but you'll need to add them manually in IIO. For example, when you add JSON data to the Body field in Postman and select JSON from the dropdown menu, Postman automatically adds a "Content-Type: application/json" header. In IIO, you need to explicitly add this header.

In Postman:

<Frame>
  <img src="https://mintcdn.com/integrateio/fpWCvrjvoCDC-WOb/images/how-do-i/image-31.webp?fit=max&auto=format&n=fpWCvrjvoCDC-WOb&q=85&s=28bf9afb30c0cafc737bdbf3861bf470" alt="Postman automatically adding Content-Type header for JSON body" width="1200" height="514" data-path="images/how-do-i/image-31.webp" />
</Frame>

In IIO:

<Frame>
  <img src="https://mintcdn.com/integrateio/fpWCvrjvoCDC-WOb/images/how-do-i/image-32.webp?fit=max&auto=format&n=fpWCvrjvoCDC-WOb&q=85&s=21eca0cab7fe993ff0749a20100213ba" alt="Manually adding Content-Type header in the IIO REST API component" width="1200" height="831" data-path="images/how-do-i/image-32.webp" />
</Frame>

### URL Encoding

Postman handles URL encoding automatically, but IIO requires manual encoding for special characters like spaces. You can either replace spaces with "%20" or use the `URLEncode` function in IIO. In Postman you can input a URL with spaces as seen below with "2023-09-25 00:00:00" and Postman will URL encode it before sending it to the API:

<Frame>
  <img src="https://mintcdn.com/integrateio/fpWCvrjvoCDC-WOb/images/how-do-i/image-33.webp?fit=max&auto=format&n=fpWCvrjvoCDC-WOb&q=85&s=96683ca98403cf970c8183b75fc49dae" alt="Postman URL with spaces that will be automatically encoded" width="967" height="609" data-path="images/how-do-i/image-33.webp" />
</Frame>

However, in IIO the URL must be URL encoded. You can either do this manually by replacing the spaces with `%20`:

<Frame>
  <img src="https://mintcdn.com/integrateio/fpWCvrjvoCDC-WOb/images/how-do-i/image-34.webp?fit=max&auto=format&n=fpWCvrjvoCDC-WOb&q=85&s=86d852af785e869cff0b0b162396473e" alt="URL with spaces manually replaced by %20 encoding in IIO" width="1200" height="399" data-path="images/how-do-i/image-34.webp" />
</Frame>

Or you can do it automatically by using our URLEncode function in a variable like this:

<Frame>
  <img src="https://mintcdn.com/integrateio/fpWCvrjvoCDC-WOb/images/how-do-i/image-35.webp?fit=max&auto=format&n=fpWCvrjvoCDC-WOb&q=85&s=7b9a61242508819d851ff26a8d7ffc26" alt="URLEncode function used in a package variable for automatic encoding" width="1200" height="911" data-path="images/how-do-i/image-35.webp" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/integrateio/fpWCvrjvoCDC-WOb/images/how-do-i/image-36.webp?fit=max&auto=format&n=fpWCvrjvoCDC-WOb&q=85&s=9cb17227e8175a21515b4db07ad90880" alt="Package variable list showing the url variable with URLEncode" width="1200" height="316" data-path="images/how-do-i/image-36.webp" />
</Frame>

Then call the "url" variable in the REST API source component like this:

<Frame>
  <img src="https://mintcdn.com/integrateio/fpWCvrjvoCDC-WOb/images/how-do-i/image-37.webp?fit=max&auto=format&n=fpWCvrjvoCDC-WOb&q=85&s=d93f9f1f413397a6aec9847172dbc509" alt="REST API component URL field using the $url variable" width="1200" height="402" data-path="images/how-do-i/image-37.webp" />
</Frame>

### OAuth 2.0 Authorization

Postman simplifies OAuth. You enter credentials, and it formats them for the API call:

<Frame>
  <img src="https://mintcdn.com/integrateio/fpWCvrjvoCDC-WOb/images/how-do-i/image-38.webp?fit=max&auto=format&n=fpWCvrjvoCDC-WOb&q=85&s=639c935651d55e57281dab26194c9597" alt="Postman OAuth 2.0 authorization tab with credential fields" width="1200" height="469" data-path="images/how-do-i/image-38.webp" />
</Frame>

IIO requires manual setup. You might need to create variables for your credentials and use functions to format them according to the API's requirements (refer to the API documentation for details):

<Frame>
  <img src="https://mintcdn.com/integrateio/fpWCvrjvoCDC-WOb/images/how-do-i/image-39.webp?fit=max&auto=format&n=fpWCvrjvoCDC-WOb&q=85&s=89a39e9ed458f617675037f7c66aeed8" alt="Package variables for OAuth credentials in IIO" width="1200" height="730" data-path="images/how-do-i/image-39.webp" />
</Frame>

Then use the CONCAT function to format the body variable value:

<Frame>
  <img src="https://mintcdn.com/integrateio/fpWCvrjvoCDC-WOb/images/how-do-i/image-40.webp?fit=max&auto=format&n=fpWCvrjvoCDC-WOb&q=85&s=c541ca59df9eb7079b0642088e421950" alt="CONCAT function formatting the OAuth body variable" width="1200" height="254" data-path="images/how-do-i/image-40.webp" />
</Frame>

Then use the Curl function to call the API and pass in the url, method, header, and body variables. The #'body' will extract the body of the API response, and then the JsonStringToMap function will turn that body json string into a Map data type and you can use the #'access\_token' to extract just the access token from the body:

<Frame>
  <img src="https://mintcdn.com/integrateio/fpWCvrjvoCDC-WOb/images/how-do-i/image-41.webp?fit=max&auto=format&n=fpWCvrjvoCDC-WOb&q=85&s=870eb83381d870aa009a0f2ecdab518e" alt="Curl function with JsonStringToMap extracting the access token" width="1200" height="287" data-path="images/how-do-i/image-41.webp" />
</Frame>

Then call that access\_token variable in the REST API Source component in IIO:

<Frame>
  <img src="https://mintcdn.com/integrateio/fpWCvrjvoCDC-WOb/images/how-do-i/image-42.webp?fit=max&auto=format&n=fpWCvrjvoCDC-WOb&q=85&s=ccf67e9697f86220addcdf6e64025fec" alt="REST API source component using the $access_token variable" width="1200" height="776" data-path="images/how-do-i/image-42.webp" />
</Frame>

For more examples of this process, see [this](/etl/api-ingestion-guide-with-integrateio/) doc.

## Conclusion

By following this guide, you've unlocked the power to seamlessly translate your well-crafted Postman calls into robust Integrate.io ETL flows using our API connector. You've learned how to extract essential elements like URLs, methods, headers, and data, and how to handle the automatic features in Postman that require manual configuration in IIO. Remember, a keen eye for missing headers, proper URL encoding, and manual OAuth 2.0 authorization setup will ensure a smooth migration process. With this knowledge in your arsenal, you're equipped to conquer any API integration challenge and streamline your data workflows! And of course if you do have any questions, just reach out to our team!
