草庐IT

API9Release

全部标签

php - Google Calendar API 日期时间

我正在尝试让GoogleCalendarApi正常工作。如果不使用我的$_POST日期时间,它就可以完美运行。但是日期是硬编码的,就像谷歌的那样,这不是我想要的。当我使用我的$_POST变量时,它向我显示了这个错误:Fatalerror:Uncaughtexception'Google_Service_Exception'withmessage'ErrorcallingPOSThttps://www.googleapis.com/calendar/v3/calendars/%40group.calendar.google.com/events?key=:(400)**Startande

javascript - 如何使用 API 获取 YouTube 视频缩略图?

关闭。这个问题需要detailsorclarity.它目前不接受答案。想改进这个问题吗?通过editingthispost添加细节并澄清问题.关闭6年前。Improvethisquestion我需要在我的站点中放置一个YouTube视频。这是视频网址:https://www.youtube.com/watch?list=PLx0NuvoQ5jfdEvOCFa8kRnfg5S7F3t_93&v=I-tBhNwVa7w如何使用API获取缩略图?

php - 如何为 PHP facebook SDK 的 Graph Api 获取长期访问 token ?

我试过以下方式但我收到错误“访问token不属于应用程序”我已经在我的应用程序ID和secretID中检查了很多时间,应用程序ID是正确的但是这个错误一次又一次地显示我没有peridict这个错误?而且我也尝试过以下方式https://graph.facebook.com/v2.2/oauth/access_token?grant_type=fb_exchange_token&client_id=CLIENT_ID&client_secret=SECREDCODE&fb_exchange_token=EAACEdEose0cBAJRZCZBIaDmW3oOO6SHaOkQLKdgyjp

php - Symfony Restful API - 公开当前登录用户喜欢的虚拟属性

有两个实体Restaurant和Users。餐厅实体与用户多对多关系,字段名favoriteBy。我正在使用JMSSerializer和FOSRestfulAPI。在餐厅列表API中,我必须公开一个额外的bool字段“isFavorite”,如果当前登录的用户在数组集合favoriteBy中,则该字段为真。如何找到当前用户是否在实体内收藏了餐厅?/***Getisfavorited*@JMS\VirtualProperty()*@JMS\Groups({"listing","details"})*/publicfunctionisFavorited(){//somelogicinent

php - 使用 Guzzle 将更新数据发布到 EventBrite API

我可以通过以下代码使用post添加事件://Createclient$client=newClient(['base_uri'=>'https://www.eventbriteapi.com/v3/',]);$params=['event.name.html'=>$this->Name,'event.description.html'=>$this->Description,'event.listed'=>false,'event.start.utc'=>$this->StartTime,'event.start.timezone'=>'Europe/London','event.en

php - Laravel 5.3 在 API 中过滤搜索数据

我正在为前端和移动应用程序实现一个API,现在我正在开发搜索功能,用户可以在其中键入列名或任何data我应该能够以JSON格式提供他们请求的数据所以我做了这个在我的Controller中publicfunctiongetSearchResults(Request$request){$data=$request->get('data');$search_drivers=Driver::where('agent_id','like',"%{$data}%")->orWhere('registration_center','like',"%{$data}%")->orWhere('regis

php - 我应该在服务器上使用什么 WooCommerce API?

我正在编写一个脚本来批量更改产品属性,例如价格、重量和尺寸。我需要直接在安装了WordPress(4.7.2)和WooCommerce(2.6.13)的服务器上运行脚本。我能想到的选项对我来说似乎并不理想:WooCommerce非RESTAPI将是我显而易见的选择,但它被降级为可怕的legacyfolder这有点过时了。WooCommerceRESTAPI(link)似乎有些矫枉过正:当我已经在服务器上并且只能使用PHP时,为什么还要通过身份验证并使用HTTP?考虑到WooCommerce产品属性之间的许多关系,通过update_post_meta()操作数据库似乎容易出错且难以维护;

javascript - 使用 JavaScript 的 Directions Google Map API

//ForTextBoxSearch..............google.maps.event.addDomListener(window,'load',function(){varplaces=newgoogle.maps.places.Autocomplete(document.getElementById('txtFrom'));google.maps.event.addListener(places,'place_changed',function(){varplace=places.getPlace();});varplaces1=newgoogle.maps.place

php - 对于 PHP REST API,如何在类定义之外定义/设置数据库连接参数?

我使用的是遍布整个网络的PHPRESTAPI示例。基本上是这样的:dbConnect();}privatefunctiondbConnect(){try{$this->db=newPDO("mysql:host=".self::DB_SERVER.";dbname=".self::DB_NAME,self::DB_USER,self::DB_PASSWORD);$this->db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);}catch(PDOException$e){echo"Connectionfailed:".$

php - Axios CORS/Preflight 因 Laravel 5.4 API 调用而失败

我在使用Laravel5.4和使用Axios处理请求的React应用程序时遇到问题。这是我遇到的错误。这是我对失败的预检响应的请求header。这是预检后失败的请求:这是我的Axios请求配置:letreq=axios({method:"GET",url:https://api.vendorgraphs.com/{queryStringHere}headers:{'Accept':'application/json','Content-Type':'application/json','Authorization':'Bearer'+accessToken}});需要注意的一件有趣的事