With external requests, you can call APIs from other third parties or your own server to request data, submit data and etc.
![](https://1369750374-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWQDl1MvGQxbiNyVOzW8v%2Fuploads%2Fsd4DeX3KFWFEIYln08Aj%2Fexternal-request1.7c27838f.png?alt=media&token=e184c580-6f1e-4802-9950-bd901f5db51f)
In an Action step, find “External Request” in “Advance Actions” and click “Add your request” then start editing it:
![](https://1369750374-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWQDl1MvGQxbiNyVOzW8v%2Fuploads%2FB2qlotonj3pr09Ez4WRl%2Fexternal-request2.cddb7524.png?alt=media&token=eaada289-ea19-4d66-90a1-f7378746842b)
- 1.choose a request type such as GET, POST, etc
- 2.paste your request URL / endpoint
- 3.adjust “URL parameters”, “Headers”, “Body” or “Authorization” section if needed. e.g. setup API key
- 4.click “Test” and area 5 will show in the “Response” section with a response code
- 5.click on “Response Headers” to expand the header for more details and the received data is in blue
- 6.choose which part of the data you need by clicking the circle on the left-side accordingly
- 7.after clicking area 6, the JSON path for the selected data is automatically shown here. $ means the whole JSON.
- 8.choose which custom field to store the data. You can create a new field here by typing in a field name and clicking it in the drop-down. Click the “Add” button to add to the mapping list
- 9.finally, the mapping shows in area 9. Add as many mapping as needed and click “Save”.
Make sure you provide testing data for any one of the fields/variables in the settings before you use the Test button.
URL Params
![](https://1369750374-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWQDl1MvGQxbiNyVOzW8v%2Fuploads%2FlztfVZGV32nNabMJaDR8%2Fexternal-request3.b9dc4b09.png?alt=media&token=5bcd7f96-38b5-46f2-9e39-62b207bd80ab)
In the above screenshot, we can see that there is a URL parameter in the endpoint called “user_name”. Remember to copy the endpoint down and provide a testing value.
Alternatively, you can use the URL Params sections for the same result.
Headers
![](https://1369750374-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWQDl1MvGQxbiNyVOzW8v%2Fuploads%2FO88WIYlXn6U4wvjCKv9d%2Fdownload%20(66).png?alt=media&token=f9d76ee7-a431-4722-875a-596efab41421)
Same as URL Params, put your key name first, then insert the variable and provide a testing value.
Authorization
![](https://1369750374-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWQDl1MvGQxbiNyVOzW8v%2Fuploads%2FABTPaXnmi99j2YzzU5nX%2Fexternal-request5.41686223.png?alt=media&token=544687cf-c600-4896-ab91-81d91503ac15)
Alternatively, put the token in the Authorization section. It’s going to be less error-prone (sometimes people just forgot the “Bear ” in front of the token).
Moreover, for Basic Auth, simply put your username and password value and the system will do the base64 encoding for you.
Body
To include a file itself in the parameters, use multipart/form-data:
![](https://1369750374-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWQDl1MvGQxbiNyVOzW8v%2Fuploads%2FKD55fCSqI94hdrRDK8mz%2Fexternal-request6.48902713.png?alt=media&token=3ea755b1-5e03-4d4f-b778-09deec1fc94a)
x-www-for-urlencoded works just like URL Params or Headers section.
Instead of listing all the payloads in x-www-form-urlencoded, you can also paste the example payload in raw JSON:
![](https://1369750374-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWQDl1MvGQxbiNyVOzW8v%2Fuploads%2FNwiIdpNhRedVP1k40Bzb%2Fexternal-request7.a95b57ba.png?alt=media&token=bfc1c2cf-0b81-40c5-bb92-a7b326336bd6)
On the left-hand side, Body Content, paste or write your JSON first, when you insert a variable, the Test body content shows on the right side immediately. It’s to specify a testing JSON value.
Click on Copy from body content to copy the whole JSON structure. All the variables will be replaced by {{variable_name
}}. Remove the placeholder and put your testing values.
Testing
Once you are ready, click on the Test button next to the URL endpoint or in the Response section.
![](https://1369750374-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWQDl1MvGQxbiNyVOzW8v%2Fuploads%2FxtmiJePEHrUB7ez9LFPq%2Fexternal-request8.d05241c5.png?alt=media&token=df4100dd-2686-4b64-80d7-67c5758cd8c3)
Besides the tips about how to map data above, you might also want to save the values in the response header for later use. Simply expand the header, click on a value in the header and the JSON path to it shows automatically there.