微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

通过 API 更新跑道徽章布局

如何解决通过 API 更新跑道徽章布局

我正在通过 API 生成所有应用程序。我的所有字段、视图、webhooks 等都运行良好。我被困在“布局”上。通过布局,我不是指应用程序视图中的简单表格/徽章视图。我的意思是当一个应用被另一个应用引用时可见的参考徽章、卡片、布局。

通过查看 get_app() 的输出,我看到“layouts”是 app_id、fields、config 等的对等项。我在 podio_lib 中看不到任何允许我更新布局的内容。我尝试在调用 PodioApp::update() 时在 $attributes 中传递 'layouts' => $layouts,没有错误,但也没有更新徽章。

        $app_id = ...
        $config = ...
        $fields = ...
        $layouts = [
            'badge' => ['default' => false,'fields' => [
                ['header' => ['type' => 'field','id' => 12345],['content' => ['type' => 'field','id' => 12345]],['details_1' => ['type' => 'field',['details_2' => ['type' => 'field',['details_3' => ['type' => 'field','id' => 12345]]]]];
        $attributes = array(
            'config' => $config,'fields' => $fields,'layouts' => $layouts
        );

        $response = PodioApp::update($app_id,$attributes);

更新布局的 podio 文档显示了使用此 API。这没有任何意义:

PodioView::get( $view_id );

谢谢

注意 get(app) 响应显示布局作为 app_id 的同级存在:

{
  "url_label": "assets","app_id": 25615964,"layouts": {
    "relationship": {
      "default": false,"fields": {
        "details_4": {
          "type": "field","id": 218180619
        },"header": {
          "type": "field","id": 218180597
        },"details_2": {
          "type": "field","id": 218180608
        },"details_3": {
          "type": "field","id": 218180614
        },"details_1": {
          "type": "field","id": 218180611
        }
      }
    },"badge": {
      "default": false,"fields": {
        "footer_1": {
          "type": "virtual","id": "created_on"
        },"footer_2": {
          "type": "virtual","id": "created_by"
        },

截断...

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。