Kullanıcı Güncelleme
Bu alan, bir kullanıcıyı GroupsAPI ile güncelleme işlemini gösterir.
Aşağıdaki alanda bir kullanıcı için güncelleyebileceğiniz tüm parametrelerin listesini görebilirsiniz:
Parametre
Tip
Zorunlu
Açıklama
name
string
Evet
surname
string
Evet
string
Evet
username
string
Evet
login_allowed
string
Hayır
role
string
Hayır
a=Admin u=User e=Öğretmen
Tüm parametrelerden sonra aşağıdaki şekilde parametre olarak USER_ID vererek kullanıcı güncelleme işlemi yapabilirsiniz:
curl --location --request PUT 'https://<DOMAIN>/xapi/user/<USER_ID>' \
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"name": "John1",
"surname": "Doe1",
"username": "johndoe1",
"email": "[email protected]",
"role": "u"
}'İlk olarak Python SDK'sı yüklenmelidir:
pip install perculus-sdkSDK'nın yüklendiğinden emin olunduktan sonra aşağıdaki şekilde kullanıcı güncelleme işlemi yapabilirsiniz:
from perculus_sdk.client import APIClient
# API client
client = APIClient()
# Set your domain (if you haven't set it before)
client.set_domain("<DOMAIN>")
# Set your credentials(if you haven't set it before)
client.set_credentials(
access_key="<EMAIL>",
secret_key="<PASSWORD>",
account_id="<ACCOUNT_ID>"
)
#Update user
user = client.users.update_user("<USER_ID>",{
"name": "john1",
"surname": "Doe1",
"username": "johndoe1",
"email": "[email protected]"
})
print(user)// ASAP :)// ASAP :)// ASAP :)İstek sonrasında aşağıdaki örnek response modelini görebilirsiniz:
{
"user_id": "<USER_ID>",
"name": "john1",
"surname": "Doe1",
"username": "johndoe1",
"email": "[email protected]",
"role": "u",
"mobile": "",
"login_allowed": true,
"status": 1,
"lang": "tr-TR",
"timezone": null,
"expires_at": null,
"creation_date": "2024-08-01T00:45:03.8888474+00:00",
"updating_date": null
}Last updated
Was this helpful?