Salebot.ai
  • About
  • The basics: How to use Salebot.ai
    • The basics of using the editing software
    • Creating blocks and the types of them
    • Arrows (connections)
    • Quick actions
    • Buttons
    • Condition and Matching selection
    • Links to messengers
    • Blocks "not State"
    • The first message
    • Description of the fields in the Editor
    • How to make the bot not interrupt the dialogue with the client
    • Sending attachments. Tracking links.
    • Getting files from the user
    • Editing text message
    • Random answers in a bot
    • Built-in variables
    • Reservation and recovery
    • Free Videos to master Salebot
  • Administration
    • Custom Roles
    • Reservation and recovery
  • Messengers and chats
    • WhatsApp
    • Whatsapp Business API
    • Telegram
    • Viber
    • Facebook Messenger
    • Official Instagram
    • Online-chat on a site
    • Merging contacts from different messengers
  • Variables
    • Variables
    • Calculator
    • API in Calculator
    • Variable comparison
    • Working with Dates and Time
    • Working with Arrays and Dictionaries
    • List of Useful Regular Expressions
    • How to use variables
  • CRM
    • AmoCRM
    • Bitrix24
  • Working with API
    • The editing software's API
    • Integration with third-party APIs
  • Integrations
    • Payment systems
      • Capusta.space
      • Coinpayments
      • INXY Payments
      • Paypal
      • Payeer.trade
      • Paynow
      • Stripe
      • Telegram
      • Fondy
      • Wayforpay
      • WalletOne
    • InfoBusiness
      • MyOwnConference
      • WebinarGeek
    • Analytics
      • Roistat
      • Facebook Pixel
      • Google Analytics
    • Google Sheets
    • Google Tables
    • Google Calendar
    • Apix-Drive
    • SMS services
    • Sendpulse
    • QuizGO
    • Tilda
    • Linkrr
    • Vakas-Tools
  • Mailings
    • Pipelines
    • Manual mailings
    • Mailing list
    • Stop mailing
    • How to filter clients for mailing
    • Transferring the client base. Uploading Whatsapp numbers
  • To partners
    • How to transfer the project to the customer
  • How to...
    • FAQ
    • ...Create a simple chatbot
    • ...Transfer UTM-labels
    • ...Create a referral program
    • ...Create temporarily available content
    • ...Connect analytics counters and configuring conversions through GTM
    • ...Move clients to another block
    • ...Create personalized images
    • ...Create a menu in Telegram
    • ...Connect Telegram-pay
  • Payment Services
    • Page 1
  • Mini-landing
  • Special capabilities
    • Python programming
    • Generating a QR-code
    • Generating a barcode
    • Barcode recognition on an image
    • Using Google Sheets for mailings
    • Sending requests to messengers and email
    • Working with promo codes
  • Our services
    • Pricing
    • Training courses
  • Group 1
Powered by GitBook
On this page
  1. Special capabilities

Barcode recognition on an image

PreviousGenerating a barcodeNextUsing Google Sheets for mailings

Last updated 3 years ago

You can use this for creating a bot that scans product codes. A useful feature is the fact that it can also scan QR-codes

The address of the function that recognizes a barcode on an image is https://store.salebot.ai/function/cv2barcode

To scan an image you need to sends these parameters from the block:

{"photo":"the link to the barcode/QR-code or the variable with the link","api_key":"api access key from the settings"}

For example, to send an image for scanning you need to send these parameters:

In the arrow in the field “User enters data” enter the variable #{attachments}.

An example of the code

{"photo":"#{attachments}","api_key":"8629fe13ba9efebefd27a7afd701767f"}

Where “photo” is a link to the barcode image, in our case it’s the variable that holds the link to the image that was sent to the bot.

The next parameter is api_key - API access key from the project’s settings

The function works like this:

The client sends a picture of the barcode, the function demands for it to get scanned and, if successful, it sends the barcode as a number and the operation status equals “ok”

barcode -> "4500000000567" status -> "ok"

The status of scanning can be:

  • ok - the barcode was recognized

  • barcode not recognized - as you could’ve guessed, the barcode was not recognized

  • error image reading - again, self explanatory

  • error subscription - this functionality isn’t available to your type of subscription

The variable status can be set as a condition on an arrow and can send the client to the appropriate block

For example, if an arrow has a condition of the variable “status” and the value of “barcode not recognized” then we display the message “The code wasn’t recognized, try again” and send a second request for the photo.