2

我正在尝试通过我的 laravel Web 应用程序上的 API 在 Podio 中创建一个应用程序,但是每当我调用 PodioApp::create() 函数时,它都会在 Podio.php 第 289 行异常中返回 PodioBadRequestError 。现在我不确定我是否需要从支持部门请求提高我的 API 密钥的信任级别,但这是我的代码:

$timeclock_app = PodioApp::create(array( 'space_id' => $workspace->space_id,
                                         'type'                 => 'standard',
                                         'name'                 => 'Timeclocks',
                                         'item_name'            => 'Timeclock',
                                         'icon'                 => '270.png',  
  ));

return dd($timeclock_app);

提前致谢!

4

1 回答 1

2

我相信您在发送应用创建请求时所缺少的只是数据。
这是创建应用程序所需的完整(最小)JSON 有效负载的示例。

所有配置信息都是必填的,至少有一个字段。
其他一切都是可选的。

{
  "config": {
    "type": "standard",
    "app_item_id_padding": 1,
    "app_item_id_prefix": "",
    "show_app_item_id": false,
    "allow_comments": true,
    "allow_create": true,
    "allow_edit": true,
    "allow_attachments": true,
    "silent_creates": false,
    "silent_edits": false,
    "disable_notifications": false,
    "default_view": "badge",
    "allow_tags": false,
    "icon": "251.png",
    "name": "App",
    "item_name": "item"
  },
  "space_id": 22788,
  "fields": [
    {
      "config": {
        "label": "Title",
        "settings": {
          "size": "small"
        },
        "required": false
      },
      "type": "text"
    }
  ]
}
于 2016-06-13T22:08:09.113 回答