Me Actions

https://api.losant.com/me

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

Add Recent Item

Adds an item to a recent item list

Method And Url

POST https://api.losant.com/me/recentItems

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.SolutionUser, all.User, me.*, or me.addRecentItem.

Request Headers

Name Required Description Default
Authorization Y The token for authenticating the request, prepended with Bearer

Request Body

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

{
  "itemType": "device",
  "parentId": "575ec8687ae143cd83dc4a97",
  "itemId": "575ecf887ae143cd83dc4aa2"
}

Curl Example

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
    -X POST \
    -d '{"itemType":"device","parentId":"575ec8687ae143cd83dc4a97","itemId":"575ecf887ae143cd83dc4aa2"}' \
    https://api.losant.com/me/recentItems

Successful Responses

Code Type Description
200 Recent Item List Updated recent item list

Error Responses

Code Type Description
400 Error Error if malformed request

Change Password

Changes the current user's password and optionally logs out all other sessions

Method And Url

PATCH https://api.losant.com/me/changePassword

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.SolutionUser, all.User, me.*, or me.changePassword.

Request Headers

Name Required Description Default
Authorization Y The token for authenticating the request, prepended with Bearer

Request Body

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

{
  "newPassword": "yourNewPassword",
  "password": "yourCurrentPassword",
  "invalidateExistingTokens": true
}

Curl Example

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
    -X PATCH \
    -d '{"newPassword":"yourNewPassword","password":"yourCurrentPassword","invalidateExistingTokens":true}' \
    https://api.losant.com/me/changePassword

Successful Responses

Code Type Description
200 Authenticated User A new, valid, auth token (potentially all previous tokens are now invalid)

Error Responses

Code Type Description
400 Error Error if malformed request

Delete

Deletes the current user

Method And Url

POST https://api.losant.com/me/delete

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.SolutionUser, all.User, me.*, or me.delete.

Request Headers

Name Required Description Default
Authorization Y The token for authenticating the request, prepended with Bearer

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' \
    -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
    -X POST \
    -d '{"email":"example@losant.com","password":"this is the password"}' \
    https://api.losant.com/me/delete

Successful Responses

Code Type Description
200 Success If the user was successfully deleted

Error Responses

Code Type Description
400 Error Error if malformed request

Disable Two Factor Auth

Disables two factor auth for the current user

Method And Url

PATCH https://api.losant.com/me/disableTwoFactorAuth

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.SolutionUser, all.User, me.*, or me.disableTwoFactorAuth.

Request Headers

Name Required Description Default
Authorization Y The token for authenticating the request, prepended with Bearer

Request Body

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

{
  "twoFactorCode": "123123",
  "password": "this would be your password"
}

Curl Example

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
    -X PATCH \
    -d '{"twoFactorCode":"123123","password":"this would be your password"}' \
    https://api.losant.com/me/disableTwoFactorAuth

Successful Responses

Code Type Description
200 Me Updated user information

Error Responses

Code Type Description
400 Error Error if malformed request

Disconnect Github

Disconnects the user from Github

Method And Url

PATCH https://api.losant.com/me/disconnectGithub

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.SolutionUser, all.User, me.*, or me.disconnectGithub.

Request Headers

Name Required Description Default
Authorization Y The token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
    -X PATCH \
    https://api.losant.com/me/disconnectGithub

Successful Responses

Code Type Description
200 Me Updated user information

Error Responses

Code Type Description
400 Error Error if malformed request

Disconnect Twitter

Disconnects the user from Twitter

Method And Url

PATCH https://api.losant.com/me/disconnectTwitter

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.SolutionUser, all.User, me.*, or me.disconnectTwitter.

Request Headers

Name Required Description Default
Authorization Y The token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
    -X PATCH \
    https://api.losant.com/me/disconnectTwitter

Successful Responses

Code Type Description
200 Me Updated user information

Error Responses

Code Type Description
400 Error Error if malformed request

Enable Two Factor Auth

Enables two factor auth for the current user

Method And Url

PATCH https://api.losant.com/me/enableTwoFactorAuth

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.SolutionUser, all.User, me.*, or me.enableTwoFactorAuth.

Request Headers

Name Required Description Default
Authorization Y The token for authenticating the request, prepended with Bearer

Request Body

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

{
  "twoFactorAuthKey": "HBBGWJJVOVLXS4ZGNRTDOUKTMESFUR3BMRWVQND2HJYT44TOMVJA",
  "password": "this would be your password"
}

Curl Example

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
    -X PATCH \
    -d '{"twoFactorAuthKey":"HBBGWJJVOVLXS4ZGNRTDOUKTMESFUR3BMRWVQND2HJYT44TOMVJA","password":"this would be your password"}' \
    https://api.losant.com/me/enableTwoFactorAuth

Successful Responses

Code Type Description
200 Me Updated user information

Error Responses

Code Type Description
400 Error Error if malformed request

Fetch Recent Items

Gets a recent item list

Method And Url

GET https://api.losant.com/me/recentItems

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.SolutionUser, all.SolutionUser.read, all.User, all.User.read, me.*, or me.fetchRecentItems.

Request Query Parameters

Name Required Description Default Example
parentId N Parent id of the recent list parentId=575ec8687ae143cd83dc4a97
itemType Y Item type to get the recent list of. Accepted values are: application, device, flow, dashboard, organization itemType=application

Request Headers

Name Required Description Default
Authorization Y The token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
    -X GET \
    https://api.losant.com/me/recentItems?itemType=application

Successful Responses

Code Type Description
200 Recent Item List Recent item list

Error Responses

Code Type Description
400 Error Error if malformed request

Get

Retrieves information on the current user

Method And Url

GET https://api.losant.com/me

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.SolutionUser, all.SolutionUser.read, all.User, all.User.read, me.*, or me.get.

Request Query Parameters

Name Required Description Default Example
includeRecent N Should the user include recent app/dashboard info includeRecent=true
summaryExclude N List of summary fields to exclude from user summary summaryExclude=payloadCount

Request Headers

Name Required Description Default
Authorization Y The token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
    -X GET \
    https://api.losant.com/me

Successful Responses

Code Type Description
200 Me Current user information

Error Responses

Code Type Description

Patch

Updates information about the current user

Method And Url

PATCH https://api.losant.com/me

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.SolutionUser, all.User, me.*, or me.patch.

Request Headers

Name Required Description Default
Authorization Y The token for authenticating the request, prepended with Bearer

Request Body

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

{
  "email": "example@losant.com",
  "firstName": "Example",
  "lastName": "Name",
  "companyName": "Losant IoT, Inc.",
  "url": "https://www.losant.com",
  "password": "my new password"
}

Curl Example

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
    -X PATCH \
    -d '{"email":"example@losant.com","firstName":"Example","lastName":"Name","companyName":"Losant IoT, Inc.","url":"https://www.losant.com","password":"my new password"}' \
    https://api.losant.com/me

Successful Responses

Code Type Description
200 Me Updated user information

Error Responses

Code Type Description
400 Error Error if malformed request

Payload Counts

Returns payload counts for the time range specified for all applications the current user owns

Method And Url

GET https://api.losant.com/me/payloadCounts

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.SolutionUser, all.User, all.User.read, me.*, or me.payloadCounts.

Request Query Parameters

Name Required Description Default Example
start N Start of range for payload count query (ms since epoch) start=0
end N End of range for payload count query (ms since epoch) end=1465790400000

Request Headers

Name Required Description Default
Authorization Y The token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
    -X GET \
    https://api.losant.com/me/payloadCounts

Successful Responses

Code Type Description
200 Payload Counts Payload counts, by type and source

Error Responses

Code Type Description
400 Error Error if malformed request

Transfer Resources

Moves resources to a new owner

Method And Url

PATCH https://api.losant.com/me/transferResources

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.SolutionUser, all.User, me.*, or me.transferResources.

Request Headers

Name Required Description Default
Authorization Y The token for authenticating the request, prepended with Bearer

Request Body

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

{
  "destinationId": "575ed6e87ae143cd83dc4aa8",
  "destinationType": "organization",
  "applicationIds": [
    "575ec8687ae143cd83dc4a97"
  ]
}

Curl Example

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
    -X PATCH \
    -d '{"destinationId":"575ed6e87ae143cd83dc4aa8","destinationType":"organization","applicationIds":["575ec8687ae143cd83dc4a97"]}' \
    https://api.losant.com/me/transferResources

Successful Responses

Code Type Description
200 Success If resource transfer was successful

Error Responses

Code Type Description
400 Error Error if malformed request

Verify Email

Sends an email verification to the user

Method And Url

POST https://api.losant.com/me/verify-email

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.SolutionUser, all.User, me.*, or me.verifyEmail.

Request Headers

Name Required Description Default
Authorization Y The token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
    -X POST \
    https://api.losant.com/me/verify-email

Successful Responses

Code Type Description
200 Success If email verification was successfully sent

Error Responses

Code Type Description
400 Error Error if malformed request