Sha256: f7ba47a4943f88f134ea44c9b25dafe5b6618fedc32ce87423c9ee071ff11361

Contents?: true

Size: 694 Bytes

Versions: 6

Compression:

Stored size: 694 Bytes

Contents

require "losant_rest"

client = PlatformRest::Client.new

user_response = client.auth.authenticate_user(credentials: {
  email: "example@losant.com",
  password: "your_password"
})

puts user_response
# Example user result
# {
#   "token"  => "an auth token string",
#   "userId" => "theUserId"
# }


device_response = client.auth.authenticate_device(credentials: {
  deviceId: "myDeviceId",
  key: "my_app_access_key",
  secret: "my_app_access_secret"
})

puts device_response
# Example device result
# {
#   "applicationId" => "myAppId",
#   "token"         => "an auth token string",
#   "restricted"    => false,
#   "deviceId"      => "myDeviceId",
#   "deviceClass"   => "standalone"
# }

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
losant_rest-1.21.0 examples/auth.rb
losant_rest-1.20.1 examples/auth.rb
losant_rest-1.20.0 examples/auth.rb
losant_rest-1.19.9 examples/auth.rb
losant_rest-1.19.8 examples/auth.rb
losant_rest-1.19.6 examples/auth.rb