Welcome to Anvil API usage examples in C#! There are example scripts for the following API actions:
- Filling a PDF template with your own data
- Generating a PDF from HTML and CSS
- Generating a PDF from Markdown
- Creating an e-sign packet
- Starting a workflow and updating workflow submissions
- Making an arbitrary GraphQL request
All scripts will require that you have an Anvil API key. See the getting started documentation for help grabbing your API key.
Each script is set up to be runnable with minimal input. Once you have an API key, you can clone this repo and run the example scripts from this directory.
Once you have this repo cloned, cd into this csharp
directory and install the dependencies:
cd csharp
# Download dependencies
dotnet restore
# Run the example that you want.
# Replace `<example-name>` with one of:
# make-graphql-request, fill-pdf,
# generate-html-to-pdf, generate-markdown-to-pdf,
# create-etch-packet, create-update-workflow
ANVIL_API_KEY="YOUR_KEY_HERE" dotnet run <example-name>
Scripts will output filled and generated PDFs into the output directory.
$ ANVIL_API_KEY=<yourAPIKey> dotnet run fill-pdf
Generate a PDF from HTML and CSS:
$ ANVIL_API_KEY=<yourAPIKey> dotnet run generate-html-to-pdf
$ ANVIL_API_KEY=<yourAPIKey> dotnet run generate-markdown-to-pdf
$ ANVIL_API_KEY=<yourAPIKey> dotnet run create-etch-packet <[email protected]>
Start and update workflow submissions:
$ ANVIL_API_KEY=<yourAPIKey> dotnet run create-update-workflow <your-org-slug>
Make an arbitrary GraphQL request:
$ ANVIL_API_KEY=<yourAPIKey> dotnet run make-graphql-request