Dynamics 365 整合指南

使用我們安全的雲端 API,直接在您的 D365 環境中生成高品質條碼。


身份驗證: OAuth2 Client Credentials 所需權限範圍 (Scope): barcode:generate
1

獲取您的憑據

購買後,您將通過電子郵件收到 Client IDClient Secret。在請求令牌時,請確保包含 barcode:generate 權限範圍。

身份驗證終端點: POST https://www.barcodesoft.com/api/auth/token
2

配置 Power Automate (推薦)

整合 Dynamics 365 最簡單的方法是通過 Power Automate 流。這使您能夠在整個 Dataverse 實體中實現條碼生成的自動化。

  • 觸發器: 當新增或修改資料列時 (Dataverse)。
  • 操作:/api/auth/token 發送 HTTP 請求以獲取存取令牌。
  • 操作:/barcode/v1/qrcode 發送 HTTP 請求,並在請求標頭中使用 Bearer 令牌。
3

AL 程式碼實現 (Business Central)

在 Business Central 的擴充功能中,使用以下程式碼片段處理身份驗證和條碼生成:

// 1. 獲取帶有 Scope 的 OAuth 令牌
HttpClient.DefaultRequestHeaders.Add('Accept', 'application/json');
Content.WriteFrom('{"grant_type":"client_credentials","client_id":"您的ID","client_secret":"您的密鑰","scope":"barcode:generate"}');
if HttpClient.Post('https://www.barcodesoft.com/api/auth/token', Content, Response) then begin
    Response.Content.ReadAs(ResponseText);
end;

HttpClient.DefaultRequestHeaders.Add('Authorization', StrSubstNo('Bearer %1', AccessToken));
if HttpClient.Get('https://www.barcodesoft.com/barcode/v1/qrcode/?data=Testing&isgs1=false&width=360&height=150&imageformat=svg', Response) then begin
end;
4

顯示條碼

API 返回圖像流 (PNG/JPG/SVG)。在 D365 Sales 中,將回應存儲在圖像欄位中。在 Business Central 中,使用 TempBlob 將資料流式傳輸到 Media 或 Blob 欄位中。


即時存取 Barcodesoft 雲端服務

訂閱可為您的 Dynamics 365 整合提供 GS1-128、QR Code、DataMatrix 與 Code 128 的無限制產生能力。 憑證將立即透過電子郵件寄送[cite: 3, 4]。

即時設定 OAuth 2.0 安全[cite: 3, 4] 支援 600 DPI[cite: 3, 4]

需要技術支援嗎?

我們的工程團隊可以協助您進行自定義的 AL、C# 或 PowerPlatform 開發整合。

← 返回 Cloud Barcode API 首頁