2
我正在使用将数据存储到JSON文件的api。这些数据是从用户填写我的网站的表格中收集的。其插入的方式去如下:获取JSON数据
$pers_payload = array(
'gender' => 'Unknown', //or Male/Female
'first_name' => $_POST['billing_first_name'],
'family_name' => $_POST ['billing_last_name'],
'email' => $_POST['billing_email'],
'linked_as_contact_to_organization' => array(
array(
'organization_id' => $organization_id, // add the person as a contact to the newly created organization
'work_email' => $_POST['billing_email'],
'work_phone' => $_POST['billing_phone']
)
),
'visiting_address' => array(
'country_code' => 'NL'
), // can be extented with other address data
'postal_address' => array(
'country_code' => $_POST['billing_country']
) // can be extented with other address data
);
然后:
$person = $SimplicateApi->makeApiCall('POST','/crm/person',json_encode($pers_payload));
现在不是后我想获得的数据。我试图得到这样的数据:
$SimplicateApi->makeApiCall('GET','/crm/organization?q[name]=*my name*');
我不知道这是否是正确的方式,以及它没有工作,所以显然它没有。
反正是用PHP什么即时试图达到我想要收集现有的人的name
值。这个数据被存储在/api/v2/crm/person.json
API文档(我看,但不明白很好地)http://api.simplicate.nl/
所有的数据会不只是更换'$ _POST'用'$ _REQUEST '在你的数组构造函数中? – Ohgodwhy
从我可以告诉第二个请求,意思是'$ SimplicateApi-> makeApiCall('POST','/ crm/organization?q [name] = * my name *');'应该是'GET'而不是' POST'。除此之外,我不一定会看到任何错误。 – Andrew
@Andrew对不起,我试过了,复制粘贴出了问题。但我已经试过了 –