I wish to integrate an external rest api within a slate application? Does Foundry allow calling external api's from SLATE, if yes how can we achieve the same?
3 Answers
In our Foundry instance, we can call external HTTP(s) destinations from Slate. Means technically it's possible. The configuration is done by the Palantir engineers.
If this integration makes sense or is recommended is a different discussion.

- 654
- 3
- 11
Yes, Slate enables safely calling any external REST API's through HTTPJSON requests via the Queries tab.
In order for the these queries to be made, the REST API needs to be configured as a Slate Datasource which can currently only be configured by Palantir admins, so just reach out to your Palantir rep and they should be able to get you sorted.
The configuration of a Slate Datasource is necessary since Slate differentiates queries made between Edit mode and View mode such that viewers of a Slate app are prevented from seeing the exact requests. This prevents possible bad actors from gleaning information of external architecture and helps keep your sources safe.

- 21
- 5
Slate is self contained, so you won't be able to do external http requests due to XSS protections. This would to a limit enable you to leak data outside of Foundry, so it's unlikely that you'll find a direct way of getting this to work.
Alternatively, is this external API call something you can pre-empt and cache? if yes then you could use a magrite-rest-call
to ingest data from your endpoint to a dataset, at regular intervals, and query this dataset instead of the external API.

- 36,317
- 49
- 147
- 195
-
1Thank You for the quick response, the alternative option(Magritte agent) is something we already do. Agree with your point, yes anything real time should be outside Foundry, just wanted to check if at all there was a way. – Arun Nov 03 '20 at 05:00