"400 Bad Request Bad Request" in App Inventor 2

1,510 views
Skip to first unread message

Wiktor Jurczyszyn

unread,
Apr 15, 2015, 4:42:09 PM4/15/15
to mitappinv...@googlegroups.com
Hello,
I've recently started programming in App Inventor 2. I made a program similar to Pizza Party but I was receiving 400 BAD REQUEST over and over again. So i decided to download original Pizza Party, unfortunately I'm having the same issue. I created new Fusion Tables and new API. Where am I making mistake?

Do It Result: INSERT INTO 10Uv9d_qQmXPufhYCucLO71wKAM94to2l2T0lkahe (Date, Name, Pizza, Drink, Comment) VALUES ('15 kwi 2015 22:34:11', 'r', 'Hawaiian', 'Sprite', 's')

Error's text : 400 Bad Request Bad Request

Screen of Fusion Table:
http://scr.hu/0jek/jaoqv

Thanks in advance

Taifun

unread,
Apr 15, 2015, 5:08:17 PM4/15/15
to mitappinv...@googlegroups.com
the Do it result looks fine, probably a setup problem?
see here 

please add a screenshot of your relevant blocks directly into this thread

alternatively you can try the service account method instead

Taifun


Wiktor Jurczyszyn

unread,
Apr 15, 2015, 7:52:09 PM4/15/15
to mitappinv...@googlegroups.com
Thanks for answer. I'm sure I don't have "Frequently Made Errors...". I deleted everything(API,tables...) and made it from scratch (but still original Pizza Party). Now, for some reason, I have 403 Forbidden Forbidden Error. I'm pretty sure i'm not "trying to access the table with another account". I know that I'm making somewhere a stupid mistake, but now I really have no idea where to look for it. PS. Sometimes I still don't know what is obvious or relevant (I'm newbe), so forgive me.

Taifun

unread,
Apr 15, 2015, 11:55:40 PM4/15/15
to mitappinv...@googlegroups.com
do the pizza party tutorial and follow the setup instructions EXACTLY
Taifun


if you get 403 Forbidden Forbidden, its because of this:

403 Forbidden Forbidden.

Trying to query a table with a Google account, which does not have permission to access the table

You set up the API key in the API Console using your Google account. Now you are trying to access the table with another account. Grant access to the table for the other account or use your first Google account instead.

RQ

unread,
Apr 23, 2015, 5:44:33 PM4/23/15
to mitappinv...@googlegroups.com
I am getting the same error for an app that should collect your location when you hit submit and store it in fusion tables:

here's my Join statement SQL:

Do It Result:  INSERT INTO  1g2Km7lDVHvIDbF5P4PNUhLFtaBKpI7s2HzciGfQT  (Date, UserID, TripID, Route, Latitude, Longitude) VALUES ('23 Apr 2015 17:34:36','','','','','')
---

Screenshot_2015-04-23-17-39-12.png
Screenshot_2015-04-23-17-39-14.png

Taifun

unread,
Apr 23, 2015, 5:55:07 PM4/23/15
to mitappinv...@googlegroups.com
@RQ: please first do the Pizza Party tutorial to learn how to work with fusiontables
Pizza Party with Fusion Tables for App Inventor 2

well unfortunately "400 Bad Request Bad Request" doesn't tell us much... strange error... that error is not in my list, see also here...
your sql statement looks fine, however, did you define the columns latitude and longitude as numeric? if yes, you should not quotify numeric values...

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         


RQ

unread,
Apr 23, 2015, 6:02:18 PM4/23/15
to mitappinv...@googlegroups.com
Hi Taifun

Thanks for the reply. I defined Latitude and Longitude columns as 'Location' in the fusion table. should i define them as text?

Attaching my blocks
blocks.png

RQ

unread,
Apr 23, 2015, 7:52:21 PM4/23/15
to mitappinv...@googlegroups.com
I  changed the call.resetform in when button1 submit block  to call.insertdataintable. that hasnt fixed the issue.

The route field is defined as text in the fusion table but is a number 1 2 or 3 that can be picked from the list. is that the issue? 
should i unquotify location?

Taifun

unread,
Apr 23, 2015, 9:14:46 PM4/23/15
to mitappinv...@googlegroups.com
there are 2 methods to connect to the fusiontable
1) the API key method
2) the service account method
you have a mixture of both, you should use only one option
first get the Pizza Party successfully running using the API key method...

Taifun

RQ

unread,
Apr 23, 2015, 9:18:17 PM4/23/15
to mitappinv...@googlegroups.com
Thanks Taifun.

We need a service account method since our app (for a class project) requires different people to be able to submit data into the fusion table.

I will drop the api key method. Thanks!

Taifun

unread,
Apr 24, 2015, 9:24:10 AM4/24/15
to mitappinv...@googlegroups.com
the first step is to get the most simple example running, which is the Pizza Party tutorial together with the API key method
the second step then could be to use the service account method instead
and the third step is to adjust it to your needs

please start with the first step!
Taifun
Reply all
Reply to author
Forward
0 new messages