Anuj Puri
Posts: 0
Joined: Wed Dec 31, 2014 4:24 pm

Barcode Scan Google Search

Hello, I'm somewhat new to using appery and creating mobile apps in general. I'm trying to create a barcode scanning function for my app where it scans a barcode, searches the barcode on google and then returns the result (the name of the item the barcode refers to) and displays the result. So for example, if the app scans the barcode on the back of a book, it would perform a background google search and then display the book's name/title on the screen. Or, if the app scans the barcode on a box of crackers, the cracker name shows. How do I go about doing this?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Barcode Scan Google Search

Hi Anuj,

Here is a brief plan for it:

  1. Get data from barcode scaner.
    How to do it: http://devcenter.appery.io/tutorials/...

  2. Create search service on needed 3rd party API.
    Here is details about services: http://devcenter.appery.io/documentat...

  3. Pass data from barcode scaner to search service. And link service result to the page to see results.
    Here is tutorial to learn: http://devcenter.appery.io/tutorials/...

    Regards.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Barcode Scan Google Search

Hi Anuj,

It seems you don't pass query object.

Try this URL instead of yours:

precode

https://api.semantics3.com/v1/products?q={"cat_id":13658,"brand":"Toshiba","model":"Satellite"}

/code/pre

Regards.

Anuj Puri
Posts: 0
Joined: Wed Dec 31, 2014 4:24 pm

Barcode Scan Google Search

Correct, I tried that and the api call worked(by placing that entire URL into the REST URL, however that doesn't allow me to change the value of cat_id or of brand.

How do i get this to work where I can then add cat_id and brand as request query strings, which I can then change based off other data that the I input into the app?

I thought the URL should only be ttps://api.semantics3.com/v1/products?q= and then set cat_id and brand as request query strings with empty values.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Barcode Scan Google Search

Anuj,

You need to:

  1. Use URL: "codehttps://api.semantics3.com/v1/products/code"

  2. Open request tab and add query string parameter with name "q" and value code{"cat_id":13658,"brand":"Toshiba","model":"Satellite"}/code

  3. Test it on "test" tab.

  4. If it returns you correct response - you can use this "q" parameter to set dynamic value in datasource mapping.

    Regards.

Anuj Puri
Posts: 0
Joined: Wed Dec 31, 2014 4:24 pm

Barcode Scan Google Search

Excellent. Thank you! That worked with their test URL, which doesn't require oauth. Now i'm trying to get it working with their production URL and I'm getting an oauth error. I've followed this: http://devcenter.appery.io/tutorials/...
in order to setup oauth. Now, the semantics directions tell me to install their .js file, using npm install semantics3-node. how do I do this? I tried importing their .js files and running a test javascript, but it fails. this is what i'm trying to follow now: https://github.com/Semantics3/semanti...

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Barcode Scan Google Search

Hi Anuj,

Unfortunatly that code wrote for node.js - not for browser.

So you can not use this code in Appery.io without editing this code.

Regards.

Anuj Puri
Posts: 0
Joined: Wed Dec 31, 2014 4:24 pm

Barcode Scan Google Search

Alright. Thank you with your help!

Joe Beale
Posts: 0
Joined: Sun Dec 11, 2016 1:05 pm

Barcode Scan Google Search

Did you ever get the Semantics3 api to work?
I'm having similar issues, except I can't even get the test server to work.
Here's my settings on the rest, am I missing something? Image

Anuj Puri
Posts: 0
Joined: Wed Dec 31, 2014 4:24 pm

Barcode Scan Google Search

\""FIELDNAME1\"":\""VALUE1\""

Return to “Issues”