Documentation of MyTapeLabels' XML-RPC API version 0.6 **** generatePDF **** : Generate a PDF document containing Tape Barcode Labels. Args: sessionid (str): The session id as obtained from login. template (str): The page template name used to draw labels. mediatype (str): The default media type to use for 6 characters long label textual values. An empty string is allowed if all your label textual values are either 0 or 8 characters long. style (str): The name of the style to use for each label, describing the relative positions and orientations of the barcode and its human-readable representation. colorscheme (str): The name of the color scheme. borders (bool): When True defines if borders will be drawn around each label. Entirely unnecessary with pre-cut blank labels, but needed if you plan to manually cut the labels from a whole page. checksum (bool): When True all barcodes will contain a checksum character. **READ THE DOCUMENTATION OF YOUR TAPE LIBRARY AND BACKUP SOFTWARE BEFORE EVER SETTING THIS TO True.** xoffset (float): Offset printing by xoffset millimeters to the right, to put the left side of the first label on a row to the indicated distance from the left side of the page. yoffset (float): Offset printing by yoffset millimeters to the top, to put the bottom side of the first label on a column to the indicated distance from the bottom of the page. preview (bool) : Indicates if only a preview is to be generated : in a preview the labels' text is correct, but the barcode is always the same. Previews don't cost any label and allow you to check if all your settings are correct and if you wouldn't generate more labels than needed by mistake. labels (list): A list of 0, 6, or 8 characters long strings, representing the textual values to be represented as barcodes. Only digits and uppercase ASCII letters are allowed in non-empty strings, excepted for diagnostic tapes which require a space character in the third character. Returns: tuple. The return value is composed of a possibly empty Binary object representing the content of the PDF document that has been generated, and of a possibly empty string representing an error or warning message to present to the end user. Raises: ValueError: if session id or any other parameter is invalid. You must first print a calibration or preview page with no offsets, then measure the length in millimeters of the bottom left marks, compare these values to the values printed near the bottom left marks, deduce the correct offsets to match your printer's precision, and call this method again with the correct xoffset and yoffset values. If **ABSOLUTELY NO SCALING** takes place, then labels should be printed exactly as defined on the template. It is suggested that you call this method twice : the first time with the 'preview' parameter set to True, to double check the resulting PDF document for errors, and then, if all is as expected, with the 'preview' parameter set to False, to generate the labels for real. This is complicated but you should have to do this only once for any given printer. Empty label textual values allow you to not print a particular label in a given position, allowing you to reuse partially printed label sheets. The media type, if valid and non empty, will be concatenated to all 6 characters long values. Finally all invalid label textual values are ignored. **** getAPIKeyDetails **** : Returns the details about the API key used to open the current session. Args: sessionid (str): The session id as obtained from login. Returns: tuple : (fullname, # The full name of the API Key's owner. email, # The email address of the API Key's owner. apikey, # The API Key. maxlabels, # The maximum number of labels allowed with this API Key. remaining) # The number of labels that can still be generated with this API Key. Raises: ValueError: if session id is invalid. **** getAPIVersion **** : Return the API's version number. Args: sessionid (str): The session id as obtained from login. Returns: str. The API's version number. Raises: ValueError: if session id is invalid. You should ensure that your client always uses the latest API version. **** getAvailableColorSchemes **** : Return all the available color schemes. Args: sessionid (str): The session id as obtained from login. Returns: dict. Mapping of all { name : description } color schemes. Raises: ValueError: if session id is invalid. **** getAvailableMediaTypes **** : Return all the available media types. Args: sessionid (str): The session id as obtained from login. Returns: dict. Mapping of all { name : description } media types. Raises: ValueError: if session id is invalid. **** getAvailableStyles **** : Return all the available label styles. Args: sessionid (str): The session id as obtained from login. Returns: dict. Mapping of all { name : description } label styles. Raises: ValueError: if session id is invalid. **** getAvailableTemplates **** : Return all the available templates. Args: sessionid (str): The session id as obtained from login. Returns: dict. Mapping of all { name : description } templates. Raises: ValueError: if session id is invalid. **** getRemainingLabels **** : Return the maximum number of labels that can be created. Args: sessionid (str): The session id as obtained from login. Returns: int. The number of labels that can still be created with the API key that owns the current session. Raises: ValueError: if session id is invalid. Once the return value hits 0, you must purchase a new subscription from http://api.mytapelabels.com **** login **** : Login with an API key and a tape type and returns a session id. Args: apikey (str): The API key to login with. tapetype (str) : The tape type to generate labels for. Returns: str. The session id to use in subsequent calls. Raises: ValueError: if the API key or tape type is invalid. Use 'DEMO' as the API key, or purchase a yearly subscription from http://api.mytapelabels.com For now, only 'LTO' and 'STK10K' are supported as the tape type. The session id returned currently has a lifetime of 10 minutes. **** logout **** : Logout from an active session. Args: sessionid (str): The session id as obtained from login. Returns: bool. Always True. Raises: ValueError: if session id is invalid. Always terminate your sessions by calling this method. **** system.listMethods **** : system.listMethods() => ['add', 'subtract', 'multiple'] Returns a list of the methods supported by the server. **** system.methodHelp **** : system.methodHelp('add') => "Adds two integers together" Returns a string containing documentation for the specified method. **** system.methodSignature **** : system.methodSignature('add') => [double, int, int] Returns a list describing the signature of the method. In the above example, the add method takes two integers as arguments and returns a double result. This server does NOT support system.methodSignature.