![]() |
Need help with X-TBA-App-Id Header for TBA API
What exactly am I supposed to put in the header when requesting?
For the FRC Events API V2.0 the header I use is "Authentication: Basic *my auth key*" What do I use for the TBA API Header? I have tried "frc3991:scouting-system:v01" and "X-TBA-App-Id: frc3991:scouting-system:v01" Neither have worked, I'm prob just missing something simple :P. Thanks for the help. |
Re: Need help with X-TBA-App-Id Header for TBA API
What you have should work just fine. Are you sure you're making the request with that header? If you're using a Web request function in a programming language, usually you have to set headers by name (something.setHeader("X-TBA-App-Id", "my:app:id") )
|
Re: Need help with X-TBA-App-Id Header for TBA API
this is probably very inneficient but for the FRC API i used a php method I found online
Code:
<?phpCode:
<?php |
Re: Need help with X-TBA-App-Id Header for TBA API
Quote:
|
Re: Need help with X-TBA-App-Id Header for TBA API
Something changed recently (not sure what), but sometimes you may have to send a User-Agent header string as well.
|
Re: Need help with X-TBA-App-Id Header for TBA API
Oh hell, i forgot to http:// in fornt of the url, the code was searching for the site locally without it, thanks for the help guys
Code that works if anyone cares: Code:
<?php |
Re: Need help with X-TBA-App-Id Header for TBA API
That's a very... "PHP" way of handling a lack of protocol, lol! Glad you got it all figured out.
|
Re: Need help with X-TBA-App-Id Header for TBA API
Quote:
|
Re: Need help with X-TBA-App-Id Header for TBA API
Hi, I had this same problem a while ago, where it would give me error 403, forbidden.
I found that I had to add a header called 'User-Agent' with "Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11)Gecko/20071127 Firefox/2.0.0.11" to make it think it was a web browser and wouldn't get blocked. My code for my (python) thingy is https://github.com/Cabey4/4613-Auto-Scout but it looks like you've already sorted it. But if anyone else gets a 403 forbidden error with the TBA/The Blue Alliance api that's probably why. |
Re: Need help with X-TBA-App-Id Header for TBA API
Quote:
Code:
pip install requests |
Re: Need help with X-TBA-App-Id Header for TBA API
Quote:
|
Re: Need help with X-TBA-App-Id Header for TBA API
Quote:
|
Re: Need help with X-TBA-App-Id Header for TBA API
Quote:
|
Re: Need help with X-TBA-App-Id Header for TBA API
I am also currently using file_get_contents() mostly because I am only ever fetching a JSON array once (and it's only needed to set up a MySQL database once per event for scouting) but how I am forming it is
Code:
$jsonurl = "http://www.thebluealliance.com/api/v2/event/$eventcode/teams?X-TBA-App-Id=frc2557:pnwscout:v01" |
| All times are GMT -5. The time now is 04:56. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi