(Templates.Fields)
- Create - Create template field
- Get - Get template field
- CreateMany - Create template fields
- Update - Update template field
- UpdateMany - Update template fields
- Delete - Delete template field
Create a single field for a template.
package main
import(
"context"
"os"
sdkgo "github.com/documenso/sdk-go"
"github.com/documenso/sdk-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := sdkgo.New(
sdkgo.WithSecurity(os.Getenv("DOCUMENSO_API_KEY")),
)
res, err := s.Templates.Fields.Create(ctx, operations.FieldCreateTemplateFieldRequestBody{
TemplateID: 4865.89,
Field: operations.CreateFieldCreateTemplateFieldFieldFieldCreateTemplateFieldField8(
operations.FieldCreateTemplateFieldField8{
Type: operations.FieldCreateTemplateFieldFieldTemplatesFieldsRequestRequestBody8TypeNumber,
RecipientID: 4174.58,
PageNumber: 1343.65,
PageX: 690.25,
PageY: 7964.74,
Width: 9510.62,
Height: 0.86,
},
),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.FieldCreateTemplateFieldRequestBody | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.FieldCreateTemplateFieldResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.FieldCreateTemplateFieldResponseBody | 400 | application/json |
apierrors.FieldCreateTemplateFieldTemplatesFieldsResponseBody | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Returns a single field. If you want to retrieve all the fields for a template, use the "Get Template" endpoint.
package main
import(
"context"
"os"
sdkgo "github.com/documenso/sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := sdkgo.New(
sdkgo.WithSecurity(os.Getenv("DOCUMENSO_API_KEY")),
)
res, err := s.Templates.Fields.Get(ctx, 7003.47)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
fieldID |
float64 | ✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.FieldGetTemplateFieldResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.FieldGetTemplateFieldResponseBody | 400 | application/json |
apierrors.FieldGetTemplateFieldTemplatesFieldsResponseBody | 404 | application/json |
apierrors.FieldGetTemplateFieldTemplatesFieldsResponseResponseBody | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Create multiple fields for a template.
package main
import(
"context"
"os"
sdkgo "github.com/documenso/sdk-go"
"github.com/documenso/sdk-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := sdkgo.New(
sdkgo.WithSecurity(os.Getenv("DOCUMENSO_API_KEY")),
)
res, err := s.Templates.Fields.CreateMany(ctx, operations.FieldCreateTemplateFieldsRequestBody{
TemplateID: 5158.41,
Fields: []operations.FieldCreateTemplateFieldsFields{
operations.CreateFieldCreateTemplateFieldsFieldsFieldCreateTemplateFieldsFields10(
operations.FieldCreateTemplateFieldsFields10{
Type: operations.FieldCreateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody10TypeCheckbox,
RecipientID: 2516.72,
PageNumber: 2304.17,
PageX: 7760.32,
PageY: 3376.66,
Width: 3566.94,
Height: 2768.94,
},
),
operations.CreateFieldCreateTemplateFieldsFieldsFieldCreateTemplateFieldsFields8(
operations.FieldCreateTemplateFieldsFields8{
Type: operations.FieldCreateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody8TypeNumber,
RecipientID: 5689.64,
PageNumber: 6483.69,
PageX: 7271.79,
PageY: 1891.56,
Width: 7263.21,
Height: 5043.41,
},
),
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.FieldCreateTemplateFieldsRequestBody | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.FieldCreateTemplateFieldsResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.FieldCreateTemplateFieldsResponseBody | 400 | application/json |
apierrors.FieldCreateTemplateFieldsTemplatesFieldsResponseBody | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Update a single field for a template.
package main
import(
"context"
"os"
sdkgo "github.com/documenso/sdk-go"
"github.com/documenso/sdk-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := sdkgo.New(
sdkgo.WithSecurity(os.Getenv("DOCUMENSO_API_KEY")),
)
res, err := s.Templates.Fields.Update(ctx, operations.FieldUpdateTemplateFieldRequestBody{
TemplateID: 8574.78,
Field: operations.CreateFieldUpdateTemplateFieldFieldFieldUpdateTemplateFieldField7(
operations.FieldUpdateTemplateFieldField7{
Type: operations.FieldUpdateTemplateFieldFieldTemplatesFieldsRequestRequestBody7TypeText,
ID: 3446.2,
},
),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.FieldUpdateTemplateFieldRequestBody | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.FieldUpdateTemplateFieldResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.FieldUpdateTemplateFieldResponseBody | 400 | application/json |
apierrors.FieldUpdateTemplateFieldTemplatesFieldsResponseBody | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Update multiple fields for a template.
package main
import(
"context"
"os"
sdkgo "github.com/documenso/sdk-go"
"github.com/documenso/sdk-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := sdkgo.New(
sdkgo.WithSecurity(os.Getenv("DOCUMENSO_API_KEY")),
)
res, err := s.Templates.Fields.UpdateMany(ctx, operations.FieldUpdateTemplateFieldsRequestBody{
TemplateID: 4057.69,
Fields: []operations.FieldUpdateTemplateFieldsFields{
operations.CreateFieldUpdateTemplateFieldsFieldsFieldUpdateTemplateFieldsFields6(
operations.FieldUpdateTemplateFieldsFields6{
Type: operations.FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody6TypeDate,
ID: 8982.15,
},
),
operations.CreateFieldUpdateTemplateFieldsFieldsFieldUpdateTemplateFieldsFields4(
operations.FieldUpdateTemplateFieldsFields4{
Type: operations.FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody4TypeName,
ID: 310.19,
},
),
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.FieldUpdateTemplateFieldsRequestBody | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.FieldUpdateTemplateFieldsResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.FieldUpdateTemplateFieldsResponseBody | 400 | application/json |
apierrors.FieldUpdateTemplateFieldsTemplatesFieldsResponseBody | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Delete template field
package main
import(
"context"
"os"
sdkgo "github.com/documenso/sdk-go"
"github.com/documenso/sdk-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := sdkgo.New(
sdkgo.WithSecurity(os.Getenv("DOCUMENSO_API_KEY")),
)
res, err := s.Templates.Fields.Delete(ctx, operations.FieldDeleteTemplateFieldRequestBody{
FieldID: 5459.07,
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.FieldDeleteTemplateFieldRequestBody | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.FieldDeleteTemplateFieldResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.FieldDeleteTemplateFieldResponseBody | 400 | application/json |
apierrors.FieldDeleteTemplateFieldTemplatesFieldsResponseBody | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |