编程语言
首页 > 编程语言> > php-没有使用Datastream错误消息的权限(皇家邮件运输API)

php-没有使用Datastream错误消息的权限(皇家邮件运输API)

作者:互联网

我正在使用Royal Mail Shipping 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;

谁能说出为什么我得到这个“无权使用数据流错误”的信息吗?

解决方法:

Royal Mail默认情况下会禁用PNG标签生成,因此我不得不要求将其打开.

标签:api,stream,soap-client,php,soap
来源: https://codeday.me/bug/20191119/2037301.html