如何获取特定appitem的所有任务

时间:2017-11-12 07:22:59

标签: podio

我花了最后4小时试图弄清楚如何获取引用特定AppItem的任务列表。

以下内容无效:

// Doesn't work
// $tasks = PodioTask::get_all(array(
// 'reference' => 'rmticket:' . $rmt->item_id,
// ));

// $tasks = PodioTask::get_all(array(
// 'reference' => array('type' => 'rmticket', 'id' => $rmt->item_id),
// ));

// $tasks = PodioTask::get_all(array(
// 'item' => $rmt->item_id,
// ));

// $tasks = PodioTask::get_all(array(
// 'ref_id' => $rmt->item_id,
// ));

此处的文档:https://developers.podio.com/doc/tasks/get-tasks-77949

说这个参数是:

参考

表单上的引用列表"类型:id"用分号分开。

这是我尝试的第一件事,我收到以下错误:

Uncaught PodioBadRequestError: "Invalid value "rmticket" (string): must be one of {'comment', 'rating', 'invoice', 'campaign', 'app_revision', 'app', 'share', 'system', 'hook', 'tag', 'voucher', 'file', 'flow_effect', 'vote', 'partner', 'message', 'conversation', 'share_install', 'form', 'space_member_request', 'space', 'notification', 'auth_client', 'question', 'integration', 'payment', 'subscription', 'live', 'label', 'answer', 'icon', 'location', 'status', 'org_member', 'widget', 'extension_installation', 'file_service', 'app_field', 'alert', 'profile', 'user', 'task_action', 'org', 'condition_set', 'embed', 'condition', 'space_member', 'identity', 'item_participation', 'task', 'extension', 'linked_account', 'grant', 'flow', 'batch', 'contract', 'project', 'item', 'connection', 'flow_condition', 'question_answer', 'action', 'item_revision', 'voting', 'promotion', 'bulletin', 'view'

- 安德鲁。

更新: 我也尝试了以下内容:

//    $tasks = PodioTask::get_all(array(
//      'grouping' => 'rmticket:' . $rmt->item_id,
//    ));
    // Fatal error: Uncaught PodioBadRequestError: "Invalid value "rmticket:720406510" (string): Must be one of ['due_date', 'completed_on', 'reference', 'space', 'app', 'responsible', 'created_by', 'label', 'org' in /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php on line 289

//    $tasks = PodioTask::get_all(array(
//      'grouping' => 'reference',
//      'item_id' => $rmt->item_id,
//    ));
    // Fatal error: Uncaught PodioBadRequestError: "Invalid filter item_id" Request URL: http://api.podio.com/task/?grouping=reference&item_id=720406510 Stack Trace: #0 /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php(349): Podio::request('GET', '/task/', Array, Array) #1 /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/models/PodioTask.php(100): Podio::get('/task/', Array) #2 /home/avcorp/vhosts/pubvps/podio_rmticket/rmticket_util.php(217): PodioTask::get_all(Array) #3 /home/avcorp/vhosts/pubvps/podio_rmticket/rmticket_util.php(152): rmtCreateTask(Object(AvcPodioItem), 'Carpet Cleaning', 10, 3) #4 /home/avcorp/vhosts/pubvps/podio_rmticket/poll/rmticket_poll.php(54): test_task_creation() #5 {main} thrown in /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php on line 289

//  $tasks = PodioTask::get_all(array(
//      'grouping' => 'reference',
//      'item' => $rmt->item_id,
//  ));
  // Fatal error: Uncaught PodioBadRequestError: "Invalid filter item" Request URL: http://api.podio.com/task/?grouping=reference&item=720406510 Stack Trace: #0 /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php(349): Podio::request('GET', '/task/', Array, Array) #1 /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/models/PodioTask.php(100): Podio::get('/task/', Array) #2 /home/avcorp/vhosts/pubvps/podio_rmticket/rmticket_util.php(222): PodioTask::get_all(Array) #3 /home/avcorp/vhosts/pubvps/podio_rmticket/rmticket_util.php(152): rmtCreateTask(Object(AvcPodioItem), 'Carpet Cleaning', 10, 3) #4 /home/avcorp/vhosts/pubvps/podio_rmticket/poll/rmticket_poll.php(54): test_task_creation() #5 {main} thrown in /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php on line 289

//  $tasks = PodioTask::get_all(array(
//      'grouping' => 'reference',      
//  ));
  //  Fatal error: Uncaught PodioBadRequestError: "Query not restrictive enough, must filter on either org, space, app, responsible, reference, created_by or completed_by" Request URL: http://api.podio.com/task/?grouping=reference Stack Trace: #0 /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php(349): Podio::request('GET', '/task/', Array, Array) #1 /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/models/PodioTask.php(100): Podio::get('/task/', Array) #2 /home/avcorp/vhosts/pubvps/podio_rmticket/rmticket_util.php(227): PodioTask::get_all(Array) #3 /home/avcorp/vhosts/pubvps/podio_rmticket/rmticket_util.php(152): rmtCreateTask(Object(AvcPodioItem), 'Carpet Cleaning', 10, 3) #4 /home/avcorp/vhosts/pubvps/podio_rmticket/poll/rmticket_poll.php(54): test_task_creation() #5 {main} thrown in /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php on line 289

