> For the complete documentation index, see [llms.txt](https://doc.some3c.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.some3c.com/iphone-farm-setup/xp-api-documentation.md).

# XP API Documentation

This interface can be accessed and interacted using http and websocket\
`websocket` and `http` port numbers are "`9911`"

## http request <a href="#http-qing-qiu-fang-shi" id="http-qing-qiu-fang-shi"></a>

* **Interface address**\
  `iP address:9911/api`\
  Example:`http://127.0.0.1:9911/api`
* **Request method**\
  `get` , `post submitjson`,`post form`

## Websocket request <a href="#websocket-qing-qiu-fang-shi" id="websocket-qing-qiu-fang-shi"></a>

Using websocket to request an interface can get a faster response, but it is more complicated than http request. All request results are in the callback function.\
Because it is an asynchronous method, if you want to wait for the request result before proceeding to the next step, you need to perform asynchronous to synchronous conversion.\
Each interface will have a msgid field, which will be returned as is after the server receives it, and is used for asynchronous to synchronous conversion.5

* **Interface address**\
  `ws://server address:9911/api`\
  example`:ws://127.0.0.1:9911/api`
* **Request content format**\
  `json`

All interfaces will return success or failure after calling. `status`200 represents success, and other values ​​represent failure. The failure information will be in`message` the result of the call , which represents the actual execution result.`datadatacode`

| code | describe                                                       |
| ---- | -------------------------------------------------------------- |
| 0    | success                                                        |
| 1    | id does not exist                                              |
| 2    | The device is not bound to hardware                            |
| 3    | Hardware not connected                                         |
| 4    | Collection failed                                              |
| 5    | A device is collecting                                         |
| 6    | This device ID is not collecting mouse                         |
| 7    | The device ID does not exist or the device is online           |
| 8    | Scan code to open successfully                                 |
| 9    | Enter the collection page                                      |
| 10   | Hardware id is empty                                           |
| 11   | No mouse parameters                                            |
| 12   | Hardware and mobile phone connection                           |
| 13   | The hardware is not connected to the phone                     |
| 14   | Start working                                                  |
| 15   | No coordinates                                                 |
| 16   | The hardware is not working (unknown error)                    |
| 17   | Retry on failure                                               |
| 18   | Failure stop                                                   |
| 19   | Hardware and computer connection                               |
| 20   | There is hardware disconnected from the computer               |
| 21   | At work                                                        |
| 22   | Equipment online                                               |
| 23   | Hardware unbound device                                        |
| 24   | Hardware not turned on                                         |
| 25   | The device is offline                                          |
| 26   | Screenshot failed                                              |
| 27   | Path does not exist                                            |
| 28   | Plugin not connected                                           |
| 29   | Calling the plugin interface times out                         |
| 30   | Call timeout                                                   |
| 31   | OCR did not recognize the text                                 |
| 32   | No text found                                                  |
| 33   | fail                                                           |
| 34   | Please remove the device in the group first                    |
| 35   | The file list is empty, or none of the files in the list exist |
| 36   | Parameter error                                                |
| 37   | Login Failed                                                   |
| 38   | Registration failed                                            |
| 39   | Password reset failed                                          |
| 40   | Failed to send verification code                               |
| 41   | Incompatible commands                                          |
