Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing api #2

Closed
luonghaiviet88 opened this issue Jun 12, 2019 · 2 comments
Closed

missing api #2

luonghaiviet88 opened this issue Jun 12, 2019 · 2 comments

Comments

@luonghaiviet88
Copy link

hi jfcote87,
it's me (again), seem you havent implemented this api yet?
https://demo.docusign.net/restapi/v2.1/accounts/%s/envelopes/%s/views/recipient

could you plz take a look? thanks

@jfcote87
Copy link
Owner

DocuSign just released v2.1 but have not released the OpenAPI/Swagger specification so that I can generate the operations and models. The v2 implementation works the same and is available in the envelopes package

The SDK Method (Envelopes::createRecipientView) is the best way to link the code to the documentation. To find the package implementation, find the SDK Method definition for an operation on the DocuSign reference page. The Quick Links menu in the top right always has a link to the SDK Method.

Then search package documentation for the SDK method, and you will find the package operations (see godoc.org link.

import "github.com/jfcote87/esign/envelopes"
import "github.com/jfcote87/esign/model"

func getRecipientURL(ctx context.Context, cred esign.Credential, envID string) (*model.ViewURL, error) {
	sv := envelopes.New(cred)
	rl, _ := sv.RecipientsList(envID).Do(ctx)
	vURL, err := sv.ViewsCreateRecipient(envID, &model.RecipientViewRequest{
		AssertionID:          "Something",
		AuthenticationMethod: "Email",
		ReturnURL:            "https://www.example.com?state=12345",
		RecipientID:          rl.Signers[0].RecipientID,
		UserID:               rl.Signers[0].UserID,
	}).Do(ctx)
	if err != nil {
		return nil, err
	}
	log.Printf("%s", vURL.URL)
	return vURL, nil

}

@luonghaiviet88
Copy link
Author

thanks mate!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants