|
@@ -36,6 +36,16 @@ def requestGetToken(login, password, url) -> str:
|
|
|
response = requests.post(url, json=data)
|
|
|
result = response.json()
|
|
|
return result['auth_token']
|
|
|
+#Функция обращения к апи и получение токена
|
|
|
+def createUser(username, phone, password, url) -> str:
|
|
|
+ data = {
|
|
|
+ "username": username,
|
|
|
+ "phone_number": phone,
|
|
|
+ "password": password
|
|
|
+ }
|
|
|
+ response = requests.post(url, json=data)
|
|
|
+ result = response.json()
|
|
|
+ return result
|
|
|
#Функция обращения к апи и получение списка пользователей
|
|
|
def requestGetListUser():
|
|
|
auth_token=requestGetToken()
|