C# / .NET
Call the Create a Fillable PDF API from C# / .NET.
using System.Net.Http;
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("CAFP_KEY"));
using var form = new MultipartFormDataContent();
var fileBytes = await File.ReadAllBytesAsync("applicant.pdf");
var fileContent = new ByteArrayContent(fileBytes);
fileContent.Headers.ContentType = new MediaTypeHeaderValue("application/pdf");
form.Add(fileContent, "file", "applicant.pdf");
form.Add(new StringContent("fields"), "detect");
var res = await client.PostAsync("https://api.createafillablepdf.com/v1/convert", form);
var body = await res.Content.ReadAsStringAsync();
Console.WriteLine($"{(int)res.StatusCode} {body}");
Fill with POST /v1/fill (JSON body { "conversion_id": "...", "values": { ... } }).