Discussion Forums  >  Self Hosted Control Panels

Replies: 8    Views: 154

Stefan
buzztouch Evangelist
Profile
Posts: 558
Reg: Dec 21, 2010
Sweden
14,780
03/13/12 08:09 AM (12 years ago)

Something Went Wrong. Buzztouch API return invalid JSON

Hi BT crew I get this error when trying to download one of my apps from my own hosted BT server. Can you fix this or is there something I should do? BR/Stefan
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/13/12 08:28 AM (12 years ago)
Depends on whats causing it. It's super tough to diagnose errors on your box - for obvious reasons. You're going to have to try to sleuth this out because we don't have access to your backend. a) You land on bt_appDownload.php to package the project. Look at your address bar, it's in the BT-server/bt_v15/bt_app directory. b) You click "package project" When you click, a file in the background is triggered. The background file isn't something you see but you can when you need to test it. This file that runs in the background is the one that actually makes the request to the BT API. It's in the same folder and it's named bt_app_download_AJAX.php OK, understanding that. The idea is that you can enter the path to this file in your regular browsers address bar so you can see the actual results beging returned from the API. The results will be a basic JSON string of data. 1) Visit the apps download project screen. Copy the URL in the address bar to your mouse. 2) Open a new browser window, paste the URL. Load it. Same screen will show, the package app screen. 3) Modify the URL slightly - add the _AJAX.php. The file names are nearly the same, just change the URL to include the _AJAX.php part. You should be looking at... domain.../BT-server/bt_v15/bt_app/app_download_AJAX.php?appGuid=[long id for app] You also need to append the version to package. Like this: domain.../BT-server/bt_v15/bt_app/app_download_AJAX.php?appGuid=[long id for app]&whatVersion=ios Refresh this URL. You should see the JSON values returned from the server. These will be the error like: {"status":"error", "message":"Buzztouch API return invalid JSON"} So far so good. Refreshing the URL over and over again should produce the same error message. Cool. Next, we need to figure out why it's doing this. Some possible examples are invalid API key (reset your API secret maybe?), no CURL package on your server (software uses CURL to make the background request to the API), and a few others. If you're daring, you can look at the app_download_AJAX.php file in an editor. Have a look at the method called: fnGetBuzztouchPackageUsingAPI on about line 141. This is the method that uses CURL to connect to the API. You could do some echo statements here while you refreshed the browser, to see where the error is happening? Lastly: If this is overwhelming, we could connect with FTP and get a look if you want. In order to do this, we'll need a temporary login for the control panel (make a new user) and an FTP login. In this case, send this info to the email address on our contact us screen (it's different because our inbound mail is still lost in the interwebs!)
 
Stefan
buzztouch Evangelist
Profile
Posts: 558
Reg: Dec 21, 2010
Sweden
14,780
like
03/13/12 08:34 AM (12 years ago)
Thanks for the firm expedition kind of feedback @David LOL! I'll look into your suggestions later on tonight - yes it's late afternoon here in "coldville". On my way home to the cave. Keep you posted BR/Stefan
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
03/13/12 01:16 PM (12 years ago)
I also have the same problem Stefan, please keep me posted as to what works for you (as I will do the same). I read somewhere it has to do with something on certain page that we create in the control panel that is messing with the code...but i could be way off...
 
Stefan
buzztouch Evangelist
Profile
Posts: 558
Reg: Dec 21, 2010
Sweden
14,780
like
03/13/12 02:06 PM (12 years ago)
Hello again! It was a easy fix. All I needed to do was to reset my API-key BUT also did I remove the https in the url - didn't work to validate my APIkeys. So you might check that @MM2000. Now everything is working again. Once again thanks for all your help @David BR/Stefan
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
03/13/12 02:23 PM (12 years ago)
How do I reset my api key? can i do that on 1.4?
 
Stefan
buzztouch Evangelist
Profile
Posts: 558
Reg: Dec 21, 2010
Sweden
14,780
like
03/13/12 02:46 PM (12 years ago)
@MM2000 - I thought you had BT-Server on your own server. If not I don't know how you can (if you can) reset or if it's the BT crew that must do that. Sorry but I feel like I can't help you here. BR/Stefan
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
03/13/12 03:15 PM (12 years ago)
yeah, didn't realize where this question was until just now...hopefully they will respond...
 
macthehatter
buzztouch Evangelist
Profile
Posts: 25
Reg: Sep 18, 2011
macedonia
4,450
like
07/26/13 05:53 PM (10 years ago)
Should i assume,that if i do not yet have my api key that this error will continue,until such a time,when i achieve/add an api key?
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.