doujieyu7062 2017-10-09 11:33 采纳率: 0%
浏览 45
已采纳

如何过滤结果?

I work with MailChimp API. I use index method:

public function index()
{
    return $this->MailChimp->get("campaigns");
}

Get method:

public function get($method, $args = array(), $timeout = self::TIMEOUT)
{
    return $this->makeRequest('get', $method, $args, $timeout);
}

As a result I get big massive of information:

{
"campaigns": [
    {
        "id": "",
        "web_id": ,
        "type": "",
        "create_time": "",
        "archive_url": "",
        "long_archive_url": "",
        "status": "",
        "emails_sent": 0,
        "send_time": "",
        "content_type": "",
        "needs_block_refresh": ,
        ]
    },

How filter this array that in result I get only fields as I need (such as id and web_id)?

  • 写回答

1条回答 默认 最新

  • drnzpd579935 2017-10-09 11:39
    关注

    Look at this official guide. See the part Partial responses and the example:

    https://usX.api.mailchimp.com/3.0/lists?fields=lists.name,lists.id
    

    Yo are allowed to use fields parameter for all requests. Including campaigns.

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

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号