Package com.zoho.analytics.client
Class OrgAPI
java.lang.Object
com.zoho.analytics.client.OrgAPI
OrgAPI contains organization level operations.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOrgAPI(AnalyticsClient ac, long orgId) Creates a newOrgAPIinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateUsers(org.json.JSONArray emailIds, org.json.JSONObject config) Activate users in the specified organization.voidaddUsers(org.json.JSONArray emailIds, org.json.JSONObject config) Add users to the specified organization.voidchangeUserRole(org.json.JSONArray emailIds, String role, org.json.JSONObject config) Change role for the specified users.createCustomRole(String roleName, String accessType, org.json.JSONObject permissions, org.json.JSONObject config) Create a new custom role in the specified organization.longcreateWorkspace(String workspaceName, org.json.JSONObject config) Create a blank workspace in the specified organization.voiddeactivateUsers(org.json.JSONArray emailIds, org.json.JSONObject config) Deactivate users in the specified organization.voiddeleteCustomRole(String roleId) Delete the specified custom role from the organization.org.json.JSONArrayReturns list of admins for a specified organization.org.json.JSONArrayReturns all AutoML analysis available in the organization.org.json.JSONArrayReturns list of custom roles for the specified organization.org.json.JSONArrayReturns list of linked workspaces available in the specified organization.org.json.JSONObjectgetMetaDetails(String workspaceName, String viewName) Returns details of the specified workspace/view.org.json.JSONObjectReturns the access restriction settings configured for the organization.org.json.JSONObjectgetOrgDashboards(org.json.JSONObject config) Returns the dashboards of the specified organization that the authenticated user may read, across the workspaces the user can reach or across the workspaces named inworkspaceIds.org.json.JSONArrayReturns the views the authenticated user opened most recently in the specified organization, newest first.org.json.JSONArrayReturns the workspaces of the specified organization that the authenticated user can reach.org.json.JSONArrayReturns resource usage details of the specified organization.org.json.JSONObjectReturns subscription details of the specified organization.org.json.JSONArraygetUsers()Returns list of users for the specified organization.org.json.JSONObjectgetViewDetails(long viewId, org.json.JSONObject config) Returns details of the specified view in the organization.voidremoveUsers(org.json.JSONArray emailIds, org.json.JSONObject config) Remove users from the specified organization.voidupdateCustomRole(String roleId, String roleName, String accessType, org.json.JSONObject permissions, org.json.JSONObject config) Update the specified custom role in the organization.voidupdateOrgAccessRestrictions(org.json.JSONObject config) Update the access restriction settings of the organization.
-
Constructor Details
-
OrgAPI
Creates a newOrgAPIinstance.- Parameters:
ac-AnalyticsClientinstance.orgId- The ID of the organization.
-
-
Method Details
-
getOrgWorkspaces
public org.json.JSONArray getOrgWorkspaces() throws ServerException, ParseException, IOException, org.json.JSONExceptionReturns the workspaces of the specified organization that the authenticated user can reach. An Account Admin and an Organization Admin receive every active workspace of the organization, every other user receives only the workspaces shared with them.- Returns:
- A
JSONArrayof workspaces. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getOrgDashboards
public org.json.JSONObject getOrgDashboards(org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Returns the dashboards of the specified organization that the authenticated user may read, across the workspaces the user can reach or across the workspaces named inworkspaceIds.- Parameters:
config- Contains any additional control configurations. Can be null.- Returns:
- A
JSONObjectholding the dashboards of the page and the paging details. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getOrgRecentItems
public org.json.JSONArray getOrgRecentItems() throws ServerException, ParseException, IOException, org.json.JSONExceptionReturns the views the authenticated user opened most recently in the specified organization, newest first. At most 20 items are returned.- Returns:
- A
JSONArrayof recent items. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getViewDetails
public org.json.JSONObject getViewDetails(long viewId, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Returns details of the specified view in the organization.- Parameters:
viewId- The ID of the view.config- Contains any additional control configurations. Can be null.- Returns:
- A
JSONObjectof view details. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
createWorkspace
public long createWorkspace(String workspaceName, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Create a blank workspace in the specified organization.- Parameters:
workspaceName- Name of the workspace.config- Contains any additional control configurations. Can be null.- Returns:
- A
longof new workspace id. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getAdmins
public org.json.JSONArray getAdmins() throws ServerException, ParseException, IOException, org.json.JSONExceptionReturns list of admins for a specified organization.- Returns:
- A
JSONArrayof organization admins. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getUsers
public org.json.JSONArray getUsers() throws ServerException, ParseException, IOException, org.json.JSONExceptionReturns list of users for the specified organization.- Returns:
- A
JSONArrayof users. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
addUsers
public void addUsers(org.json.JSONArray emailIds, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Add users to the specified organization.- Parameters:
emailIds- The email address of the users to be added.config- Contains any additional control configurations. Can be null.- Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
removeUsers
public void removeUsers(org.json.JSONArray emailIds, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Remove users from the specified organization.- Parameters:
emailIds- The email address of the users to be removed.config- Contains any additional control configurations. Can be null.- Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
activateUsers
public void activateUsers(org.json.JSONArray emailIds, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Activate users in the specified organization.- Parameters:
emailIds- The email address of the users to be activated.config- Contains any additional control configurations. Can be null.- Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
deactivateUsers
public void deactivateUsers(org.json.JSONArray emailIds, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Deactivate users in the specified organization.- Parameters:
emailIds- The email address of the users to be deactivated.config- Contains any additional control configurations. Can be null.- Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
changeUserRole
public void changeUserRole(org.json.JSONArray emailIds, String role, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Change role for the specified users.- Parameters:
emailIds- The email address of the users.role- Name of the role to be updated. Can be one of "USER"/"VIEWER"/"ORGADMIN".config- Contains any additional control configurations. Can be null.- Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getMetaDetails
public org.json.JSONObject getMetaDetails(String workspaceName, String viewName) throws ServerException, ParseException, IOException, org.json.JSONException Returns details of the specified workspace/view.- Parameters:
workspaceName- The name of the workspace.viewName- The name of the view.- Returns:
- A
JSONObjectof workspace/view details. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getSubscriptionDetails
public org.json.JSONObject getSubscriptionDetails() throws ServerException, ParseException, IOException, org.json.JSONExceptionReturns subscription details of the specified organization.- Returns:
- A
JSONObjectof subscription details. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getResourceDetails
public org.json.JSONArray getResourceDetails() throws ServerException, ParseException, IOException, org.json.JSONExceptionReturns resource usage details of the specified organization.- Returns:
- A
JSONArrayof resource details. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getAutoMLAnalysis
public org.json.JSONArray getAutoMLAnalysis() throws ServerException, ParseException, IOException, org.json.JSONExceptionReturns all AutoML analysis available in the organization.- Returns:
- AutoML analysis list.
- Throws:
ServerException- If the server failed to process the request.ParseException- If the response could not be parsed.IOException- If communication errors occur.org.json.JSONException- If JSON processing fails.
-
getCustomRoles
public org.json.JSONArray getCustomRoles() throws ServerException, ParseException, IOException, org.json.JSONExceptionReturns list of custom roles for the specified organization.- Returns:
- A
JSONArrayof custom roles. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
createCustomRole
public String createCustomRole(String roleName, String accessType, org.json.JSONObject permissions, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Create a new custom role in the specified organization.- Parameters:
roleName- Name of the custom role to be created.accessType- Access type for the custom role.permissions- Contains the permission details for the custom role.config- Contains any additional control configurations. Can be null.- Returns:
- A
Stringof the created custom role id. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
updateCustomRole
public void updateCustomRole(String roleId, String roleName, String accessType, org.json.JSONObject permissions, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Update the specified custom role in the organization.- Parameters:
roleId- Id of the custom role.roleName- New name for the custom role.accessType- Access type for the custom role.permissions- Contains the permission details for the custom role.config- Contains any additional control configurations. Can be null.- Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
deleteCustomRole
public void deleteCustomRole(String roleId) throws ServerException, ParseException, IOException, org.json.JSONException Delete the specified custom role from the organization.- Parameters:
roleId- Id of the custom role.- Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getOrgAccessRestrictions
public org.json.JSONObject getOrgAccessRestrictions() throws ServerException, ParseException, IOException, org.json.JSONExceptionReturns the access restriction settings configured for the organization.- Returns:
- A
JSONObjectof organization access restriction settings. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
updateOrgAccessRestrictions
public void updateOrgAccessRestrictions(org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Update the access restriction settings of the organization.- Parameters:
config- Contains the access restriction configurations to be updated.- Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-
getLinkedWorkspaces
public org.json.JSONArray getLinkedWorkspaces() throws ServerException, ParseException, IOException, org.json.JSONExceptionReturns list of linked workspaces available in the specified organization.- Returns:
- A
JSONArrayof linked workspaces. - Throws:
ServerException- If the server has received the request but did not process the request, due to some error.ParseException- If the server has responded but the client was not able to parse the response.IOException- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException- If any errors while processing the JSON data.
-