(Documents.Recipients)
- Get - Get document recipient
- Create - Create document recipient
- CreateMany - Create document recipients
- Update - Update document recipient
- UpdateMany - Update document recipients
- Delete - Delete document recipient
Returns a single recipient. If you want to retrieve all the recipients for a document, use the "Get Document" 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.Documents.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.RecipientGetDocumentRecipientResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.ErrorBADREQUEST | 400 | application/json |
apierrors.ErrorNOTFOUND | 404 | application/json |
apierrors.ERRORINTERNALSERVERERROR | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Create a single recipient for a document.
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.Documents.Recipients.Create(ctx, operations.RecipientCreateDocumentRecipientRequestBody{
DocumentID: 4865.89,
Recipient: operations.Recipient{
Email: "[email protected]",
Name: "<value>",
Role: operations.RecipientCreateDocumentRecipientRoleCc,
},
})
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.RecipientCreateDocumentRecipientRequestBody | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.RecipientCreateDocumentRecipientResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.ErrorBADREQUEST | 400 | application/json |
apierrors.ERRORINTERNALSERVERERROR | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Create multiple recipients for a document.
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.Documents.Recipients.CreateMany(ctx, operations.RecipientCreateDocumentRecipientsRequestBody{
DocumentID: 5158.41,
Recipients: []operations.RecipientCreateDocumentRecipientsRecipients{
operations.RecipientCreateDocumentRecipientsRecipients{
Email: "[email protected]",
Name: "<value>",
Role: operations.RecipientCreateDocumentRecipientsRoleViewer,
},
operations.RecipientCreateDocumentRecipientsRecipients{
Email: "[email protected]",
Name: "<value>",
Role: operations.RecipientCreateDocumentRecipientsRoleApprover,
},
},
})
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.RecipientCreateDocumentRecipientsRequestBody | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.RecipientCreateDocumentRecipientsResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.ErrorBADREQUEST | 400 | application/json |
apierrors.ERRORINTERNALSERVERERROR | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Update a single recipient for a document.
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.Documents.Recipients.Update(ctx, operations.RecipientUpdateDocumentRecipientRequestBody{
DocumentID: 8574.78,
Recipient: operations.RecipientUpdateDocumentRecipientRecipient{
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.RecipientUpdateDocumentRecipientRequestBody | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.RecipientUpdateDocumentRecipientResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.ErrorBADREQUEST | 400 | application/json |
apierrors.ERRORINTERNALSERVERERROR | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Update multiple recipients for a document.
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.Documents.Recipients.UpdateMany(ctx, operations.RecipientUpdateDocumentRecipientsRequestBody{
DocumentID: 4057.69,
Recipients: []operations.RecipientUpdateDocumentRecipientsRecipients{
operations.RecipientUpdateDocumentRecipientsRecipients{
ID: 5359.16,
},
operations.RecipientUpdateDocumentRecipientsRecipients{
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.RecipientUpdateDocumentRecipientsRequestBody | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.RecipientUpdateDocumentRecipientsResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.ErrorBADREQUEST | 400 | application/json |
apierrors.ERRORINTERNALSERVERERROR | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |
Delete document 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.Documents.Recipients.Delete(ctx, operations.RecipientDeleteDocumentRecipientRequestBody{
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.RecipientDeleteDocumentRecipientRequestBody | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.RecipientDeleteDocumentRecipientResponse, error
Error Type | Status Code | Content Type |
---|---|---|
apierrors.ErrorBADREQUEST | 400 | application/json |
apierrors.ERRORINTERNALSERVERERROR | 500 | application/json |
apierrors.APIError | 4XX, 5XX | */* |