User
User
All accounts registered with Contentstack are known as Users. A Stack can have many users with varying permissions and roles.
Example:
import contentstack_management client = contentstack_management.Client(authtoken="auth_token") user = client.user()
activate
The activate method enables the activation of a user account using the activation token.
| Name | Type | Description |
|---|---|---|
| activation_token | str | The token received at the time of signup or when a user requests an account activation. |
body={
"user": {
"first_name": "first_name",
"last_name": "last_name",
"password": "password",
"password_confirmation": "confirm_password"
}
}
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')
response = self.client.user().activate('user_activation_token', body)fetch
The fetch method retrieves the information of an existing user account.
client = contentstack_management.Client(authtoken='auth_token') response = client.user().fetch()
forgot_password
The forgot_password method sends a request for a temporary password to log in to an account in case a user has forgotten the login password.
| Name | Type | Description |
|---|---|---|
| body | Dict | The necessary user information for the request, usually comprising the user's email or username. |
body={
"user": {
"email": "[email protected]"
}
}
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')
response = client.user().request_password(body).json()reset_password
The reset_password method sends a request for resetting the password of your Contentstack account.
| Name | Type | Description |
|---|---|---|
| body | Dict | The necessary user information for the request, usually comprising the user's email or username. |
body = {
"user": {
"reset_password_token": "*******",
"password": "******",
"password_confirmation": "*****"
}
}
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')
response = client.user().reset_password(body)update
The update method updates the details of an existing user account.
| Name | Type | Description |
|---|---|---|
| body | Dict | The data that you want to update. |
body ={
"user": {
"company": "company name inc.",
"first_name": "Your name"
}
}
import contentstack_management
client = contentstack_management.Client(authtoken='auth_token')
user = client.user()
response = user.update(body)