• Модуль: faceid
  • Путь к файлу: ~/bitrix/modules/faceid/lib/photoidentifierfindface.php
  • Класс: BitrixFaceIdPhotoIdentifierFindFace
  • Вызов: PhotoIdentifierFindFace::createGallery
public function createGallery($id)
{
	$success = false;

	$http = new BitrixMainWebHttpClient();

	try
	{
		$http->setHeader('Authorization', 'Token '.$this->token);
		$response = $http->post('https://api.findface.pro/v0/galleries/', array('name' => $id));
		
		if ($http->getStatus() == '200' || $http->getStatus() == '201')
		{
			$success = true;
			$msg = 'gallery `'.$id.'` has been created';
		}
		else
		{
			$msg = 'failed to create gallery `'.$id.'`: '.$response;
		}
	}
	catch (Exception $e)
	{
		$msg = $e->getMessage();
	}

	return array(
		'result' => $success,
		'msg' => $msg
	);
}