Ian Grieve offers advice on Bulk Export Dynamics GP Document Attachments using .NET at
www.azurecurve.co.uk/2019/08/bulk-export-dynamics-gp-document-attachments-using-net/
Bulk Export Dynamics GP Document Attachments using .NET – azurecurve
Microsoft & the GP EcosystemDevelopment & Integration
Archived post from 2019. Dynamics GP and the links it points to have changed since; check current documentation before relying on version-specific steps.