Go to Post IF teams did NOT READ THE FIRST MANUAL AND Q&A SITE, it is not FIRST's fault, it is the TEAM'S fault - sburro [more]
Home
Go Back   Chief Delphi > Other > FIRST-related Organizations > The Blue Alliance
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 27-02-2008, 12:25
FRANK(WGH) FRANK(WGH) is offline
Webmaster - delphielite.com
AKA: Frank
FRC #0048 (Delphi E.L.I.T.E.)
Team Role: Webmaster
 
Join Date: Nov 2001
Rookie Year: 2001
Location: Warren, OHIO
Posts: 88
FRANK(WGH) will become famous soon enough
Send a message via AIM to FRANK(WGH)
[TBA]: Issues with TBA API

I just downloaded the TBA API and placed it on my server. I thought that the API would work pretty much right out of the box, but I can't get it to work. I inserted my API Key and changed the team number to reflect my team. I checked that php5 is installed on the server. The "Team History" (api_team_history.php) script seems to be working, but it's not pulling any data. In fact, it doesn't seem to be pulling any of the information it needs from the API client file(tba_api_client_PHP5.php).

Here's the page I set up to test the API. http://delphielite.com/tba.php
This page is strictly the Team History code placed inside of an HTML page. Nothing special. All I get is a few of the echos from the team history page but no real information.

Can anyone help me get this working.
__________________
Frank Bosak
Collegiate Mentor Association
Team 48 - Delphi E.L.I.T.E.
Reply With Quote
  #2   Spotlight this post!  
Unread 27-02-2008, 12:52
Greg Marra's Avatar Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
no team (The Blue Alliance)
Team Role: RoboCoach
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,030
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
Re: [TBA]: Issues with TBA API

I just set up my own install, and things work fine. I suspect your API key is failing to authenticate somehow.

