【发布时间】:2016-01-12 15:29:17
【问题描述】:
我正在使用 Royal Mail Shipping API 来“创建发货请求”和“打印标签”。
打印标签请求可以通过多种方式完成,我想以 PNG 格式获取此打印标签,这很容易使用 API 通过传递“PNG”作为参数来完成。但是由于某种原因,当我 var_dump 响应错误时出现以下错误:
[errorCode] => E1184
[errorDescription] => No permission to use Datastream
我的代码如下:-
public function PrintLabel($shipmentNumber, $order_tracking_id, $outputFormat = 'PDF')
{
$time = gmdate('Y-m-d\TH:i:s');
$request = array(
'integrationHeader' => array(
'dateTime' => $time,
'version' => '2',
'identification' => array(
'applicationId' => $this->api_application_id,
'transactionId' => $order_tracking_id
)
),
'shipmentNumber' => $shipmentNumber,
'outputFormat' => $outputFormat, // PDF, DS, DSPDF, PNG, DSPNG
);
$type = 'printLabel';
$response = $this->makeRequest($type, $request);
return $response->label;
} // ef
$rm = new RoyalMailLabelRequest();
$response = $rm->PrintLabel('TTT000358756GB', '276831601444829801', 'PNG');
echo $response;
谁能告诉我为什么我得到这个“无权使用数据流错误”?
【问题讨论】:
-
最明显但不一定正确的问题是身份验证 - 您是否以 api 期望的方式提供了正确的凭据?
-
凭证都是正确的 - 我正在使用同一个类来执行另一个“创建货件”的操作,这可以按预期工作。
标签: php api soap stream soap-client