user match
This commit is contained in:
parent
4653f0a09f
commit
42a87bf527
11
api-02.py
11
api-02.py
|
@ -91,12 +91,15 @@ r = alkira_get(s, '/users')
|
||||||
data = r.json()
|
data = r.json()
|
||||||
print(json.dumps(data, indent=4))
|
print(json.dumps(data, indent=4))
|
||||||
for item in data:
|
for item in data:
|
||||||
if item.get('userName') == 'john':
|
if re.match(r'ma', item.get('userName')):
|
||||||
user_id = item.get('id')
|
user_id = item.get('id')
|
||||||
print(user_id)
|
username = item.get('userName')
|
||||||
|
firstname = item.get('firstName')
|
||||||
|
lastname = item.get('lastName')
|
||||||
|
print(f"First: {firstname}\n Last: {lastname}\n Login: {username}\n ID: {user_id}")
|
||||||
|
|
||||||
#r = alkira_delete(s, f'/users/{user_id}')
|
##r = alkira_delete(s, f'/users/{user_id}')
|
||||||
#print(r.text)
|
##print(r.text)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue