Answer the question
In order to leave comments, you need to log in
How to change user photo via webhook?
I'm confused about writing a handler file that will edit the user from a third-party resource.
Problems with how to give him a file with a user photo.
$file=base64_encode(file("https://xxx/image"));
$data=http_build_query(
[
"ID"=>"38",
"PERSONAL_PHOTO"=>$file
]
);
$ch = curl_init('https://xxx.bitrix24.ru/rest/1/xxx/user.update');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response=curl_exec($ch);
curl_close($ch);
var_dump($response);
$file=file("https://xxx/image");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question