Using a socket-based protocol to run API commands
When you connect, the API service issues its standard prompt, >, indicating that it is ready to receive a command.
Each completed command returns 0 or more informational lines followed by a status line. The status line starts with a command-complete character (<), followed by a numeric result code and related message. For more information, see API-result-codes.
For example, you could enter a login command with a valid user name and password and receive a response as follows:
In this case, the login command returned a 0 result code and related message indicating success (Ok).
Commands that return information lines issue those lines before the result code. The lines typically consist of an ID code followed by text information, but vary depending on the command issued. For example:
>list packages
In this example, the list packages command lists each package defined in the database on one line composed of the unique ID number and name of the package. Most list commands display data in this format. The unique ID number for each entry can be used by other commands.