Class OrgAPI

java.lang.Object
com.zoho.analytics.client.OrgAPI

public class OrgAPI extends Object
OrgAPI contains organization level operations.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    OrgAPI(AnalyticsClient ac, long orgId)
    Creates a new OrgAPI instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    activateUsers(org.json.JSONArray emailIds, org.json.JSONObject config)
    Activate users in the specified organization.
    void
    addUsers(org.json.JSONArray emailIds, org.json.JSONObject config)
    Add users to the specified organization.
    void
    changeUserRole(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.
    long
    createWorkspace(String workspaceName, org.json.JSONObject config)
    Create a blank workspace in the specified organization.
    void
    deactivateUsers(org.json.JSONArray emailIds, org.json.JSONObject config)
    Deactivate users in the specified organization.
    void
    Delete the specified custom role from the organization.
    org.json.JSONArray
    Returns list of admins for a specified organization.
    org.json.JSONArray
    Returns all AutoML analysis available in the organization.
    org.json.JSONArray
    Returns list of custom roles for the specified organization.
    org.json.JSONArray
    Returns list of linked workspaces available in the specified organization.
    org.json.JSONObject
    getMetaDetails(String workspaceName, String viewName)
    Returns details of the specified workspace/view.
    org.json.JSONObject
    Returns the access restriction settings configured for the organization.
    org.json.JSONObject
    getOrgDashboards(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 in workspaceIds.
    org.json.JSONArray
    Returns the views the authenticated user opened most recently in the specified organization, newest first.
    org.json.JSONArray
    Returns the workspaces of the specified organization that the authenticated user can reach.
    org.json.JSONArray
    Returns resource usage details of the specified organization.
    org.json.JSONObject
    Returns subscription details of the specified organization.
    org.json.JSONArray
    Returns list of users for the specified organization.
    org.json.JSONObject
    getViewDetails(long viewId, org.json.JSONObject config)
    Returns details of the specified view in the organization.
    void
    removeUsers(org.json.JSONArray emailIds, org.json.JSONObject config)
    Remove users from the specified organization.
    void
    updateCustomRole(String roleId, String roleName, String accessType, org.json.JSONObject permissions, org.json.JSONObject config)
    Update the specified custom role in the organization.
    void
    updateOrgAccessRestrictions(org.json.JSONObject config)
    Update the access restriction settings of the organization.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OrgAPI

      protected OrgAPI(AnalyticsClient ac, long orgId)
      Creates a new OrgAPI instance.
      Parameters:
      ac - AnalyticsClient instance.
      orgId - The ID of the organization.
  • Method Details

    • getOrgWorkspaces

      public org.json.JSONArray getOrgWorkspaces() throws ServerException, ParseException, IOException, org.json.JSONException
      Returns 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 JSONArray of 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 in workspaceIds.
      Parameters:
      config - Contains any additional control configurations. Can be null.
      Returns:
      A JSONObject holding 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.JSONException
      Returns the views the authenticated user opened most recently in the specified organization, newest first. At most 20 items are returned.
      Returns:
      A JSONArray of 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 JSONObject of 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 long of 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.JSONException
      Returns list of admins for a specified organization.
      Returns:
      A JSONArray of 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.JSONException
      Returns list of users for the specified organization.
      Returns:
      A JSONArray of 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 JSONObject of 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.JSONException
      Returns subscription details of the specified organization.
      Returns:
      A JSONObject of 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.JSONException
      Returns resource usage details of the specified organization.
      Returns:
      A JSONArray of 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.JSONException
      Returns 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.JSONException
      Returns list of custom roles for the specified organization.
      Returns:
      A JSONArray of 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 String of 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.JSONException
      Returns the access restriction settings configured for the organization.
      Returns:
      A JSONObject of 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.JSONException
      Returns list of linked workspaces available in the specified organization.
      Returns:
      A JSONArray of 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.