Create a new document with file content
Parameters
Returns
Upload a new document
package main
import (
"bytes"
"context"
"fmt"
"io"
"github.com/withluminary/go-sdk"
"github.com/withluminary/go-sdk/option"
)
func main() {
client := withluminary.NewClient(
option.WithClientID("My Client ID"),
option.WithClientSecret("My Client Secret"),
)
document, err := client.Documents.New(context.TODO(), withluminary.DocumentNewParams{
File: io.Reader(bytes.NewBuffer([]byte("some file contents"))),
HouseholdID: "household_01ARZ3NDEKTSV4RRFFQ69G5FAV",
Name: "Trust Agreement.pdf",
Type: withluminary.DocumentTypeGratDesignSummary,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", document.ID)
}
{
"id": "document_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"created_at": "2024-01-15T09:30:00Z",
"household_id": "household_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"name": "Trust Agreement.pdf",
"type": "GRAT_DESIGN_SUMMARY",
"updated_at": "2024-01-20T14:45:00Z",
"enable_ai_suggestions": true,
"entity_id": "entity_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"individual_id": "client_profile_01ARZ3NDEKTSV4RRFFQ69G5FAV"
}
Returns Examples
{
"id": "document_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"created_at": "2024-01-15T09:30:00Z",
"household_id": "household_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"name": "Trust Agreement.pdf",
"type": "GRAT_DESIGN_SUMMARY",
"updated_at": "2024-01-20T14:45:00Z",
"enable_ai_suggestions": true,
"entity_id": "entity_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"individual_id": "client_profile_01ARZ3NDEKTSV4RRFFQ69G5FAV"
}