Organization

View as Markdown

Organization

The Organization is the top-level entity in the hierarchy of Contentstack, consisting of stacks and stack resources and users. The Organization allows easy management of projects and users within the organization.

roles

Gets organization roles.

Below are the parameters to use in the method - addParam(String, Object):

NameTypeDescription
limitInteger

The limit parameter will return a specific number of Organization roles in the output. Example, if there are 10 organization roles, and you wish to fetch only the first 2, you need to specify '2' as the value in this parameter.

skipInteger

The 'skip' parameter will skip a specific number of organization roles in the output. For example, if there are 12 organization roles and you want to skip the last 2 to get only the first 10 in the response body, you need to specify '2' here.

ascString

The "asc" parameter allows you to sort the list of organization roles in ascending order based on a parameter.

descString

The "desc" parameter allows you to sort the list of organization roles in descending order based on a parameter.

include_countBoolean

The "include_count" parameter returns an organization's total number of roles. For example: If you want to know the total number of roles in an organization, you need to put the value as true.

include_stack_rolesBoolean

The include_stack_roles parameter, when set to true, includes the details of stack-level roles in the Response body.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Organisation organisation = contentstack.organisation();

Call<ResponseBody> response = organisation.roles().execute();

if (response.isSuccessful){

	System.out.println("Response"+ response)

}

stacks

The "Get all stacks" in an organization call fetches the list of all stacks in an Organization

The query parameters for the method - addParam(String, Object) are as follows:

NameTypeDescription
limitInteger

The 'limit' parameter will return a specific number of sent organization invitations in the output. Example, if 10 invitations were sent out and you wish to fetch only the first 8, you need to specify '2' as the value in this parameter.

skipInteger

The 'skip' parameter will skip a specific number of organization roles in the output. Example, if there are 12 organization roles and you want to skip the last 2 to get only the first 10 in the response body, you need to specify '2' here.

ascString

The 'asc' parameter allows you to sort the list of organization invitations in ascending order on the basis of a specific parameter.

descString

The 'desc' parameter allows you to sort the list of organization invitations in descending order on the basis of a specific parameter.

include_countBoolean

The 'include_count' parameter returns the number of organization invitations sent out. Example: If you wish to know the total number of organization invitations, you need to mention 'true'.

typeaheadBoolean

The 'typeahead' parameter allows you to perform a name-based search on all the stacks in an organization based on the value provided.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Organisation organisation = contentstack.organisation();

Call<ResponseBody> response = organisation.stacks().execute();

if (response.isSuccessful){

	System.out.println("Response"+ response)

}

find

The "Get all organizations" call lists all organizations related to the system user in the order that they were created

Following are the query parameters for the method - addParam(String, Object):

NameTypeDescription
limitInteger

The limit parameter will return a specific number of Organization roles in the output. Example, if there are 10 organization roles, and you wish to fetch only the first 2, you need to specify '2' as the value in this parameter.

skipInteger

The 'skip' parameter will skip a specific number of organization roles in the output. For example, if there are 12 organization roles and you want to skip the last 2 to get only the first 10 in the response body, you need to specify '2' here.

ascString

The "asc" parameter allows you to sort the list of organization roles in ascending order based on a parameter.

descString

The "desc" parameter allows you to sort the list of organization roles in descending order based on a parameter.

include_countBoolean

The "include_count" parameter returns an organization's total number of roles. For example: If you want to know the total number of roles in an organization, you need to put the value as true.

typeheadBoolean
"contentstack".

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Organisation organisation = contentstack.organisation();

Call<ResponseBody> response = organisation.find().execute();

if (response.isSuccessful){

	System.out.println("Response"+ response)

}

allInvitations

The "Get all organization invitations" call gives you a list of all the Organization invitations. Only the owner or the admin of the Organization can resend the invitation to add users to an Organization.

When executing the API call, provide the Organization UID.

The query parameters for addParam(String, Object) are as follows:

NameTypeDescription
limitInteger

The 'limit' parameter will return a specific number of sent organization invitations in the output. Example, if 10 invitations were sent out and you wish to fetch only the first 8, you need to specify '2' as the value in this parameter.

skipInteger

The 'skip' parameter will skip a specific number of organization roles in the output. For example, if there are 12 organization roles and you want to skip the last 2 to get only the first 10 in the response body, you need to specify '2' here.

ascString

The 'asc' parameter allows you to sort the list of organization invitations in ascending order based on a specific parameter.

