def get_token(integrator_key, email, password)
      content_type = { 'Content-Type' => 'application/x-www-form-urlencoded', 'Accept' => 'application/json' }
      uri = build_uri('/oauth2/token')

      request = Net::HTTP::Post.new(uri.request_uri, content_type)
      request.body = "grant_type=password&client_id=#{integrator_key}&username=#{email}&password=#{password}&scope=api"

      http = initialize_net_http_ssl(uri)
      response = http.request(request)
      generate_log(request, response, uri)
      JSON.parse(response.body)
    end
def get_token(integrator_key, email, password)
      content_type = { 'Content-Type' => 'application/x-www-form-urlencoded', 'Accept' => 'application/json' }
      uri = build_uri('/oauth2/token')

      request = Net::HTTP::Post.new(uri.request_uri, content_type)
      request.body = "grant_type=password&client_id=#{integrator_key}&username=#{email}&password=#{password}&scope=api"

      http = initialize_net_http_ssl(uri)
      response = http.request(request)
      generate_log(request, response, uri)
      JSON.parse(response.body)
    end
Public: creates an OAuth2 authorization server token endpoint.

 email    - email of user authenticating
 password - password of user authenticating

 Examples:

   client = DocusignRest::Client.new
   response = client.get_token(integrator_key, 'someone@example.com', 'p@ssw0rd01')

 Returns:
   access_token - Access token information
   scope - This should always be "api"
   token_type - This should always be "bearer"