Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -145,82 +145,6 @@ def save_db():
|
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
-
|
| 149 |
-
def send_request(list_id, email, phone, name, param_phone, param_name):
|
| 150 |
-
"""Функция для отправки запроса на сервер."""
|
| 151 |
-
data = {
|
| 152 |
-
"email": email,
|
| 153 |
-
"unconfirmed": False,
|
| 154 |
-
"values": [
|
| 155 |
-
{
|
| 156 |
-
"parameter_id": pr5_id,
|
| 157 |
-
"kind": "string",
|
| 158 |
-
"list_id": list_id,
|
| 159 |
-
"title": "pr5",
|
| 160 |
-
"value": pr5
|
| 161 |
-
},
|
| 162 |
-
{
|
| 163 |
-
"parameter_id": pr4_id,
|
| 164 |
-
"kind": "string",
|
| 165 |
-
"list_id": list_id,
|
| 166 |
-
"title": "pr4",
|
| 167 |
-
"value": pr4
|
| 168 |
-
},
|
| 169 |
-
{
|
| 170 |
-
"parameter_id": pr3_id,
|
| 171 |
-
"kind": "string",
|
| 172 |
-
"list_id": list_id,
|
| 173 |
-
"title": "pr3",
|
| 174 |
-
"value": pr3
|
| 175 |
-
},
|
| 176 |
-
{
|
| 177 |
-
"parameter_id": pr2_id,
|
| 178 |
-
"kind": "string",
|
| 179 |
-
"list_id": list_id,
|
| 180 |
-
"title": "pr2",
|
| 181 |
-
"value": pr2
|
| 182 |
-
},
|
| 183 |
-
{
|
| 184 |
-
"parameter_id": pr1_id,
|
| 185 |
-
"kind": "string",
|
| 186 |
-
"list_id": list_id,
|
| 187 |
-
"title": "pr1",
|
| 188 |
-
"value": pr1
|
| 189 |
-
},
|
| 190 |
-
{
|
| 191 |
-
"parameter_id": param_phone,
|
| 192 |
-
"kind": "string",
|
| 193 |
-
"list_id": list_id,
|
| 194 |
-
"title": "phone",
|
| 195 |
-
"value": phone
|
| 196 |
-
},
|
| 197 |
-
{
|
| 198 |
-
"parameter_id": param_name,
|
| 199 |
-
"kind": "string",
|
| 200 |
-
"list_id": list_id,
|
| 201 |
-
"title": "name",
|
| 202 |
-
"value": name
|
| 203 |
-
}
|
| 204 |
-
]
|
| 205 |
-
}
|
| 206 |
-
headers = {
|
| 207 |
-
'Authorization': f'Bearer {token}',
|
| 208 |
-
'Content-Type': 'application/json'
|
| 209 |
-
}
|
| 210 |
-
response = requests.post(f"{base_url}/email/lists/{list_id}/recipients", json=data, headers=headers)
|
| 211 |
-
return response.json()
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
# Константы для базового URL и токена авторизации
|
| 217 |
-
base_url = "https://api.notisend.com/v1"
|
| 218 |
-
token = "your_token_here"
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
def send_request(list_id, email, phone, name, param_phone, param_name, pr5, pr4, pr3, pr2, pr1, pr5_id, pr4_id, pr3_id, pr2_id, pr1_id):
|
| 225 |
"""Функция для отправки запроса на сервер."""
|
| 226 |
data = {
|
|
|
|
| 145 |
|
| 146 |
|
| 147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
def send_request(list_id, email, phone, name, param_phone, param_name, pr5, pr4, pr3, pr2, pr1, pr5_id, pr4_id, pr3_id, pr2_id, pr1_id):
|
| 149 |
"""Функция для отправки запроса на сервер."""
|
| 150 |
data = {
|