Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/248.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 没有使用Datastream error mesage(皇家邮政配送API)的权限_Php_Api_Soap_Stream_Soap Client - Fatal编程技术网

Php 没有使用Datastream error mesage(皇家邮政配送API)的权限

Php 没有使用Datastream error mesage(皇家邮政配送API)的权限,php,api,soap,stream,soap-client,Php,Api,Soap,Stream,Soap Client,我正在使用皇家邮政配送API“创建发货请求”和“创建打印标签” 打印标签请求可以通过多种方式完成,我希望以PNG格式获得此打印标签,通过将“PNG”作为参数传递给API可以轻松完成。但是,由于某些原因,我在转储响应错误时出现以下错误: [errorCode] => E1184 [errorDescription] => No permission to use Datastream 我的代码如下:- public function PrintLabel($shipmentNumbe

我正在使用皇家邮政配送API“创建发货请求”和“创建打印标签”

打印标签请求可以通过多种方式完成,我希望以PNG格式获得此打印标签,通过将“PNG”作为参数传递给API可以轻松完成。但是,由于某些原因,我在转储响应错误时出现以下错误:

[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;

有人能告诉我为什么会出现“不允许使用数据流错误”吗?

英国皇家邮政默认情况下禁用PNG标签生成,我必须请求将其打开。

最明显但不一定正确,问题是身份验证-您是否按照api预期的方式提供了正确的凭据?凭据都是正确的-我正在使用同一个类执行另一个“创建装运”的操作,该操作按预期工作。