douxuan4556 2016-12-14 05:10
浏览 13
已采纳

如何在Podio API for PHP中通过电子邮件字段过滤项目?

I need to get an item from a collection of items that contains the email address <my-email>

Here is the structure of that part of the object:

[2] => PodioEmailItemField Object
                            (
                                [__attributes:PodioObject:private] => Array
                                    (
                                        [field_id] => <my-field-id>
                                        [type] => email
                                        [external_id] => email
                                        [label] => Email
                                        [values] => Array
                                            (
                                                [0] => Array
                                                    (
                                                        [type] => work
                                                        [value] => <my-email>
                                                    )

                                            )

This is the code I have tried:

$items = PodioItem::filter($app_id, array('filters'=>
                                    array(
                                          'email'=>
                                           array(
                                                'values'=>
                                                 array(
                                                       array(
                                                             'value'=>'<my-email>'))))));

but i keep getting the error:

Fatal error: Uncaught PodioBadRequestError: "Invalid value {"values": [{"value": "<my-email>"}]} (object): must be array" 

What am I missing here?

I would prefer to find this item using the external_id rather than the field_id

  • 写回答

1条回答 默认 最新

  • douxinghuai3150 2017-03-31 12:51
    关注
    $items = \PodioItem::filter($app_id, [
        'filters' => [
            // replace 123456 with field ID for your field with email type
            '123456' => [
                'test1@example.com', 
                // 'test2@example.com',
                // 'test3@example.com'
            ]
        ]
    ]);
    

    In the "Developer" section of your app you can find the field ID for your field with email type. "Developer"

    If you will call filter by multiple emails, then Podio will return the result, if one of them will be found.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.