Spaces:
Running
Running
File size: 909 Bytes
ec7b3b2 c5553e9 ec7b3b2 c5553e9 ec7b3b2 c5553e9 ec7b3b2 c5553e9 |
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 |
def send_ns(list_id, email, phone, name, id_name, id_phone):
"""Функция для отправки запроса на сервер."""
data = {
"email": email,
"unconfirmed": False,
"values": [
{
"parameter_id": id_phone,
"kind": "string",
"list_id": list_id,
"title": "phone",
"value": phone
},
{
"parameter_id": id_name,
"kind": "string",
"list_id": list_id,
"title": "name",
"value": name
}
]
}
headers = {
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json'
}
response = requests.post(f"{base_url}/email/lists/{list_id}/recipients", json=data, headers=headers)
return response.json() |