web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

How to Integrate DocuSign API with Business Central Using AL?

(7) ShareShare
ReportReport
Posted on by 37

Hi everyone 👋,

 

I need guidance on how to integrate DocuSign with Dynamics 365 Business Central using AL code.

 

My requirement is:


  • Run a report in Business Central

  • Convert it to PDF

  • Send the PDF directly to DocuSign using the REST API

  • DocuSign should email the signer automatically

  • Later I want to track the envelope status and download the signed document

  •  

I already have:


  • DocuSign Account (Developer/Sandbox)

  • Integration Key (Client ID)

  • Secret Key

  • Account ID

  • OAuth Token URL

  •  
 

What I need help with:


  1. How to generate OAuth Access Token from AL (client_credentials flow)

  2. How to build the envelope JSON in AL

  3. How to attach a Base64 PDF

  4. How to send /envelopes request using HttpClient

  5. Example AL code or best practices

  6. Any security tips


  7.  

If someone can share:


  • AL code sample

  • Folder structure (codeunit, setup table, page)

  • API documentation links

  • Steps to test through Postman

  •  

…that would be very helpful!

 

Thank you 🙏

I have the same question (0)
  • Suggested answer
    OussamaSabbouh Profile Picture
    17,521 Super User 2026 Season 1 on at
    Hello,
     
    DocuSign isn’t built into BC, but you can integrate it with AL. The flow is simple:
     
    1. Run your report → get PDF as Base64 using Report.SaveAs + Base64 Convert.
     
     
    2. Get OAuth token with a POST request to DocuSign’s /oauth/token (client_credentials).
     
     
    3. Build the envelope JSON (documents + recipients + status="sent").
     
     
    4. POST to /accounts/{id}/envelopes using HttpClient.
     
     
    5. DocuSign sends the email automatically.
     
     
    6. Later, call
     
    /envelopes/{id} → get status
     
    /envelopes/{id}/documents/1 → download signed PDF.
     
     
     
     
    It’s all doable with a single service codeunit and a small setup table.
    BC provides all needed tools: HttpClient, JsonObject, Temp Blob, and Base64 Convert.
     
    Regards,
    Oussama Sabbouh
  • Suggested answer
    Aman Kakkar Profile Picture
    3,532 Super User 2026 Season 1 on at
    Hi,
     
    If you already have Client ID, I am assuming you have done your App Registration in the Azure Portal and have grant access for the registered app in the business central via Global Admin ID for using GET, POST, PATCH, etc requests from business central.
     
     
    Do mark as verified if this helps.
    Aman K
     
  • Suggested answer
    YUN ZHU Profile Picture
    101,995 Super User 2026 Season 1 on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,353 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,808 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,371

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans