Auth Actions#

https://api.losant.com/auth

Below are the various requests that can be performed against the Auth resource, as well as the expected parameters and the potential responses.

Authenticate Device#

Authenticates a device using the provided credentials.

Method And Url #

POST https://api.losant.com/auth/device

Authentication #

No authentication is required for this endpoint.

Request Body #

The body of the request should be serialized JSON that validates against the Device Credentials schema. For example, the following would be a valid body for this request:

{
  "deviceId": "575ecf887ae143cd83dc4aa2",
  "key": "this_would_be_the_key",
  "secret": "this_would_be_the_secret"
}

Curl Example #

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -X POST \
    -d '{"deviceId":"575ecf887ae143cd83dc4aa2","key":"this_would_be_the_key","secret":"this_would_be_the_secret"}' \
    https://api.losant.com/auth/device

Successful Responses #

Code Type Description
200 Authenticated Device Successful authentication. The included api access token has the scope 'all.Device'.

Error Responses #

Code Type Description
400 Error Error if malformed request
401 Error Unauthorized error if authentication fails

Authenticate Solution User#

Authenticates a solution user using the provided credentials.

Method And Url #

POST https://api.losant.com/auth/solutionUser

Authentication #

No authentication is required for this endpoint.

Request Body #

The body of the request should be serialized JSON that validates against the Solution User Credentials schema. For example, the following would be a valid body for this request:

{
  "solutionId": "57955788124b37010084c053",
  "email": "example@solutionuser.com",
  "password": "this is the password"
}

Curl Example #

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -X POST \
    -d '{"solutionId":"57955788124b37010084c053","email":"example@solutionuser.com","password":"this is the password"}' \
    https://api.losant.com/auth/solutionUser

Successful Responses #

Code Type Description
200 Authenticated Solution User Successful authentication

Error Responses #

Code Type Description
400 Error Error if malformed request
401 Error Unauthorized error if authentication fails

Authenticate User#

Authenticates a user using the provided credentials.

Method And Url #

POST https://api.losant.com/auth/user

Authentication #

No authentication is required for this endpoint.

Request Body #

The body of the request should be serialized JSON that validates against the User Credentials schema. For example, the following would be a valid body for this request:

{
  "email": "example@losant.com",
  "password": "this is the password"
}

Curl Example #

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -X POST \
    -d '{"email":"example@losant.com","password":"this is the password"}' \
    https://api.losant.com/auth/user

Successful Responses #

Code Type Description
200 Authenticated User Successful authentication. The included api access token has the scope 'all.User'.

Error Responses #

Code Type Description
400 Error Error if malformed request
401 Error Unauthorized error if authentication fails

Authenticate User Github#

Authenticates a user via GitHub OAuth.

Method And Url #

POST https://api.losant.com/auth/user/github

Authentication #

No authentication is required for this endpoint.

Request Body #

The body of the request should be serialized JSON that validates against the Github Login schema. For example, the following would be a valid body for this request:

{
  "accessToken": "the github access token"
}

Curl Example #

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -X POST \
    -d '{"accessToken":"the github access token"}' \
    https://api.losant.com/auth/user/github

Successful Responses #

Code Type Description
200 Authenticated User Successful authentication. The included api access token has the scope 'all.User'.

Error Responses #

Code Type Description
400 Error Error if malformed request
401 Error Unauthorized error if authentication fails