【发布时间】:2021-06-08 17:18:41
【问题描述】:
我想使用 API 从我的 Palantir 铸造融合表中提取所有数据并将其粘贴到本地的 excel 中?我该怎么做?
【问题讨论】:
标签: palantir-foundry
我想使用 API 从我的 Palantir 铸造融合表中提取所有数据并将其粘贴到本地的 excel 中?我该怎么做?
【问题讨论】:
标签: palantir-foundry
将融合表同步到数据集后,您可以通过 phonograph2 API 对其进行 dl。 有两种服务:
出于上述原因,我建议您使用第二个。 要使用 phonograph API,您需要了解它是如何部署在您的组织上的。 并且很可能您需要反向代理来绕过 CROS 策略。
要了解如何编写查询,您应该阅读 Palantir/Foundry/APIs/Phonograph2 的非常糟糕的书面文档。 下面的示例是邮递员生成的 nodejs matchAll 查询,它对我有用。
祝你好运找到正确的参数来传递:D
var myHeaders = new Headers();
myHeaders.append("accept", "application/json, text/plain, */*");
myHeaders.append("accept-encoding", "gzip, deflate, br");
myHeaders.append("Accept-Language", "en-US, en;q=0.9");
myHeaders.append("Content-Type", "application/json;charset=UTF-8");
// also set orgin, refere, authorization (your token) and authority to make it work
// here I dropped them to avoid any security issue
var raw = "{\r\n \"objectTypes\": [\r\n \"your-object-id\"\r\n ],\r\n \"filter\": {\r\n \"type\": \"matchAll\",\r\n \"matchAll\": {}\r\n }\r\n}";
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://your-url.whatever/phonograph2/api/objects/search/objects", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
【讨论】:
【讨论】: