2015-10-14 93 views
3

我正在使用Royal Mail Shipping API'創建貨件請求'&來創建'打印標籤'。沒有權限使用Datastream錯誤消息(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; 

任何人都可以說明爲什麼我得到這個「不許可使用數據流錯誤'?

+0

最明顯但不一定正確的問題將是身份驗證 - 您是否以api的預期方式提供了適當的憑據? – RamRaider

+0

憑證都是正確的 - 我使用相同的類來執行另一個「創建貨件」的操作,並按預期工作。 – Zabs

回答

3

皇家郵政默認禁用PNG標籤生成,我不得不請求打開它。

相關問題