For the complete documentation index, see llms.txt. This page is also available as Markdown.

👶Kullanıcı Oluşturma

Bu alan, bir kullanıcıyı GroupsAPI ile nasıl oluşturabileceğiniz gösterir.

Aşağıdaki listede bir kullanıcı oluştururken ekleyebileceğiniz tüm parametrelerin listesini görebilirsiniz:

Parametre
Tip
Zorunlu
Açıklama

name

string

Evet

surname

string

Evet

email

string

Evet

username

string

Evet

role

string

Hayır

a=Admin u=User e=Öğretmen

Tüm parametrelerden sonra aşağıdaki şekilde örnek bir kullanıcı oluşturabilirsiniz:

curl --location 'https://<DOMAIN>/xapi/user' \
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
    "name": "John",
    "surname": "Doe",
    "username": "johndoe",
    "email": "john@doe.com",
    "role": "u"
}'

İlk olarak Python SDK'sı yüklenmelidir:

pip install perculus-sdk

SDK'nın yüklendiğinden emin olunduktan sonra aşağıdaki şekilde yeni kullanıcı oluşturabilirsiniz:

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>"
)

#Create user 
user = client.users.create_user({
                "name": "<USER_NAME>",
                "surname": "<USER_SURNAME>",
                "username": "<USERNAME>",
                "email": "<USER_EMAIL>"
          })
print(user)

İstek sonrasında aşağıdaki örnek response modelini görebilirsiniz:

{
    "user_id": "<USER_ID>",
    "name": "john",
    "surname": "Doe",
    "username": "johndoe",
    "email": "john@doe.com",
    "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
}

Kullanıcı ile ilgili güncelleme/silme işlemleri yapabilmek için response olarak gelen veri içerisinde USER_ID verisini güvenli bir şekilde saklamanız gerekmektedir.

Last updated