How to Use the API for the iAuto Automatic Writing Machine: A Simple Example

How to Use the API for the iAuto Automatic Writing Machine: A Simple Example

The iAuto Automatic Writing Machine supports API integration, enabling developers to send commands and control the machine programmatically. This guide demonstrates how to make a basic API call using the command-line tool to initiate a writing task with an SVG file.

Step 1: Determine the API Address

Determine the API Address

Ensure the machine is connected to your local network and identify its IP address and port. For example: http://192.168.1.XXX:90

Replace XXX with the correct local IP address segment for your setup.

Determine the API Address

Step 2: Understand the API Parameters

Understand the API Parameters

Before sending commands, familiarize yourself with the parameters required by the API. This example demonstrates writing a single SVG file. These parameters include:

  • file: Path to the SVG file to be written
  • width: Canvas width (e.g., 210mm)
  • height: Canvas height (e.g., 297mm)
  • xpos: X-axis starting position
  • ypos: Y-axis starting position
  • scale: Scaling factor (default is 1)
  • rotation: Rotation angle in degrees (default is 0)
  • clear: Whether to clear the previous task (set to 1 to clear)
  • start: Whether to start the task immediately (set to 1 to begin writing)

View the source code for detailed descriptions and error types

Execute the API Call

Here is an example command that sends an SVG file to the machine for immediate writing:

curl -X POST ^
  -F "file=@\"F:\Desktop\concepts\tony.svg\"" ^
  -F "width=210mm" ^
  -F "height=297mm" ^
  -F "xpos=100mm" ^
  -F "ypos=100mm" ^
  -F "scale=1" ^
  -F "rotation=0" ^
  -F "clear=1" ^
  -F "start=1" ^
  http://192.168.1.XXX:90/write_svg

⚠️ Make sure the specified file path and API address are correct.

Step 3: Calling the API

If the request is successful, the machine will load the SVG file and begin writing immediately.

Interface Preview

Interface Preview

If there is an error, refer to the source file to find the cause of the error.

After entering the command, the machine interface is as follows. It will automatically import the SVG image and start writing automatically.

Interface Preview

Example Output

Example Output

Additional Notes

  • You can also use the API in conjunction with other programming languages, such as Python, to achieve more advanced workflows or automated tasks.
  • Important: API integration is for developers or technicians. Although we provide API interfaces and source code for reference, UUNA TEK does not provide technical support for custom API usage. Only API ports are provided.
Back to blog

Leave a comment

Please note, comments need to be approved before they are published.