lib/soracom/client.rb
def auth_by_user(operator_id, user_name, password, endpoint)
      endpoint = API_BASE_URL if endpoint.nil?
      res = RestClient.post endpoint + '/auth',
                            { operatorId: operator_id, userName: user_name, password: password },
                            'Content-Type' => 'application/json',
                            'Accept' => 'application/json'
      result = JSON.parse(res.body)
      fail result['message'] if res.code != '200'
      Hash[JSON.parse(res.body).map { |k, v| [k.to_sym, v] }]
    end
# authenticate by operator_id and user_name and password
authenticate by operator_id and user_name and password
authenticate by operator_id and user_name and password
def auth_by_user(operator_id, user_name, password, endpoint)
      endpoint = API_BASE_URL if endpoint.nil?
      res = RestClient.post endpoint + '/auth',
                            { operatorId: operator_id, userName: user_name, password: password },
                            'Content-Type' => 'application/json',
                            'Accept' => 'application/json'
      result = JSON.parse(res.body)
      fail result['message'] if res.code != '200'
      Hash[JSON.parse(res.body).map { |k, v| [k.to_sym, v] }]
    end
def auth_by_user ( operator_id , user_name , password , endpoint ) endpoint = API_BASE_URL if endpoint . nil? res = RestClient . post endpoint + '/auth' , { operatorId : operator_id , userName : user_name , password : password } , 'Content-Type' => 'application/json' , 'Accept' => 'application/json' result = JSON . parse ( res . body ) fail result [ 'message' ] if res . code != '200' Hash [ JSON . parse ( res . body ) . map { | k , v | [ k . to_sym , v ] } ] end
authenticate by operator_id and user_name and password
authenticate by operator_id and user_name and password
operator_id
user_name
password
endpoint