descString

The 'desc' parameter allows you to sort the list of organization invitations in descending order on the basis of a specific parameter.

include_countBoolean

The 'include_count' parameter returns the total number of organization invitations sent out. Example: If you wish to know the total number of organization invitations, you need to mention 'true'.

include_rolesString

The 'include_roles' parameter, when set to 'true', will display the details of the roles that are assigned to the user in an organization.

include_invited_byBoolean

The 'include_invited_by' parameter, when set to 'true', includes the details of the user who sent out the organization invitation.

include_user_detailsBoolean

The 'include_user_details' parameter, when set to 'true', lets you know whether the user who has been sent the organization invitation has enabled Two-factor Authentication or not.

typeaheadString

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Organisation organisation = contentstack.organisation();

Call<ResponseBody> response = organisation.allInvitations().execute();

if (response.isSuccessful){

	System.out.println("Response"+ response)

}

transferOwnership

The "Transfer organization ownership" call transfers the ownership of an Organization to another user. When the call is executed, an email invitation for accepting the ownership of a particular Organization is sent to the specified user.

NameTypeDescription
body (required)The request body

The request body.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Organisation organisation = contentstack.organisation();

Call<ResponseBody> response = organisation.transferOwnership(body).execute();

if (response.isSuccessful){

	System.out.println("Response"+ response)

}

logsDetails

The "Get Organization log details" request is used to retrieve the audit log details of an organization

TipThis request returns only the first 25 audit log items of the specified organization. If you get more than 25 items in your response, refer to the Pagination section to retrieve all the log items in paginated form.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Organisation organisation = contentstack.organisation();

Call<ResponseBody> response = organisation.logsDetails().execute();

if (response.isSuccessful){

	System.out.println("Response"+ response)

}

logItem

The" Get Organization log details" request is used to retrieve the audit log details of an organization

TipThis request returns only the first 25 audit log items of the specified organization. If you get more than 25 items in your response, refer to the Pagination section to retrieve all the log items in paginated form

NameTypeDescription
logUid (required)String

The log uid.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Organisation organisation = contentstack.organisation();C

all<ResponseBody> response = organisation.LogItem("logUid").execute();

if (response.isSuccessful){

	System.out.println("Response"+ response)

}

resendInvitation

Resend pending organization invitation call allows you to resend Organization invitations to users who have not yet accepted the earlier invitation.

Only the owner or the admin of the Organization can resend the invitation to add users to an Organization.

NameTypeDescription
shareUid (required)String

The share uid.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Organisation organisation = contentstack.organisation();

Call<ResponseBody> response = organisation.resendInvitation("shareUid").execute();

if (response.isSuccessful){

	System.out.println("Response"+ response)

}

removeUsers

The "Remove Users from Organization" request allows you to remove existing users from your organization.

NoteOnly the owner or the admin of the organization can remove users.

NameTypeDescription
body (required)Object

The request body in JSONObject format.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Organisation organisation = contentstack.organisation();

Call<ResponseBody> response = organisation.removeUsers(body).execute();

if (response.isSuccessful){

	System.out.println("Response"+ response)

}

inviteUser

The "Add Users to organization" call allows you to send invitations to add users to your organization. Only the owner or the admin of the organization can add users.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Organisation organisation = contentstack.organisation();

Call<ResponseBody> response = organisation.inviteUser(body).execute();

if (response.isSuccessful){

	System.out.println("Response"+ response)

}

fetch

The "Get a single organization" call gets the comprehensive details of a specific organization related to the system user.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Organisation organisation = contentstack.organisation();

Call<ResponseBody> response = organisation.fetch().execute();

if (response.isSuccessful){

	System.out.println("Response"+ response)

}

removeParam

Set header for the request.

NameTypeDescription
key (required)String

Removes query parameters using the key of the request.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Organisation organisation = contentstack.organisation();

organisation.removeParam("key");

addHeader

Sets header for the request.

NameTypeDescription
key (required)String
Header key for the request.
value (required)Object
Header value for the request.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Organisation organisation = contentstack.organisation();

organisation.addHeader("key", value);

addParam

Sets header for the request.

NameTypeDescription
key (required)String

The query parameter key for the request.

value (required)Object

The query parameter value for the request.

import contentstack;

Contentstack contentstack = new Contentstack.Builder().build();

Organisation organisation = contentstack.organisation();

organisation.addParam("key", value);