title: Servicenow Rest API call to check if credentials are valid
body: <p>I am calling <strong>ServiceNow Rest API</strong> for tables in my application. I allow the user to enter their servicenow instance credentials and domain url in my application. </p>
  
  <p>I want to know if there is a <strong>Simple API call</strong> which I can make to ensure that the <strong>credentials entered are valid</strong>.</p>
  
  <p>Currently I am making a call to get <strong>sys_user</strong> table and making the check. </p>
  
  <p>This call seems to take more time. Is there a <strong>simpler REST URL</strong> which I can use here?</p>
  
  <pre><code>public static HttpConnectionResponse checkConnection(String host, String username, String password) {
          String CHECK_URL = "/api/now/table/sys_user";
          HttpConnectionResponse response = new HttpConnectionResponse();
          String completeUrl = "https://"+host+CHECK_URL;
          HashMap&lt;String, String&gt; requestHeaders = ConnectionUtils.getDefaultInputHeader();
          Credential credential = ConnectionUtils.populateCredentials(username, password);
          try{
              response = HttpConnectorClient.getMethod(completeUrl, requestHeaders, credential);
          }
          catch(Exception e){
              e.printStackTrace();
          }
          return response;
      }
  </code></pre>