无权使用Datastream错误消息(Royal Mail Shipping API)

时间:2015-10-14 13:44:50

标签: php api soap stream soap-client

我正在使用皇家邮政运输API来“创建运送请求”&创建'印刷标签'。

印刷标签请求可以通过多种方式完成,我希望以PNG格式获取此打印标签,这可以通过将“PNG”作为参数使用API​​轻松完成。但是由于某些原因,当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;

任何人都可以建议我为什么这样做'没有使用数据流错误的权限'?

1 个答案:

答案 0 :(得分:3)

Royal Mail默认禁用PNG标签生成,我必须要求打开它。