View Single Post
  #3   Spotlight this post!  
Unread 28-05-2016, 13:09
dirtbikerxz's Avatar
dirtbikerxz dirtbikerxz is offline
Captain | Driver | CAD | Junior
AKA: Rohit Gondi
FRC #3991 (KnightVision)
Team Role: Driver
 
Join Date: Nov 2014
Rookie Year: 2015
Location: Baton Rouge, LA
Posts: 446
dirtbikerxz has much to be proud ofdirtbikerxz has much to be proud ofdirtbikerxz has much to be proud ofdirtbikerxz has much to be proud ofdirtbikerxz has much to be proud ofdirtbikerxz has much to be proud ofdirtbikerxz has much to be proud ofdirtbikerxz has much to be proud ofdirtbikerxz has much to be proud ofdirtbikerxz has much to be proud of
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:
<?php
$opts = array(

  'http'=>array(

    'method'=>"GET",

    'header'=>"Authorization: Basic *My Auth Key*"

	)
);

$context = stream_context_create($opts);



$apiurl = "https://frc-api.firstinspires.org/v2.0/2016/matches/TXHO?tournamentLevel=qual&matchNumber=*";

$file = file_get_contents($apiurl, false, $context);
echo $file;
?>
That works so I tried to do the same thing with the TBA Api

Code:
<?php

$opts = array(

  'http'=>array(

    'method'=>"GET",

    'header'=>"X-TBA-App-Id: frc3991:scouting-system:v01"

	)
);

$context = stream_context_create($opts);

$apiurl = "www.thebluealliance.com/api/v2/team/frc3991/2016/events";
$file = file_get_contents($apiurl, false, $context);

echo $file;

?>
but I get nothing back... (also tried only frc3991:scouting-system:v01 without the X-TBA-App-Id: portion in the header, didn't work)
__________________

Team 3991: Driver since freshman (2015-), Captain since sophomore (2016-), CADer
"The human condition is not perfect. We are not perfect specimens, any of us. We're not robots." - Michael Ovitz
My posts may or may not reflect the views of my team, they are my opinions, and mine alone.
Reply With Quote