DeveloperDeveloper
  • Standard Solutions
  • Cam Solutions
  • Native SDKs
  • App Gallery
  • Game Engine Plugins
Forum
Projects Library
Dev Discord
  • Standard Solutions
  • Cam Solutions
  • Native SDKs
  • App Gallery
  • Game Engine Plugins
Forum
Projects Library
Dev Discord

Get Lovense App Info

This guide will show you how to get Lovense app info. You may need to get Lovense app info when integrating with the Lovense Basic API or Standard API.

Guide

You can get the local Lovense app info in three ways:

  1. Use Get App Info List API get App Info Object list
  2. Receive App Info Object when the user use Lovense Remote/Connect scan the QR code
  3. Get app connect information in app view

Way 1: Select App

Lovense Remote

  1. Open Lovense Remote Game Mode

    Lovense PC Remote

  2. Use Get App Info List API API get App Info Object list on the local network

  3. Let user select app by code

Lovense Connect

  1. Open connection infomation view in Lovense Connect

    Lovense Connect App Lovense Connect PC

  2. Use Get App Info List API API get App Info Object list on the local network

  3. Let user select app by code

Way 2: Scan QR Code or Input Code on Lovense App

  1. Use Generate QR Code to generate QR code and string code

  2. Show QR code to user or show string code

  3. User use Lovense Mobile Remote/Connect scan QR code or input string code

    Lovense Connect Scan Lovense Remote Scan

  4. Receive App Info Object from your Callback URL

Way 3: Input ip and port

Lovense Remote

  1. Open Lovense Remote third-party control mode

    Lovense Remote Game Mode

  2. Get connect ip address from Lovense Remote connect infomation view

    Lovense Remote IP

  3. User input connect ip address to your app

Lovense Connect

  1. Open connection infomation view in Lovense Connect

    open Lovense Connect connet infomation view

  2. Get local ip address from Lovense Connect

    get connect ip address from Lovense Connect

  3. User input connect ip address to your app

API

Get List of local Apps

curl -X GET https://api.lovense-api.com/api/lan/v2/app

API URL: https://api.lovense-api.com/api/lan/v2/app

Request Protocol: HTTPS Request

Method: GET

Response Content Type: application/json

Response:

NameDescriptionType
codeReturn code, 0 means success, others mean failure. See Response Code for details.int
messageWhen the request fails, the reason for the failure will be returned.string
dataResponse dataApp Info Object[]

Response data example:

{
  "code": 0,
  "data": {
    "deviceCode": "xxxxxx",
    "deviceId": "xxxxxxx",
    "online": true,
    "domain": "192-168-1-xx.lovense.club",
    "httpsPort": 30010,
    "wssPort": 30110,
    "appVersion": "1.3.7",
    "platform": "android",
    "appType": "remote",
    "toyList": []
  }
}

Get local app by code

Get local network connection information from the Lovense App using the Device Code.

curl -X GET https://api.lovense-api.com/api/lan/v2/app/{deviceCode}

API URL: https://api.lovense-api.com/api/lan//v2/app/{deviceCode}

Request Protocol: HTTPS Request

Method: GET

Response Content Type: application/json

Response:

NameDescriptionType
codeReturn code, 0 means success, others mean failure. See Response Code for details.int
dataResponse dataApp Info Object

Response data example:

{
  "code": 0,
  "data": {
    "deviceCode": "xxxxxx",
    "deviceId": "xxxxxxx",
    "online": true,
    "domain": "192-168-1-xx.lovense.club",
    "httpsPort": 30010,
    "wssPort": 30110,
    "appVersion": "1.3.7",
    "platform": "android",
    "appType": "remote",
    "toyList": []
  }
}

Generate QR Code

String url= "https://api.lovense-api.com/api/lan/v2/qrcode";
Map<String, String> requestParameter = new HashMap<String, String>();
//TODO initialize your parameters:
requestParameter.put("token", "{Lovense developer token}");
requestParameter.put("uid", "{user ID on your website}");
requestParameter.put("uname", "{user nickname on your website}");
requestParameter.put("utoken", "{Encrypted user token on your application. This is a security consideration, to avoid others stealing control of the toy.}");
requestParameter.put("v", 2);
HttpPost httpPost = new HttpPost(url);
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
if (requestParameter != null && !requestParameter.isEmpty()) {
  Set<String> keys = requestParameter.keySet();
  for (String key : keys) {
    nameValuePairs.add(new BasicNameValuePair(key, requestParameter.get(key)));
  }
}
httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs, "utf-8"));
const result = async axios.post('https://api.lovense-api.com/api/lan/v2/qrcode',
  {
    token: 'your developer token',  // Lovense developer token
    uid: '11111',  // user ID on your website
    uname: 'user name', // user nickname on your website
    utoken: md5(uid + 'salt'),  // This is for your own verification purposes. We suggest you to generate a unique token/secret for each user. This allows you to verify the user and avoid others faking the calls.
    v: 2
  }
)

