- 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, 874.3)
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.RecipientGetDocumentRecipientBadRequestError | 400 | application/json |
| apierrors.RecipientGetDocumentRecipientUnauthorizedError | 401 | application/json |
| apierrors.RecipientGetDocumentRecipientForbiddenError | 403 | application/json |
| apierrors.RecipientGetDocumentRecipientNotFoundError | 404 | application/json |
| apierrors.RecipientGetDocumentRecipientInternalServerError | 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.RecipientCreateDocumentRecipientRequest{
DocumentID: 3058.31,
Recipient: operations.RecipientCreateDocumentRecipientRecipient{
Email: "Ila.Steuber@yahoo.com",
Name: "<value>",
Role: operations.RecipientCreateDocumentRecipientRoleRequestAssistant,
},
})
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.RecipientCreateDocumentRecipientRequest | ✔️ | 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.RecipientCreateDocumentRecipientBadRequestError | 400 | application/json |
| apierrors.RecipientCreateDocumentRecipientUnauthorizedError | 401 | application/json |
| apierrors.RecipientCreateDocumentRecipientForbiddenError | 403 | application/json |
| apierrors.RecipientCreateDocumentRecipientInternalServerError | 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.RecipientCreateDocumentRecipientsRequest{
DocumentID: 9983.95,
Recipients: []operations.RecipientCreateDocumentRecipientsRecipientRequest{
operations.RecipientCreateDocumentRecipientsRecipientRequest{
Email: "Roosevelt_Baumbach@yahoo.com",
Name: "<value>",
Role: operations.RecipientCreateDocumentRecipientsRoleRequestCc,
},
},
})
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.RecipientCreateDocumentRecipientsRequest | ✔️ | 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.RecipientCreateDocumentRecipientsBadRequestError | 400 | application/json |
| apierrors.RecipientCreateDocumentRecipientsUnauthorizedError | 401 | application/json |
| apierrors.RecipientCreateDocumentRecipientsForbiddenError | 403 | application/json |
| apierrors.RecipientCreateDocumentRecipientsInternalServerError | 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.RecipientUpdateDocumentRecipientRequest{
DocumentID: 7045.62,
Recipient: operations.RecipientUpdateDocumentRecipientRecipient{
ID: 2224.05,
},
})
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.RecipientUpdateDocumentRecipientRequest | ✔️ | 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.RecipientUpdateDocumentRecipientBadRequestError | 400 | application/json |
| apierrors.RecipientUpdateDocumentRecipientUnauthorizedError | 401 | application/json |
| apierrors.RecipientUpdateDocumentRecipientForbiddenError | 403 | application/json |
| apierrors.RecipientUpdateDocumentRecipientInternalServerError | 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.RecipientUpdateDocumentRecipientsRequest{
DocumentID: 3189.76,
Recipients: []operations.RecipientUpdateDocumentRecipientsRecipientRequest{},
})
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.RecipientUpdateDocumentRecipientsRequest | ✔️ | 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.RecipientUpdateDocumentRecipientsBadRequestError | 400 | application/json |
| apierrors.RecipientUpdateDocumentRecipientsUnauthorizedError | 401 | application/json |
| apierrors.RecipientUpdateDocumentRecipientsForbiddenError | 403 | application/json |
| apierrors.RecipientUpdateDocumentRecipientsInternalServerError | 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.RecipientDeleteDocumentRecipientRequest{
RecipientID: 5490.43,
})
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.RecipientDeleteDocumentRecipientRequest | ✔️ | 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.RecipientDeleteDocumentRecipientBadRequestError | 400 | application/json |
| apierrors.RecipientDeleteDocumentRecipientUnauthorizedError | 401 | application/json |
| apierrors.RecipientDeleteDocumentRecipientForbiddenError | 403 | application/json |
| apierrors.RecipientDeleteDocumentRecipientInternalServerError | 500 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |