【问题标题】:No permission to use Datastream error mesage (Royal Mail Shipping API)无权使用 Datastream 错误消息(Royal Mail Shipping API)
【发布时间】: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


【解决方案1】:

Royal Mail 默认禁用 PNG 标签生成,我必须请求将其打开。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多