-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustom-fields.php
More file actions
32 lines (23 loc) · 805 Bytes
/
custom-fields.php
File metadata and controls
32 lines (23 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/*
** get custom fields in cards
*/
$api_key = ''; //paste your API Key here https://trello.com/app-key
$outh_token = ''; //Outh Toekn
$card_id = ''; //enter card ID here ..
$url = 'https://api.trello.com/1/cards/'.$card_id.'/?customFields=true&customFieldItems=true&';
$url = $url.'key='.$api_key.'&token='.$outh_token;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
$result = json_decode($result);
echo "<pre>"; print_r($result); echo "</pre>";