(Templates.Recipients)
- Get - Get template recipient
- Create - Create template recipient
- CreateMany - Create template recipients
- Update - Update template recipient
- UpdateMany - Update template recipients
- Delete - Delete template recipient
Returns a single recipient. If you want to retrieve all the recipients 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.Recipients.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. |
recipientID |
float64 | ✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.RecipientGetTemplateRecipientResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.RecipientGetTemplateRecipientResponseBody | 400 | application/json |
apierrors.RecipientGetTemplateRecipientTemplatesRecipientsResponseBody | 404 | application/json |
apierrors.RecipientGetTemplateRecipientTemplatesRecipientsResponseResponseBody | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Create a single recipient 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.Recipients.Create(ctx, operations.RecipientCreateTemplateRecipientRequestBody{
TemplateID: 4865.89,
Recipient: operations.RecipientCreateTemplateRecipientRecipient{
Email: "[email protected]",
Name: "<value>",
Role: operations.RecipientCreateTemplateRecipientRoleCc,
},
})
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.RecipientCreateTemplateRecipientRequestBody | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.RecipientCreateTemplateRecipientResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.RecipientCreateTemplateRecipientResponseBody | 400 | application/json |
apierrors.RecipientCreateTemplateRecipientTemplatesRecipientsResponseBody | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Create multiple recipients 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.Recipients.CreateMany(ctx, operations.RecipientCreateTemplateRecipientsRequestBody{
TemplateID: 5158.41,
Recipients: []operations.RecipientCreateTemplateRecipientsRecipients{
operations.RecipientCreateTemplateRecipientsRecipients{
Email: "[email protected]",
Name: "<value>",
Role: operations.RecipientCreateTemplateRecipientsRoleViewer,
},
operations.RecipientCreateTemplateRecipientsRecipients{
Email: "[email protected]",
Name: "<value>",
Role: operations.RecipientCreateTemplateRecipientsRoleApprover,
},
},
})
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.RecipientCreateTemplateRecipientsRequestBody | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.RecipientCreateTemplateRecipientsResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.RecipientCreateTemplateRecipientsResponseBody | 400 | application/json |
apierrors.RecipientCreateTemplateRecipientsTemplatesRecipientsResponseBody | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Update a single recipient 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.Recipients.Update(ctx, operations.RecipientUpdateTemplateRecipientRequestBody{
TemplateID: 8574.78,
Recipient: operations.RecipientUpdateTemplateRecipientRecipient{
ID: 5971.29,
},
})
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.RecipientUpdateTemplateRecipientRequestBody | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.RecipientUpdateTemplateRecipientResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.RecipientUpdateTemplateRecipientResponseBody | 400 | application/json |
apierrors.RecipientUpdateTemplateRecipientTemplatesRecipientsResponseBody | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Update multiple recipients 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.Recipients.UpdateMany(ctx, operations.RecipientUpdateTemplateRecipientsRequestBody{
TemplateID: 4057.69,
Recipients: []operations.RecipientUpdateTemplateRecipientsRecipients{
operations.RecipientUpdateTemplateRecipientsRecipients{
ID: 5359.16,
},
operations.RecipientUpdateTemplateRecipientsRecipients{
ID: 8982.15,
},
},
})
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.RecipientUpdateTemplateRecipientsRequestBody | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.RecipientUpdateTemplateRecipientsResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.RecipientUpdateTemplateRecipientsResponseBody | 400 | application/json |
apierrors.RecipientUpdateTemplateRecipientsTemplatesRecipientsResponseBody | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Delete template recipient
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.Recipients.Delete(ctx, operations.RecipientDeleteTemplateRecipientRequestBody{
RecipientID: 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.RecipientDeleteTemplateRecipientRequestBody | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.RecipientDeleteTemplateRecipientResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.RecipientDeleteTemplateRecipientResponseBody | 400 | application/json |
apierrors.RecipientDeleteTemplateRecipientTemplatesRecipientsResponseBody | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |