跳到主内容

搜索

搜索

REST API print multiple labels in the same request

评论

2 条评论

  • Avatar
    Ryan Lounsbury

    *I did find a 6-year old thread saying that Bartender web service integration does not support JSON arrays. Surely this has been addressed by now?

    I have the same issue trying to do the same thing. I've read in multiple places that this appears to be possible but only with BTXML examples no JSON examples. In theory I should be able to the following snippet of JSON in the body of the request and get 2 labels out:

    {
        "PrinterName": "TESTPRN",
        "Copies": 2,
        "DESC": "DESCRIPTION TEXT",
        "OPER": "TEST2",
        "PACK": "2.00",
        "SKU": "TEST2",
        "UPC": "987456123"
    },
    {
        "PrinterName": "TESTPRN",
        "Copies": 2,
        "DESC": "DESCRIPTION TEXT",
        "OPER": "TEST",
        "PACK": "2.00",
        "SKU": "TEST",
        "UPC": "123456789"
    }
     
    But I get the same result. Only the second section of JSON gets rendered into a printed label by the web integration.
    0
  • Avatar
    Peter Lykkegaard

    In Bartender 2022 you can use an ActionGroup as header and an array of Actions

    Code:

    {
        "ActionGroup": 
        {
            "Actions": 
            [{
                "PrintBTWAction": 
                {
                    "DocumentFile": "labels.btw",
                    "Printer": "APrinter",
                    "Copies": 1,
                    "NamedDataSources": 
                    {
                        "Data": "1",
                    }
                }
            },
            {
                "PrintBTWAction": {
                    "DocumentFile": "labels.btw",
                    "Printer": "APrinter",
                    "Copies": 1,
                    "NamedDataSources": 
                    {
                        "Data": "2",
                    }
                }
            }]
        }
    }

    0

请先登录再写评论。