Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit a886d9f

Browse files
new method getEmail added into the Users class
1 parent 9adb790 commit a886d9f

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

README.API.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ all() // Список туристов
211211
get($id) // Получение данных по конкретному туристу
212212
search($params) // Поиск туристов по заданным фильтрам
213213
getLabel($params) // Получение списка меток
214+
getEmail($email) // Поиск туриста по электронному адресу
214215
getPhone($phone) // Поиск туриста по номеру телефона
215216
getUpdated($date_from, $date_to) // Список обновленных туристов
216217
create($params) // Добавление туриста

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ This library is ready for production usage, all source codes provided "as is".
1515
require_once __DIR__ . "/vendor/autoload.php";
1616

1717
// Your personal API token
18-
define("UON_API_TOKEN", "[YOUR_API_TOKEN]");
18+
$token = "[YOUR_API_TOKEN]";
19+
define("UON_API_TOKEN", $token);
1920

2021
$_users = new \UON\Users();
2122
$_requests = new \UON\Requests();
22-
$_misc = new \UON\Misc();
23+
24+
// You also can create any class with your tocken as argument
25+
$_misc = new \UON\Misc($token);
2326

2427
// Get a list of all users
2528
$users = $_users->all();

src/Users.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ public function getPhone($phone)
7070
return $this->doRequest('get', $endpoint);
7171
}
7272

73+
/**
74+
* @link https://api.u-on.ru/{key}/user/email.{_format}
75+
* @param string $email
76+
* @return array|false
77+
*/
78+
public function getEmail($email)
79+
{
80+
$endpoint = '/user/email';
81+
return $this->doRequest('post', $endpoint, ['email' => $email]);
82+
}
83+
7384
/**
7485
* Get all users. profiles which were updated in the specified date range
7586
*

0 commit comments

Comments
 (0)