当我尝试查询 Twitter 的最近搜索端点时,/2/tweets/search/recent它会引发异常
{
"client_id": "xxxxx",
"required_enrollment": "Standard Basic",
"detail": "When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer app that is attached to a Project. You can create a project via the developer portal.",
"registration_url": "https://developer.twitter.com/en/portal/opt-in",
"title": "Client Forbidden",
"reason": "client-not-enrolled",
"type": "https://api.twitter.com/2/problems/client-forbidden"
}
Run Code Online (Sandbox Code Playgroud)
附加信息
授权 Oauth 1.0
签名方法 HMAC-SHA1
还提供消费者密钥、秘密、访问令牌、令牌秘密
为什么会这样?当我搜索此错误时,我没有得到任何有用的信息When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens …
使用rest api我可以创建一个帖子,获取博客类别等但我无法上传我引用的图像
https://github.com/WP-API/client-php/blob/master/library/WPAPI/Media.php
和
http://wp-api.org/#entities_media-meta_width
我的代码是
$data = array('file'=>$filePath,'is_image'=>true);
print_r($data);
$headers = array('Content-Type' => 'application/octet-stream');
$response = $this->api->post(WPAPI::ROUTE_MEDIA, $headers, $data);
Run Code Online (Sandbox Code Playgroud)
他们谈论[$ response in $ response = $ this-> api-> post(WPAPI :: ROUTE_MEDIA,$ headers,$ data);] $ data中使用的键值对是什么?
我目前正在研究基于 yii2 的 Rest api。我使用不记名令牌进行用户身份验证。让我解释一下要求。
1)第一个用户使用他们的凭据从外部 php 应用程序进行身份验证。
2)他/她获得了一个访问令牌。
3) 使用此访问令牌发出每个后续请求。
public static function findIdentityByAccessToken($token, $type = null)
{
return static::findOne(['auth_key' => $token]);
}
Run Code Online (Sandbox Code Playgroud)
这是我开始思考的地方。我没有找到访问令牌的任何过期时间。真的需要吗?如果是,我该如何存档?提前致谢。