In tba_api_client_PHP5.php, did you change [[$api_key = ""; //replace with your API key]] to be your API key in quotes? If you left the quotes out, your api key will be "0", which isn't going to work.
__________________
Formerly Bobcat Robotics - Team 177 and X-Factor - Team 2124, now The Blue Alliance
Reply With Quote
  #3   Spotlight this post!  
Unread 29-02-2008, 09:27
FRANK(WGH) FRANK(WGH) is offline
Webmaster - delphielite.com
AKA: Frank
FRC #0048 (Delphi E.L.I.T.E.)
Team Role: Webmaster
 
Join Date: Nov 2001
Rookie Year: 2001
Location: Warren, OHIO
Posts: 88
FRANK(WGH) will become famous soon enough
Send a message via AIM to FRANK(WGH)
Re: [TBA]: Issues with TBA API

when trying to echo the API key, nothing is returned. Not even a value of zero.
I did place the API key inside the quotes. This is why I'm so confused. It's like the client page isn't being included, but I see no reason for it not to be.
__________________
Frank Bosak
Collegiate Mentor Association
Team 48 - Delphi E.L.I.T.E.
Reply With Quote
  #4   Spotlight this post!  
Unread 29-02-2008, 09:46
Greg Marra's Avatar Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
no team (The Blue Alliance)
Team Role: RoboCoach
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,030
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
Re: [TBA]: Issues with TBA API

I find that really baffling. I don't see why your include would fail.

Try echoing something else from the main library?

Could there be something wrong with the chmodding of files that would make them not include?

__________________
Formerly Bobcat Robotics - Team 177 and X-Factor - Team 2124, now The Blue Alliance
Reply With Quote
  #5   Spotlight this post!  
Unread 03-03-2008, 09:22
FRANK(WGH) FRANK(WGH) is offline
Webmaster - delphielite.com
AKA: Frank
FRC #0048 (Delphi E.L.I.T.E.)
Team Role: Webmaster
 
Join Date: Nov 2001
Rookie Year: 2001
Location: Warren, OHIO
Posts: 88
FRANK(WGH) will become famous soon enough
Send a message via AIM to FRANK(WGH)
Re: [TBA]: Issues with TBA API

Well, it seems that the reason I couldn't echo the api_key is because it was enclosed in the tba_send_request function. Once I brought it out, I was able to echo the key.

I don't know too much about functions, so I'm wondering how you call one of these functions in your code. Does it just execute, or do you have to call it?
__________________
Frank Bosak
Collegiate Mentor Association
Team 48 - Delphi E.L.I.T.E.
Reply With Quote
  #6   Spotlight this post!  
Unread 03-03-2008, 09:31
FRANK(WGH) FRANK(WGH) is offline
Webmaster - delphielite.com
AKA: Frank
FRC #0048 (Delphi E.L.I.T.E.)
Team Role: Webmaster
 
Join Date: Nov 2001
Rookie Year: 2001
Location: Warren, OHIO
Posts: 88
FRANK(WGH) will become famous soon enough
Send a message via AIM to FRANK(WGH)
Re: [TBA]: Issues with TBA API

Where do you specify
PHP Code:
$method 
in
PHP Code:
function tba_send_request($method$arguments=array()) 
?

I'm just a beginner in PHP, so please bear with me. This is all the original code, except for the addition of the api key and the team number. I started to toy with echo statements after it wouldn't work and I have since then removed those.

I've chmodded the files to 777. No change.
__________________
Frank Bosak
Collegiate Mentor Association
Team 48 - Delphi E.L.I.T.E.
Reply With Quote
  #7   Spotlight this post!  
Unread 09-03-2008, 03:23
Greg McCoy's Avatar
Greg McCoy Greg McCoy is offline
boiler up!
FRC #3940 (CyberTooth)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 2002
Location: Kokomo, IN
Posts: 484
Greg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond reputeGreg McCoy has a reputation beyond repute
Send a message via AIM to Greg McCoy
Re: [TBA]: Issues with TBA API

Quote:
Originally Posted by FRANK(WGH) View Post
Where do you specify
PHP Code:
$method 
in
PHP Code:
function tba_send_request($method$arguments=array()) 
?
You shouldn't directly call tba_send_request, this is a sort of "private" helper function. Instead, you call make_array(), get_events(), get_matches(), etc. These functions are the ones that call tba_send_request, and they fill in $method.


You're sure that PHP is installed correctly? You could try this short script to make sure...if PHP is installed okay it will return a web page with information about your PHP/system configuration. If PHP is installed correctly, all you should have to do is fill in your API key, and put both files in the same directory on your web server and then view api_team_history.php with a web browser.

PHP Code:
<?php
  phpinfo
();
?>
Hope this helps...

Last edited by Greg McCoy : 09-03-2008 at 03:28. Reason: improved clarity
Reply With Quote
  #8   Spotlight this post!  
Unread 17-03-2008, 11:39
FRANK(WGH) FRANK(WGH) is offline
Webmaster - delphielite.com
AKA: Frank
FRC #0048 (Delphi E.L.I.T.E.)
Team Role: Webmaster
 
Join Date: Nov 2001
Rookie Year: 2001
Location: Warren, OHIO
Posts: 88
FRANK(WGH) will become famous soon enough
Send a message via AIM to FRANK(WGH)
Re: [TBA]: Issues with TBA API

PHP is working fine on the site. In fact, most of our site is in PHP.
Does PHP need to be configured any certain way? I believe safe mode is turned on by default.
__________________
Frank Bosak
Collegiate Mentor Association
Team 48 - Delphi E.L.I.T.E.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Test new TBA feature Greg Marra The Blue Alliance 25 28-03-2008 04:31
[TBA] The Blue Alliance API cjelly The Blue Alliance 9 24-02-2008 23:37
[VIDEO] TBA Match Archives Greg Marra General Forum 16 25-03-2007 12:21
[TBA] TBA Presents... Soldering and Multimeter Tutorials Greg Marra General Forum 0 27-01-2007 20:15
[TBA] The Blue Alliance Greg Marra Technical Discussion 41 20-12-2006 23:28


All times are GMT -5. The time now is 19:46.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi