我正在尝试获取已发送消息(sms)的详细信息,但它返回NULL。 在$ url中,我传递了发送消息时收到的uri。我在做错什么吗?
<?php
// test credentials
$id = "xx";
$token = "yy";
$url = "/2010-04-01/Accounts/aa/Messages/bb.json";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "$id:$token");
curl_setopt($ch, CURLOPT_POST, true);
$retval = curl_exec($ch);
curl_close($ch);
$obj = json_decode($retval);
var_dump($obj);
与发布的here
几乎相同