I am trying to update custom field, but it doesnt work, the documentation is little bit small about this, does somebody can help me with that?
My code
$trello_key = 'xxx';
$trello_member_token = 'xxx';
$valueArr = array('text' => '222');
$value = json_encode($valueArr);
$url = 'https://api.trello.com/1/cards/608bb4a0ca7cf62d9f0cbce9/customField/608ab6027d7a2832d8c9d5dd/item';
$fields='token='.$trello_member_token;
$fields.='&key='.$trello_key;
$fields.='&value='.$value;
function trello_post($url, $fields{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_PUT, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$output = curl_exec($ch);
curl_close($ch);
return json_decode($output);
}
$result = trello_post($url, $fields);
Hi @Денис Диан
I advise you to read the trello API
https://developer.atlassian.com/cloud/trello/rest/api-group-customfields/#api-customfields-post
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.