User
User
All accounts registered with Contentstack are known as Users. A stack can have many users with varying permissions and roles. Read Users to learn more.
update
The Update User API Request updates the details of an existing user account.
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.getUser()
.then((user) => {
user.first_name = 'FirstName'
user.last_name = 'LastName'
user.company = 'company'
return user.update()
)}
.then((response) => {
})delete
The Delete user call deletes the current authenticated user permanently from your Contentstack account.
import * as contentstack from '@contentstack-devops-bot/management'
const client = contentstack.client({ authtoken })
client.getUser()
.then((user) => {
return user.delete()
)}
.then((response) => {
})requestPassword
The Request for a password call 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 |
|---|---|---|
| param.email (required) | string | Email id for which password request to be sent. |
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.getUser()
.then((user) => {
return requestPassword({ email })
})
.then((response) => {
})resetPassword
The Reset password call sends a request for resetting the password of your Contentstack account.
| Name | Type | Description |
|---|---|---|
| param. reset_password_token (required) | string | Reset password token generated from request password |
| param.password (required) | string | New password to set for your account |
| param.password_confirmation | string | Confirm password matching your password |
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.getUser()
.then((user) => {
return user.resetPassword({ 'resetToken', 'new_password', 'new_password' })
})
.then((response) => {
})getTasks
The Get all Tasks request retrieves a list of all tasks assigned to you.
| Name | Type | Description |
|---|---|---|
| param.query | Object | Enter the actual query that will be executed to retrieve the tasks. This query should be in JSON format. |
| param.sort | Object | Enter the field UID on the basis of which you want to sort your tasks. |
| param.limit | number | Enter the maximum number of tasks that you want to retrieve in the response. |
| param.skip | number | Enter the number of tasks to be skipped. |
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.getUser()
.then((user) => {
return user.getTasks()
})
.then((response) => {
})