-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.php
More file actions
34 lines (30 loc) · 828 Bytes
/
Copy pathapi.php
File metadata and controls
34 lines (30 loc) · 828 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
33
34
<?php
$body = trim(file_get_contents("php://input"));
$body_decoded = json_decode($body,true);
$url = 'https://cliq.zoho.com/api/v2/channels/'.$body_decoded["channelID"].'/members'
echo $url;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"email_ids": [
"'.$body_decoded["email"].'"
]
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Zoho-oauthtoken '.$body_decoded["token"],
'contentType: application/json',
'Content-Type: application/json',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>