草庐IT

PHP eBay API GeteBayOfficialTime 调用返回 'Unsupported API call' 错误

我试图从eBay中提取卖家列表,但每次运行此代码时,我都会收到错误TheAPIcall"GeteBayOfficialTime"isinvalidornotsupportedinthisrelease我在装有ZendServer的Mac上运行它。PHP请求:define('XML_POST_URL','https://api.sandbox.ebay.com/ws/api.dll');$theData='MyAuthKey11Low2011-07-12T21:59:59.005Z2011-07-30T21:59:59.005ZReturnAll';$headers=array('Con

php - 私有(private) REST API

我们有RESTAPI,我们希望只有我们的域可以访问并且不发送欺骗请求。为此,我唯一想到的就是检查引荐来源$_SERVER['HTTP_REFERER']。然而docssaythat:Theaddressofthepage(ifany)whichreferredtheuseragenttothecurrentpage.Thisissetbytheuseragent.Notalluseragentswillsetthis,andsomeprovidetheabilitytomodifyHTTP_REFERERasafeature.Inshort,itcannotreallybetruste

php - 在 PHP 中通过 JSON API 获取 Youtube 订阅者数量

我想从这个JSON文件中获取订阅者计数值:http://gdata.youtube.com/feeds/api/users/googlechrome?v=2&alt=json这就是我所做的,但它不起作用。$youtube_url=json_decode(file_get_contents('http://gdata.youtube.com/feeds/api/users/googlechrome?v=2&alt=json'),true);$youtube_data=$youtube_url['entry']['yt$statistics']['subscriberCount'];

php - Google 日历 API - (403) 访问未配置'

我开发了一个使用GoogleCalendarAPI的应用程序。当我将其从开发环境移至测试环境时,我在GoogleAPI控制台中为其创建了新条目,并将该信息复制到config.php中。//Theapplication_nameisincludedintheUser-AgentHTTPheader.'application_name'=>'GoogleCalendarPHPStarterApplication',//OAuth2Settings,youcangetthesekeysathttps://code.google.com/apis/console'oauth2_client_i

php - FOSUserBundle 和 REST Api 调用 : How to use custom FormType?

我在我的Symfony2网站上使用FOSUserBundle。现在我正在开发一个API以允许通过RESTAPI调用进行注册。我已经覆盖了FOSUserBundle的RegistrationController:ApiRegistrationController.php:/***@Route("/user/",defaults={"_format"="json"},requirements={"_method"="POST"})**/publicfunctionregisterAction(Request$request){[...]$form=$formFactory->createF

php - Gmail PHP API 发送电子邮件

我正在尝试通过GmailPHPAPI(https://developers.google.com/gmail/api/v1/reference/users/messages/send)发送电子邮件。在我发送消息之前,一切似乎都正常。我的代码是:privatefunctioncreateMessage($email){$message=newGoogle_Service_Gmail_Message();$message->setRaw(strtr(base64_encode($email),'+/=','-_,'));//$emailisarawemaildatastringreturn

php - 使用服务帐户向 Google API 进行身份验证时出现 failedPrecondition 错误

我正在尝试使用适用于PHP的GoogleAPI2.0.0RC4从我自己的收件箱(作为项目所有者)获取给定的电子邮件。我有一个项目设置,一个已下载的JSON格式的身份验证文件,并且我已经在GoogleDevelopersConsole中启用了gmailAPI。但是,当我运行以下代码时,出现“错误请求”错误,原因是“failedPrecondition”。现在这让我相信访问权限有问题,但我不知道我需要在这里做什么。代码:setScopes(["https://www.googleapis.com/auth/gmail.readonly"]);$client->setApplicationN

php - 我正在尝试在 php 中使用亚马逊 api 代码,但它给了我不支持版本的错误,以下是我的代码

以下是我与php一起使用以通过amazonapi服务获取xml响应的代码,但它给我的错误代码如下所述。"AWSECommerceService","Operation"=>"ItemSearch","AWSAccessKeyId"=>"AKIAJYSYWXDOF5CWIK5A","AssociateTag"=>"unity0f-21","SearchIndex"=>"All","Keywords"=>"iphone","ResponseGroup"=>"Images,ItemAttributes,Offers");//Setcurrenttimestampifnotsetif(!iss

php - Dingo API - 如何在 url 中添加版本号?

我刚刚安装了Dingo,它似乎可以使用以下URL:http://website.dev/api/testhttp://website.dev/api/hello$api=app('Dingo\Api\Routing\Router');$api->version('v1',function($api){$api->get('test',function(){return'Test';});$api->get('hello',function(){return'Hello';});});我想在URL中包含v1版本,我该如何让它工作?当我尝试时:http://website.dev/api/

php - Laravel Passport "auth:api"中间件充当 "web, auth"中间件

我已经按照官方文档(https://laravel.com/docs/5.3/passport#introduction)中的描述为Laravel5.3设置了LaravelPassport包。我希望移动应用程序使用该API,因此我尝试实现密码授予token。我已经创建了一个密码授予客户端,并且token请求过程...$response=$http->post('http://my-app.com/oauth/token',['form_params'=>['grant_type'=>'password','client_id'=>'client-id','client_secret'=