API connector help needed

Hi all,

A relatively new Bubbler here. We are using Bubble for prototyping purposes. One thing I am working on, is making a picture of a business card, running it through OCR (using ABBYY API now) and then sending a message to the extracted email or phone.
I’m stuck. I have also tried to get the OCRspace api plugin to work, but no luck so far.
I’m posting the Postman screens of what I have achieved there and would like to get some help to setting this up in Bubble.

  1. Getting the picture taken. I’ve gathered there is no native Bubble functionality for accessing the camera, so the picture uploader will have to do for now. Although I was thinking to try the toolbox to use HTML5 for that.
  2. Processing the picture on the API.
  3. Getting the taskID from that first processed image and asking the status (gettaskStatus)
  4. If the task is completed, getting the resulting file and extracting the fields into email and phone

    (I’ve created the datatype ‘BusinessCard’ with image, OCRtext, email and phone).
    Note that for step 4, I cannot use the basic auth I’ve setup for the first two requests.

When entering this information into Bubble, I choose JSON, action (because I want to use the workflow) and result XML. I enter the parameters as form-type.
I’ve managed to figure out that of all the response headers, only body contains the info I’m looking for, but as one giant XML text blob. Not with the different parameters within this XML.
How do I get the parameters and formatting in order?
20171219_ABBYY Bubble 1

As an added bonus question, I just found out that the second request returns something like:
https://ocrsdk.blob.core.windows.net/files/ea450028-6b7f-4fac-b880-e76af87e5290.result?sv=2012-02-12&se=2017-12-20T17%3A00%3A00Z&sr=b&si=downloadResults&sig=G2IEPYAK0HQtmrnoIBRquHOGVZbNUnyksO5pdwwFTBs%3D
In which I have to remove amp; or rather replace “& amp;” with & . My guess I need to use something like a regular expression in Bubble to handle this sort of text operations? Any tutorial on that?

Help is much appreciated! Also if you can point towards a manual or tutorial on API connector that I’ve apparently missed.
Thanks,
Niek.

3 Likes