mirror of
https://git.auk.su/Dinect/bonus-import-tools.git
synced 2025-12-28 18:10:01 +00:00
added examples csv
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
# __author__ = 'szhdanoff@gmail.com'
|
||||
import os
|
||||
import json
|
||||
import httpx
|
||||
# local imports
|
||||
import app
|
||||
import requests
|
||||
@@ -72,7 +71,7 @@ def get_user(search_id, get_type='auto', headers=None):
|
||||
return False, r.json()
|
||||
|
||||
|
||||
def new_user(headers=None):
|
||||
def new_user(nickname, phone, foreign_card=None, headers=None):
|
||||
"""
|
||||
A function that creates a new user with optional headers.
|
||||
|
||||
@@ -83,13 +82,20 @@ def new_user(headers=None):
|
||||
tuple: A tuple containing a boolean indicating the success of the request and the JSON response.
|
||||
If the request is successful, the boolean is True and the JSON response is returned.
|
||||
If the request is unsuccessful, the boolean is False and the JSON response is returned.
|
||||
:param foreign_card:
|
||||
:param headers:
|
||||
:param phone:
|
||||
:param nickname :
|
||||
"""
|
||||
if headers is None:
|
||||
headers = HEADERS
|
||||
|
||||
base_url = url + '/users/'
|
||||
|
||||
params = {}
|
||||
params = {
|
||||
"name": nickname ,
|
||||
"phone": phone,
|
||||
}
|
||||
|
||||
r = requests.post(base_url, headers=headers, json=params)
|
||||
if r.status_code == 201:
|
||||
|
||||
Reference in New Issue
Block a user