【问题标题】:Palantir Foundry Fusion access using API使用 API 访问 Palantir Foundry Fusion
【发布时间】:2021-06-08 17:18:41
【问题描述】:

我想使用 API 从我的 Palantir 铸造融合表中提取所有数据并将其粘贴到本地的 excel 中?我该怎么做?

【问题讨论】:

    标签: palantir-foundry


    【解决方案1】:

    将融合表同步到数据集后,您可以通过 phonograph2 API 对其进行 dl。 有两种服务:

    1. 表格搜索服务(听说很快就要弃用了)
    2. 对象搜索服务

    出于上述原因,我建议您使用第二个。 要使用 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));
    

    【讨论】:

      【解决方案2】:

      没有任何 API 可以从 Fusion 中提取数据。我不知道您的融合有多大,但如果您打算将其粘贴到本地的 excel 中,您可以使用剪贴板进行操作:

      1 - 选择 fusion 和 CTRL + C 上的行 (mac: CMD + C)

      2 - 在 excel 中选择要过去的行并按 CTRL + V (mac: CMD + V)

      【讨论】:

      • 我想将 Fusion 中的切割数据自动化并粘贴到 excel 中。这就是为什么我正在寻找 API 或任何其他为我完成这项工作的自动化工具。所以如果你建议任何工具(Selenium 不能)或这样做的方法,我将不胜感激。
      • 为什么不将 Fusion sheet 同步到数据集并通过 API 下载数据集?
      • 这正是我的问题!同步数据集后,如何使用 API 下载数据(这部分我不知道)
      • 在 SO 上还有其他答案可以描述这一点。
      猜你喜欢
      • 2022-06-27
      • 2023-01-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-05
      • 2021-02-19
      • 2022-08-03
      • 1970-01-01
      相关资源
      最近更新 更多