通过 API 调用将文件添加到跑道项目

Add file to Podio item through API call

我写了下面的PHP代码:

<?php 

require_once '../podio-php/PodioAPI.php';

//Initalize Podio connection
$client_id = "";
$client_secret = "";

Podio::setup($client_id, $client_secret);


//App ID's
$opname_app_id = 19082139;
$opname_app_token = ""; 

$opname_auth = Podio::$oauth;

Podio::authenticate_with_app($opname_app_id, $opname_app_token);

$attributes = array('ref_type' => 'item', 'ref_id' => 3492);

$upload_result = PodioFile::upload("../questions.php", 'test');

$file_id = $upload_result->file_id;

PodioFile::attach($file_id, $attributes); 

但是当我 运行 它时,我得到以下错误:

Uncaught PodioForbiddenError: "The app with id 19082139 does not have the right add_file on item with id 3492"

尽管我有项目 3492 在应用程序 19082139 中。有人可以帮我解决这个问题吗?

我 99.999999% 确定您不能拥有 ID 为 3492 的项目。请再次检查您使用的是 item_id 而不是 app_item_iditem_id 在整个跑道中是唯一的,而 app_item_id 在单个应用程序中是唯一的。

您可以在跑道UI、项目页面、菜单'Action->Developer Info'

中找到item_id