{
  "schema": "1.0",
  "name": "OpenC Barcoder",
  "link": "https://connectors.openc.nl",
  "description": "Generate barcodes and QR codes via Claris Connect.",
  "auth_components": {
    "type": "none"
  },
  "requiredSettings": {
    "authFields": [
      {
        "label": "API token",
        "key": "token",
        "description": "Your API token for OpenC Barcoder"
      }
    ]
  },
  "auth_request": {
    "type": "custom_body",
    "errorMessageKey": "detail",
    "body_parameters": {
      "token": "{{authFields.token}}"
    }
  },
  "testConnection": {
    "endpoint": "/test",
    "method": "POST",
    "body": {}
  },
  "endpoints": {
    "POST": {
      "/test": {
        "url": "https://connector-backend.smartyellow.net/barcoder/"
      },
      "/generate": {
        "url": "https://connector-backend.smartyellow.net/barcoder/"
      }
    }
  },
  "actions": [
    {
      "modelId": "barcode",
      "actionId": "generate",
      "endpoint": "/generate",
      "method": "POST",
      "label": "Generate a barcode",
      "helpText": "Generate a barcode or QR code in PNG format.",
      "urlFields": [],
      "actionFields": [
        {
          "key": "type",
          "label": "Type",
          "description": "Type of the barcode to create.",
          "type": "choice",
          "required": true,
          "choices": {
            "qr": "QR code",
            "ean": "EAN-13",
            "code39": "CODE-39",
            "code128": "CODE-128",
            "code93": "CODE-93",
            "pdf417": "PDF417",
            "datamatrix": "Datamatrix",
            "aztec": "Aztec code"
          }
        },
        {
          "key": "text",
          "label": "Text",
          "description": "Text to convert into a barcode or QR code.",
          "type": "string",
          "required": true
        },
        {
          "key": "withText",
          "label": "Include text",
          "description": "Whether to print the code as text beneath the barcode. (Not supported for QR codes.)",
          "type": "boolean",
          "required": false
        }
      ]
    }
  ]
}
