https://github.com/blazingdocs/blazingdocs-go
BlazingDocs Go client
https://github.com/blazingdocs/blazingdocs-go
api csv doc document-generation documents docx json mail-merge odt pdf reports templates xml
Last synced: about 1 month ago
JSON representation
BlazingDocs Go client
- Host: GitHub
- URL: https://github.com/blazingdocs/blazingdocs-go
- Owner: blazingdocs
- License: mit
- Created: 2021-08-20T13:40:44.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-12-25T09:09:35.000Z (over 4 years ago)
- Last Synced: 2025-08-17T16:47:02.028Z (10 months ago)
- Topics: api, csv, doc, document-generation, documents, docx, json, mail-merge, odt, pdf, reports, templates, xml
- Language: Go
- Homepage: https://blazingdocs.com
- Size: 52.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BlazingDocs GO client
High-performance document generation API. Generate documents and reports from СSV, JSON, XML with 99,9% uptime and 24/7 monitoring.
## Installation
```go
import (
"github.com/blazingdocs/blazingdocs-go"
"github.com/blazingdocs/blazingdocs-go/config"
)
```
```
go get -u github.com/blazingdocs/blazingdocs-go
```
## Integration basics
### Setup
You can get your API Key at https://app.blazingdocs.com
```go
config.Default = config.Init("YOUR-API-KEY")
client := blazingdocs.Client{
Config: *config.Default,
}
```
### Getting account info
```go
resp, err := client.GetAccount()
```
### Getting merge templates list
```go
var s string
tempResp, tempErr := client.GetTemplates(s)
```
### Getting usage info
```go
usageResp, usageErr := client.GetUsage()
```
### Executing merge
```go
file, _ := ioutil.ReadFile("../PO-Template.json")
s := string(file)
params := parameters.MergeParameters{
DataSourceName: "data", // data source name
DataSourceType: utils.JSON_TYPE, // data in json format
Strict: true, // keep json types
ParseColumns: false, // true if data is csv file with column names
Sequence: false, // data is object
}
ffile, _ := os.Open("../PO-Template.docx")
formFile := utils.FormFile{
Name: "PO-Template.docx",
Content: ffile,
}
config.Default = config.Init("YOUR-API-KEY")
client := blazingdocs.Client{
Config: *config.Default,
}
resp, err := client.MergeWithFile(s, "output.pdf", params, formFile)
```
## Documentation
See more details here https://docs.blazingdocs.com