Call Lovense Server API from your server

API URL: https://api.lovense-api.com/api/lan/v2/qrcode

WARNING

Notice: For security reasons, the developer token should be always used on the server side. You should never use it in your client side.

Request Protocol: HTTPS Request

Method: POST

Content Type: application/json

Parameters:

NameDescriptionRequired
tokenDeveloper Tokenyes
uidUser ID on your applicationyes
unameUser ID on your applicationno
utokenUser token from your website. This is for your own verification purposes. We suggest you generate a unique token for each user. This allows you to verify the user and avoid others faking the calls.no

Request Example:

{
  "token": "FE1TxWpTciAl4E2QfYEfPLvo2jf8V6WJWkLJtzLqv/nB2AMos9XuWzgQNrbXSi6n",
  "uid": "your user id",
  "uname": "your user name",
  "utoken": "your user token"
}

Return:

NameDescriptionType
codeReturn code, 0 means success, others mean failure. See Response Code for details.int
messageWhen the request fails, the reason for the failure will be returned.string
dataqrcode dataobject
data.qrcodeUrlqrcode picture urlstring
data.qrcodeqrcode string, you can use it to generate QR codes.string

example:

{
  code: 0
  message: "Success"
  data: {
      "qrcodeUrl": "https://api.lovense-api.com/UploadFiles/qr/20220106/xxxx.jpg", // qrcode picture
      "qrcode": "xxxxxxxxxxxxxxxxxxxx"
  }
}

TIP

The QR code will expire after 4 hours.

Post Callback URL Data

Provide your Callback URL to us get the local app information.

When user scan the QR code, the system will post App Info Object to your callback URL, use HTTP POST method with application/json; charset=utf-8 content type and Custom-Header: api-version=2 header.

Objects

App Info Object

NameDescriptionType
deviceCodeClient identification code.string
onlineWhether the channel used to forward instructions from the Lovense server is connected.boolean
domainApp connect domainstring
httpsPortHTTPS Portint
wssPortwebsocket Portint
platformPlatformstring
appVersionApp versionstring
appTypeApp typestring
toyListToy listToy Object[]

example:

{
  "deviceCode": "xxxxxx",
  "online": true,
  "domain": "192.168.1.xx.lovense.club",
  "httpsPort": 30010,
  "wssPort": 30110,
  "appVersion": "1.3.7",
  "platform": "android",
  "appType": "remote",
  "toyList": [
    {
      "id": "xxxxxxxx",
      "name": "Lush 3",
      "toyType": "lush",
      "nickname": "My Lush",
      "hVersion": "3",
      "fVersion": 300,
      "battery": 100,
      "connected": true
    }
  ]
}

Toy Object

NameDescriptionType
idToy ID.string
toyTypeToy type.string
nicknameToy nickname.string
fVersionToy firmware version.int
hVersionToy hardware version. For example, Lush is "", and Lush 2 is "2".string
batteryToy power, -1~100. -1: The power is not obtained or the toy has no battery.int
connectedToy's connection status. true: conencted, false: disconnectedint

example:

{
  "id": "xxxxxxxx",
  "name": "Lush 3",
  "toyType": "lush",
  "nickname": "My Lush",
  "hVersion": "3",
  "fVersion": 300,
  "battery": 100,
  "connected": true
}

Other

Response Code

CodeDescription
0Success
404Invalid Parameter
500Server Error
501Invalid token
502Invalid Callback URL
Last Updated:
Explore our Forum or Support to get more inspiration or solve your problems.
Discord Channel
It is an online real-time channel where you can communicate directly with our official administrators or many excellent developers.
Forum
It is a place for Lovense developers to communicate, where you can find solutions to problems or get inspired for your projects.
Support
Find documents and tutorials that may be helpful to you.