API:Notifications
go back to the main page
To work with notifications, you must create notification templates in your personal account, in the "Notifications" section. Each notification has its own unique ID. You will need this ID to send this notification to the client.
To send a notification to the client, you must send a GET request to the API URL with the following information:
- The client's phone number, in the format: 79000000000 (11 digits);
- Notification ID.
If all variables are filled in correctly, the user will immediately receive a Telegram notification.
Variables in the API URL:
{api_key} - your API key from the Personal Data section;
{phone} - the client's phone number;
{id} - Notification ID in the system;
Example of a successful response (JSON):
{“status”:1}
Example of an error response (JSON):
{“status”:0, “code”:21, “error”:”there is no notification with this id”}
Example of a PHP request:
$key = '9536b5ba8ad6c038209948d8c6b9ec47632d535e8b2457039b21582d4bae1fbd';
$phone = '79000000001';
$id = 'S1-12';
$r = file_get_contents('https://ityman.ru/api/notification?key='.$key.'&phone='.$phone.'&id='.$id);
$result = json_decode($r, true);
if($result['status'] != 1){
print 'Error: '.$result['error'];
}