图像
Dot. Manual
Content & Services/Shop/API
图像

Text API

Quick Guide

Prerequisites

  1. Make sure you have retrieved and saved your API key in the Dot. App;
  2. Make sure you own at least one device and have obtained its device serial number;
  3. Make sure your device is connected to power;
  4. Make sure your device is connected to the network;
  5. Make sure the device has added the Text API content.

API requests are not limited by the app’s minimum 5‑minute device interval. The API rate limit is 1 request per second. With the API, you can control device behavior and responses more flexibly.

Placeholders wrapped in ‘{{variable}}’ indicate values you must replace. Fill them with your actual values and remove the ‘{{}}’ braces.

Request Examples

curl -X POST \
  https://dot.mindreset.tech/api/open/text \
  -H 'Authorization: Bearer {{API_KEY}}' \
  -H 'Content-Type: application/json' \
  -d '{
    "refreshNow": {{show content immediately}},
    "deviceId": "{{device serial number}}",
    "title": "{{title}}",
    "message": "{{content}}",
    "signature": "{{signature}}",
    "icon": "{{base64-encoded PNG icon data}}",
    "link": "{{NFC tap redirect link}}"
  }'
import requests

url = "https://dot.mindreset.tech/api/open/text"
headers = {
    "Authorization": "Bearer {{API_KEY}}",
    "Content-Type": "application/json"
}
data = {
    "refreshNow": {{show content immediately}},
    "deviceId": "{{device serial number}}",
    "title": "{{title}}",
    "message": "{{content}}",
    "signature": "{{signature}}",
    "icon": "{{base64-encoded PNG icon data}}",
    "link": "{{NFC tap redirect link}}"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
fetch("https://dot.mindreset.tech/api/open/text", {
  method: "POST",
  headers: {
    "Authorization": "Bearer {{API_KEY}}",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    refreshNow: {{show content immediately}},
    deviceId: "{{device serial number}}",
    title: "{{title}}",
    message: "{{content}}",
    signature: "{{signature}}",
    icon: "{{base64-encoded PNG icon data}}",
    link: "{{NFC tap redirect link}}"
  })
}).then(res => res.json()).then(console.log);
type ApiResponse = {
  code: number;
  message: string;
  result?: any;
};

fetch("https://dot.mindreset.tech/api/open/text", {
  method: "POST",
  headers: {
    "Authorization": "Bearer {{API_KEY}}",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    refreshNow: {{show content immediately}},
    deviceId: "{{device serial number}}",
    title: "{{title}}",
    message: "{{content}}",
    signature: "{{signature}}",
    icon: "{{base64-encoded PNG icon data}}",
    link: "{{NFC tap redirect link}}"
  })
})
  .then(res => res.json() as Promise<ApiResponse>)
  .then(data => {
    console.log(data);
  });
package main

import (
  "bytes"
  "encoding/json"
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://dot.mindreset.tech/api/open/text"
  payload := map[string]interface{}{
    "refreshNow": {{show content immediately}},
    "deviceId": "{{device serial number}}",
    "title": "{{title}}",
    "message": "{{content}}",
    "signature": "{{signature}}",
    "icon": "{{base64-encoded PNG icon data}}",
    "link": "{{NFC tap redirect link}}",
  }
  body, _ := json.Marshal(payload)
  req, _ := http.NewRequest("POST", url, bytes.NewBuffer(body))
  req.Header.Set("Authorization", "Bearer {{API_KEY}}")
  req.Header.Set("Content-Type", "application/json")
  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()
  respBody, _ := ioutil.ReadAll(resp.Body)
  fmt.Println(string(respBody))
}
use reqwest::blocking::Client;
use serde_json::json;

fn main() {
    let client = Client::new();
    let url = "https://dot.mindreset.tech/api/open/text";
    let res = client.post(url)
        .header("Authorization", "Bearer {{API_KEY}}")
        .header("Content-Type", "application/json")
        .json(&json!({
            "refreshNow": {{show content immediately}},
            "deviceId": "{{device serial number}}",
            "title": "{{title}}",
            "message": "{{content}}",
            "signature": "{{signature}}",
            "icon": "{{base64-encoded PNG icon data}}",
            "link": "{{NFC tap redirect link}}"
        }))
        .send()
        .unwrap()
        .text()
        .unwrap();
    println!("{}", res);
}

Response Example

{
	"code": 200,
	"message": "Device Text API content switched",
	"result": {
		"message": "Device ABCD1234ABCD Text API content switched"
	}
}

Reference Usage

  1. Simple text without immediate display
Actual effect
curl -X POST \
  https://dot.mindreset.tech/api/open/text \
  -H 'Authorization: Bearer dot_app_UlSpzXNEXhYZIAFakHLCkMVVBLbsBIWxaRMVaJZGUOYKhDoDRZwLLvLujAIwQxbY' \
  -H 'Content-Type: application/json' \
  -d '{
    "refreshNow": false,
    "deviceId": "ABCD1234ABCD",
    "title": "evnydd0sf",
    "message": "我能吞下玻璃而不伤身体"
  }'
  1. Complex text and display immediately
Actual effect
curl -X POST \
  https://dot.mindreset.tech/api/open/text \
  -H 'Authorization: Bearer dot_app_UlSpzXNEXhYZIAFakHLCkMVVBLbsBIWxaRMVaJZGUOYKhDoDRZwLLvLujAIwQxbY' \
  -H 'Content-Type: application/json' \
  -d '{
    "deviceId": "ABCD1234ABCD",
    "title": "验证码小助手",
    "message": "一个来自「少数派」的验证码\n205112",
    "signature": "2025年8月4日 19:58"
  }'
  1. Complex text with icon and link, display immediately
Actual effect
curl -X POST \
  https://dot.mindreset.tech/api/open/text \
  -H 'Authorization: Bearer dot_app_UlSpzXNEXhYZIAFakHLCkMVVBLbsBIWxaRMVaJZGUOYKhDoDRZwLLvLujAIwQxbY' \
  -H 'Content-Type: application/json' \
  -d '{
    "deviceId": "ABCD1234ABCD",
    "title": "每日健康",
    "message": "消耗卡路里:702千卡\n今日步数:4183步\n站立时间:62分钟",
    "signature": "2025年8月4日 20:16",
    "icon": "{{base64-encoded PNG image data}}",
    "link": "x-apple-health://"
  }'
  1. Highly customized text or graphics

Refer to the Image API section on text-as-image usage

Actual effect

Troubleshooting

Endpoint

/api/open/text

Method

POST

Request Schema

FieldTypeRequiredDefaultDescriptionPurpose
refreshNowboolNotrueWhether to display the content immediatelyControl display timing
deviceIdstringYesDevice serial numberIdentify the device
titlestringNoText titleTitle shown on screen
messagestringNoText contentContent shown on screen
signaturestringNoText signatureSignature shown on screen
iconstringNoBase64‑encoded PNG icon data (40px×40px)Icon shown at bottom-left
linkstringNohttp/https link or URL schemeNFC tap redirect target

Response Schema

FieldTypeDescription
codenumberStatus code
messagestringMessage
resultobjectPayload

Status Codes

codeMeaningDescription
200SuccessText API content switched / Data updated but content not switched
400Invalid parametersInvalid icon format
403ForbiddenYou do not have permission to operate this device
404Not foundDevice not found or not registered
Text API content not added
500Device response failureFailed to switch Text API content

Did this solve your problem?

Join our community

Text API