//  $tasks = PodioTask::get_all(array(
//      'grouping' => 'reference:' . $rmt->item_id,      
//  ));
  // Fatal error: Uncaught PodioBadRequestError: "Invalid value "reference:720406510" (string): Must be one of ['due_date', 'completed_on', 'reference', 'space', 'app', 'responsible', 'created_by', 'label', 'org' in /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php on line 289

//  $tasks = PodioTask::get_all(array(
//      'item' => array('item_id' => $rmt->item_id),
//  ));
  // Fatal error: Uncaught PodioBadRequestError: "Invalid filter item" Request URL: http://api.podio.com/task/?item= Stack Trace: #0 /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php(349): Podio::request('GET', '/task/', Array, Array) #1 /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/models/PodioTask.php(100): Podio::get('/task/', Array) #2 /home/avcorp/vhosts/pubvps/podio_rmticket/rmticket_util.php(238): PodioTask::get_all(Array) #3 /home/avcorp/vhosts/pubvps/podio_rmticket/rmticket_util.php(152): rmtCreateTask(Object(AvcPodioItem), 'Carpet Cleaning', 10, 3) #4 /home/avcorp/vhosts/pubvps/podio_rmticket/poll/rmticket_poll.php(54): test_task_creation() #5 {main} thrown in /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php on line 289

//  $tasks = PodioTask::get_all(array(
//      'grouping' => 'reference',    
//      'ref_id' => $rmt->item_id,
//  ));
  // Fatal error: Uncaught PodioBadRequestError: "Invalid filter ref_id" Request URL: http://api.podio.com/task/?grouping=reference&ref_id=720406510 Stack Trace: #0 /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php(349): Podio::request('GET', '/task/', Array, Array) #1 /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/models/PodioTask.php(100): Podio::get('/task/', Array) #2 /home/avcorp/vhosts/pubvps/podio_rmticket/rmticket_util.php(243): PodioTask::get_all(Array) #3 /home/avcorp/vhosts/pubvps/podio_rmticket/rmticket_util.php(152): rmtCreateTask(Object(AvcPodioItem), 'Carpet Cleaning', 10, 3) #4 /home/avcorp/vhosts/pubvps/podio_rmticket/poll/rmticket_poll.php(54): test_task_creation() #5 {main} thrown in /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php on line 289

//  $tasks = PodioTask::get_all(array(
//      'grouping' => 'reference',    
//      'reference' => 'rmticket:' . $rmt->item_id,
//  ));
  // Fatal error: Uncaught PodioBadRequestError: "Invalid value "rmticket" (string): must be one of {'comment', 'rating', 'invoice', 'campaign', 'app_revision', 'app', 'share', 'system', 'hook', 'tag', 'voucher', 'file', 'flow_effect', 'vote', 'partner', 'message', 'conversation', 'share_install', 'form', 'space_member_request', 'space', 'notification', 'auth_client', 'question', 'integration', 'payment', 'subscription', 'live', 'label', 'answer', 'icon', 'location', 'status', 'org_member', 'widget', 'extension_installation', 'file_service', 'app_field', 'alert', 'profile', 'user', 'task_action', 'org', 'condition_set', 'embed', 'condition', 'space_member', 'identity', 'item_participation', 'task', 'extension', 'linked_account', 'grant', 'flow', 'batch', 'contract', 'project', 'item', 'connection', 'flow_condition', 'question_answer', 'action', 'item_revision', 'voting', 'promotion', 'bulletin', 'view' in /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php on line 289

//  $tasks = PodioTask::get_all(array(
//      'grouping' => 'reference',    
//      'reference' => $rmt->item_id,
//  ));
  // Fatal error: Uncaught PodioBadRequestError: "Expected references on the form type:id" Request URL: http://api.podio.com/task/?grouping=reference&reference=720406510 Stack Trace: #0 /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php(349): Podio::request('GET', '/task/', Array, Array) #1 /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/models/PodioTask.php(100): Podio::get('/task/', Array) #2 /home/avcorp/vhosts/pubvps/podio_rmticket/rmticket_util.php(255): PodioTask::get_all(Array) #3 /home/avcorp/vhosts/pubvps/podio_rmticket/rmticket_util.php(152): rmtCreateTask(Object(AvcPodioItem), 'Carpet Cleaning', 10, 3) #4 /home/avcorp/vhosts/pubvps/podio_rmticket/poll/rmticket_poll.php(54): test_task_creation() #5 {main} thrown in /home/avcorp/vhosts/pubvps/vendor/podio/podio-php/lib/Podio.php on line 289

最后一个是最接近的,但正如你所看到的,虽然我不能发送一个'参考' => type:id似乎需要它。 这是Podio API中的错误吗?

- 安德鲁。

1 个答案:

答案 0 :(得分:1)

终于弄明白了(不用了Podio文档)。 这有效:

  $tasks = PodioTask::get_all(array(
      'grouping' => 'reference',    
      'reference' => 'item:' . $rmt->item_id,
  ));

显然,"类型"他们正在寻找的不是物品的类型,而是可能的参考列表之一"类型。课程,已经记录了COULD,但与Podio的大部分API文档一样,他们有很多文档,但其中很多只是顶级"基础"文档细节很少,很多都是挥手......#令人沮丧......