草庐IT

api_token

全部标签

php - AWeber API "Method requires access to Subscriber information"错误故障排除

我正在尝试使用PHPSDK从AWeber列表中检索特定订阅者。代码:$subscribers=$account->loadFromUrl("/accounts/$account->id/lists/$list_id/subscribers");var_dump($subscribers->find(array('email'=>$email)));exit;问题是,我收到以下错误:WebServiceError:MethodrequiresaccesstoSubscriberinformation.Google空手而归。 最佳答案

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 - 使用 Symfony 获取未登录用户的安全 token

我如何才能为任何用户获取安全token,而不仅仅是当前登录的用户?我希望能够对从数据库中获取的用户调用isGranted() 最佳答案 isGranted()来自安全服务,因此在不调整session状态的情况下很难/没有必要使用它来获取角色。不要误会我的意思,这绝对有可能......这会起作用,例如:publicfunctionstrangeAction(){//GetyourUser,howeveryounormallygetit$user=$userRepository->find($id);//Savethecurrentto

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 - PHP 中的“贪心 token 解析”

什么是PHP中的“贪心token解析”?我在Codeigniter指南中找到了这个:“除非需要解析变量,否则始终使用单引号字符串,并且在确实需要解析变量的情况下,使用大括号防止贪婪的标记解析。”“我的字符串{$foo}”一个有很好解释的答案会有所帮助。谢谢!! 最佳答案 贪心token解析是指这样的事情:$fruit="apple";$amount=3;$string="Ihave$amount$fruits";可能的预期输出:“我有3个苹果”实际输出:“我有3个”当然,这是初学者的错误,但即使是专家有时也会犯错误!就个人而言,我根

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 - 在 header php 中使用 x-auth-token 发送请求

如何在YII中使用header将“x-auth-token”参数发送到服务器。我有这个代码$data=array('customerId'=>$userId);$getdata=http_build_query($data);$options=array('http'=>array('method'=>'GET','header'=>"Content-type:application/x-www-form-urlencoded\r\n"."Authorization:x-auth-token".$token."\r\n",'content'=>$getdata));$context=s