我有一个包含字段的融合表:用户名,描述,纬度,纵向,地理位置。我正在尝试通过google API创建一个包含信息的新行。我三重检查了融合表是否打开,tableid和apikey是否正确,并且我已经启用了Fusiontable API,配额为0%。我认为错误的要求必须是因为某些昏迷或引号,但说实话它完全逃脱了我。我尝试了不同的组合,但找不到错误。我得到的错误,在php中用于生成链接和链接本身的代码。任何想法都将不胜感激。
谢谢
链接返回:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "keyInvalid",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request"
}
}
Php代码:
$apikey = "AIzaSyB4BMlrZIlJB-Apo8t_dO9K18uL8O2s5TA";
$tableid = "1X0rFoG7Tt2Ocm2rE39wPuamZCrFiS4D32Odgbh03";
$username="webuser";
$description="nujkn";
$latitude="78";
$longitud="110";
$geolocation="98.8789, 150.1111";
$link = "https://www.googleapis.com/fusiontables/v1/query?sql=INSERT+INTO+".$tableid."+(username,description,latitude,longitud,geolocation)+VALUES+('".$username."','".$description."','".$latitude."','".$longitud."','".$geolocation."')&key={".$apikey."}";
生成的链接:https://www.googleapis.com/fusiontables/v1/query?sql=INSERT+INTO+1X0rFoG7Tt2Ocm2rE39wPuamZCrFiS4D32Odgbh03+(username,description,latitude,longitud,geolocation)+VALUES+(' webuser'' nujkn'' 78',' 110',&# 39; 98.8789')及键= {AIzaSyB4BMlrZIlJB-Apo8t_dO9K18uL8O2s5TA}
浏览器中的:https://www.googleapis.com/fusiontables/v1/query?sql=INSERT+INTO+1X0rFoG7Tt2Ocm2rE39wPuamZCrFiS4D32Odgbh03+(username,description,latitude,longitud,geolocation)+VALUES+(%27webuser%27,%27nujkn%27,%2778%27,%27110%27,%2798.8789%27)&key= {AIzaSyB4BMlrZIlJB-Apo8t_dO9K18uL8O2s5TA}