Outlook rest api oauth2 php CURL 调用期间 HTTP 错误 400
Outlook rest api oauth2 php HTTP error 400 during CURL call
执行 outlook restapi v2.0 的 PHP 快速启动代码以使用 oauth2 授权访问邮件。
完整代码可以在这里查看 - "outlook.php"
下的“https://dev.outlook.com/RestGettingStarted/Tutorial/php”
范围:https://outlook.office.com/mail.read
token_type:承载者
我收到了 access_token、expires_in、id_token 和 id_token_expires_in
expires_in 值为 3600
public static function getMessages($access_token, $user_email) {
$getMessagesParameters = array (
// Only return Subject, ReceivedDateTime, and From fields
"$select" => "Subject,ReceivedDateTime,From",
// Sort by ReceivedDateTime, newest first
"$orderby" => "ReceivedDateTime DESC",
// Return at most 10 results
"$top" => "10"
);
...
是否需要对“$getMessagesParameters”进行任何更改?我尝试删除所有内容,但仍然无效!(给出 400 HTTP 错误)
最近我们访问 outlook rest api 资源的方式是否有任何修改?
更新:
我使用 hotmail 帐户创建应用程序并使用相同的帐户访问邮件。是因为 hotmail.com 的邮件没有与 outlook.com 邮件服务完全集成吗?
现在错误代码更改为“404”
在 Outlook 沙盒中检查过,他们声明用户收件箱应该启用 REST API 才能正常工作。
这不是“”的副本(发问者在通讯录和日历方面有问题,但在邮件方面没有问题)
所以你是说你在沙盒中遇到错误?如果您收到您的邮箱未启用 REST API 的错误,那么这就是问题的原因。 Outlook.com 个帐户(包括 Hotmail.com 个)正在分批启用,而您的尚未启用。目前无法按需启用它们,因此您只能等待该邮箱。
如果您想立即测试,可以在北美创建一个新的 Outlook.com 帐户,并且应该立即为 API 启用。
执行 outlook restapi v2.0 的 PHP 快速启动代码以使用 oauth2 授权访问邮件。
完整代码可以在这里查看 - "outlook.php"
下的“https://dev.outlook.com/RestGettingStarted/Tutorial/php”范围:https://outlook.office.com/mail.read
token_type:承载者
我收到了 access_token、expires_in、id_token 和 id_token_expires_in
expires_in 值为 3600
public static function getMessages($access_token, $user_email) {
$getMessagesParameters = array (
// Only return Subject, ReceivedDateTime, and From fields
"$select" => "Subject,ReceivedDateTime,From",
// Sort by ReceivedDateTime, newest first
"$orderby" => "ReceivedDateTime DESC",
// Return at most 10 results
"$top" => "10"
);
...
是否需要对“$getMessagesParameters”进行任何更改?我尝试删除所有内容,但仍然无效!(给出 400 HTTP 错误)
最近我们访问 outlook rest api 资源的方式是否有任何修改?
更新: 我使用 hotmail 帐户创建应用程序并使用相同的帐户访问邮件。是因为 hotmail.com 的邮件没有与 outlook.com 邮件服务完全集成吗?
现在错误代码更改为“404”
在 Outlook 沙盒中检查过,他们声明用户收件箱应该启用 REST API 才能正常工作。
这不是“
所以你是说你在沙盒中遇到错误?如果您收到您的邮箱未启用 REST API 的错误,那么这就是问题的原因。 Outlook.com 个帐户(包括 Hotmail.com 个)正在分批启用,而您的尚未启用。目前无法按需启用它们,因此您只能等待该邮箱。
如果您想立即测试,可以在北美创建一个新的 Outlook.com 帐户,并且应该立即为 API 启用。