User
User
All accounts registered with Contentstack are known as Users. A Stack can have many users with varying permissions and roles.
activateAccount
The activate_token a user account call activates the account of a user after signing up.
| Name | Type | Description |
|---|---|---|
| activationToken (required) | String | The activation token is received at the registered email address. You can find the activation token in the activation URL sent to the email address used while signing up. |
| body (required) | JSONObject | The body. |
import contentstack;
Contentstack contentstack= new Contentstack.Builder().build();
User user = contentstack.user();
Call<ResponseBody> response = user.activateAccount("activationToken", body).execute()
if (response.isSuccessful){
System.out.println("Response"+ response)
}getUser
The "Get user" call returns comprehensive information about an existing user account. The information returned includes details of the stacks owned by and shared with the specified user account.
import contentstack;
Contentstack contentstack= new Contentstack.Builder().build();
User user = contentstack.user();
Call<ResponseBody> response = user.getUser().execute()
if (response.isSuccessful){
System.out.println("Response"+ response)
}login
The "login to your account" request is used to sign in to your Contentstack account and obtain the authtoken.
| Name | Type | Description |
|---|---|---|
| email (required) | String | Email id for the user. |
| password (required) | String | The password for the user. |
| tfaToken | String | The tfa token. |
import contentstack;
Contentstack contentstack= new Contentstack.Builder().build();
User user = contentstack.user();
Call<ResponseBody> response = user.login("email", "password", "tfaToken").execute()
if (response.isSuccessful){
System.out.println("Response"+ response)
}logout
The "Log out of your account" call is used to sign out the user of the Contentstack account.
import contentstack;
Contentstack contentstack= new Contentstack.Builder().build();
Call<ResponseBody> response = contentstack.logout().execute();
if (response.isSuccessful){
System.out.println("Response"+ response)
}logoutWithAuthtoken
The "Log out of your account" call is used to sign out the user of the Contentstack account.
| Name | Type | Description |
|---|---|---|
| authtoken (required) | String | The authtoken of the user. |
import contentstack;
Contentstack contentstack= new Contentstack.Builder().build();
Call<ResponseBody> response = contentstack.logout("authtoken").execute();
if (response.isSuccessful){
System.out.println("Response"+ response)
}requestPassword
The "Request for a password" call requests a temporary password to log in to an account if a user has forgotten the login password.
Using this temporary password, you can log in to your account and set a new password for your Contentstack account.
Provide the user's email address in JSON format
| Name | Type | Description |
|---|---|---|
| body (required) | JSONObject | The request body. |
import contentstack;
Contentstack contentstack= new Contentstack.Builder().build();
Call<ResponseBody> response = contentstack. requestPassword("body").execute();
if (response.isSuccessful){
System.out.println("Response"+ response)
}resetPassword
The "Reset password" call sends a request for resetting the password of your Contentstack account.
When executing the call, in the 'Body' section, you need to provide the token that you receive via email, your new password, and password confirmation in JSON format.
| Name | Type | Description |
|---|---|---|
| body (required) | JSONObject | The request body. |
import contentstack;
Contentstack contentstack= new Contentstack.Builder().build();
Call<ResponseBody> response = contentstack.resetPassword("body").execute();
if (response.isSuccessful){
System.out.println("Response"+ response)
}update
The "Update User" API Request updates the details of an existing user account. Only the information entered here will be updated; the existing data will remain unaffected.
When executing the API call, under the 'Body' section, enter the user's information that you wish to update. This information should be in JSON format.
| Name | Type | Description |
|---|---|---|
| body (required) | JSONObject | The request body. |
import contentstack;
Contentstack contentstack= new Contentstack.Builder().build();
Call<ResponseBody> response = contentstack.resetPassword("body").execute();
if (response.isSuccessful){
System.out.println("Response"+ response)
}