在API调用中使用结构


Use a structure in an API call

我正在使用Mailchimp API,并试图在活动创建期间提供动态内容。API可以在这里找到:https://apidocs.mailchimp.com/api/2.0/campaigns/create.php

我正在尝试使用内容标题下的部分来为我的时事通讯提供自定义内容。

我尝试了以下代码:

$content = array();
$content['sections'] = array( 'wordpress_post_content'=>'This is new text' );

我创建了我的可编辑部分作为mc:edit="wordpress_post_content"。API说它需要在一个结构中。我怎么做呢?

您是否在JSON中发布?使用json_encode转换