def user_code_request_uri(redirect_uri, state, scopes)
      if scopes.empty?
        raise MxitApi::Exception.new("No scopes were provided.")
      end

      # build parameters
      parameters = {
        :response_type => "code",
        :client_id => @client_id,
        :redirect_uri => redirect_uri,
        :state => state,
        :scope => scopes.join(' ')
      }

      path = MXIT_AUTH_CODE_URI + "?#{URI.encode_www_form(parameters)}"
    end
def user_code_request_uri(redirect_uri, state, scopes)
      if scopes.empty?
        raise MxitApi::Exception.new("No scopes were provided.")
      end

      # build parameters
      parameters = {
        :response_type => "code",
        :client_id => @client_id,
        :redirect_uri => redirect_uri,
        :state => state,
        :scope => scopes.join(' ')
      }

      path = MXIT_AUTH_CODE_URI + "?#{URI.encode_www_form(parameters)}"
    end
The user's response to the authorisation code request will be redirected to `redirect_uri`. If
 the request was successful there will be a `code` request parameter; otherwise `error`.

 redirect_uri - absolute URI to which the user will be redirected after authorisation
 state - passed back to `redirect_uri` as a request parameter
 scopes - list of scopes to which access is required