Templates (Microsoft Graph)
The Templates feature creates documents from Word (DOCX) templates with fields the user fills in when creating the document. To produce the PDF, Signer converts the DOCX with Microsoft Graph and a SharePoint site.
The feature is off by default. Signer only shows the Templates option when the four settings of the Graph
section are filled in.
Prerequisites
- A Microsoft 365 tenant with SharePoint Online.
- Permission to create a SharePoint site and an app registration in Microsoft Entra ID.
- Outbound access from the Signer server to
login.microsoftonline.comandgraph.microsoft.com.
1. Create a SharePoint site
- Create a SharePoint site used only by Signer, for example
signer-templates. - Write down the tenant name (the part before
.sharepoint.com) and the site name.
2. Register an app in Microsoft Entra ID
- In the Azure portal, open Microsoft Entra ID and then App registrations.
- Click New registration, name the app (for example, Signer Templates) and click Register.
- Write down the Application (client) ID.
- In Certificates & secrets, create a client secret and write down its Value.
- In API permissions, add a Microsoft Graph Application permission that allows reading and writing files on the site created in step 1.
- Click Grant admin consent.
The client secret has an expiry date. When it expires, the conversion stops working. Write down the date and create a new secret before it expires.
3. Get the site DriveId
The DriveId identifies the site's document library.
-
Request an access token from Entra ID. Replace
<tenant>,<client-id>and<client-secret>with your values:curl -X POST https://login.microsoftonline.com/<tenant>.onmicrosoft.com/oauth2/v2.0/token \-d client_id=<client-id> \-d client_secret=<client-secret> \-d scope=https://graph.microsoft.com/.default \-d grant_type=client_credentials -
Copy the
access_tokenvalue from the response. -
Query the site drive. Replace
<tenant>,<site>and<token>:curl -H "Authorization: Bearer <token>" \"https://graph.microsoft.com/v1.0/sites/<tenant>.sharepoint.com:/sites/<site>:/drive" -
Write down the
idfield of the response. That is theDriveId.
If the second call answers 403, the app has no permission on the site. Review step 2.
4. Configure Signer
In the Graph section, enter the four values and restart the application:
"Graph": {
"DomainName": "yourcompany.onmicrosoft.com",
"ClientId": "<application-client-id>",
"ClientSecret": "<client-secret>",
"DriveId": "<drive-id>"
}
DomainName is the tenant domain in Entra ID (for example, yourcompany.onmicrosoft.com or a verified domain of
the tenant). In environment variables, use Graph__DomainName, Graph__ClientId, Graph__ClientSecret and
Graph__DriveId. See the Graph settings.
5. Test
- Sign in to Signer and start creating a document.
- Check that the Templates button shows next to the add files button.
- Create a template with a test DOCX file and generate a document from it.
If the option does not show, check that the four settings are filled in. If the conversion fails, look for the Microsoft Graph error in the application log. The most common causes are an expired client secret and a missing app permission on the site.