docusign / docusign-esign-csharp-client

The Official Docusign C# Client Library used to interact with the eSignature REST API. Send, sign, and approve documents using this client.
https://developers.docusign.com/docs/esign-rest-api/sdks/csharp/
MIT License
130 stars 159 forks source link

GetRecipientView: REST API Error ACCOUNT_NOT_AUTHORIZED_FOR_ENVELOPE #45

Closed ahv1982 closed 8 years ago

ahv1982 commented 9 years ago

I am trying to get recipient url but getting "GetRecipientView REST Error ACCOUNT_NOT_AUTHORIZED_FOR_ENVELOPE #44".

First I am creating the envelope to get sender url. And then I calling GetRecipientView() to get recipient view url. Below is the code I am using

public string EmbeddedSenderView(string docId) { Account account = InitializeDocSign();

        Envelope envelope = new Envelope();
        envelope.Login = account;
        envelope.EmailSubject = "Please sign document";
        envelope.Recipients = new Recipients()
        {
            signers = new Signer[]
            {
                new Signer()
                {
                    email = "xxxx@gmail.com",
                    name = "AV Gmail 1",
                    routingOrder = "1",
                    recipientId = "1",
                    roleName="Signer",
                    clientUserId="101"
                },
            },
        };           
        envelope.Create("\FAQ_NMS.pdf");

        bool result = envelope.GetSenderView("my domain");          

        /*Saving document details into Database*/
        if (result)
        {                
            ObjDocumentSignRequest obj = new ObjDocumentSignRequest();
            obj.DocumentId = docId;
            obj.EnvelopeId = envelope.EnvelopeId;
            obj.SenderViewUrl = envelope.SenderViewUrl;
            eSignUtilities.SaveSignRequest(obj);           
        }
        return envelope.SenderViewUrl;
    }

    public void EmbeddedRecepientView(string docId)
    {
        Account account = InitializeDocSign();

        Envelope envelope = new Envelope();
        envelope.Login = account;
        envelope.EmailSubject = "Please sign document";
        envelope.Recipients = new Recipients()
        {
            signers = new Signer[]
            {
                new Signer()
                {
                    email = "xxxx@gmail.com",
                    name = "AV Gmail 1",
                    routingOrder = "1",
                    recipientId = "1",
                    roleName="Signer",
                    clientUserId="101"
                },
            },
        };

        envelope.EnvelopeId = "xxxxxxxxxxx";
        envelope.UpdateStatus();

        bool result = envelope.GetRecipientView("my domain");     

Any help?

Thanks AV

InbarGazit commented 9 years ago

@ahv1982 I see this email xxxx@gmail.com as the recipient, is this also the one you used to authenticate? If not - this is expected. You're sending an envelope to person B from person A, person A cannot sign it. what exactly did you intent to do here? self sign?

ahv1982 commented 9 years ago

Thanks for the reply Inbar. Its a valid signer's email (I just masked it). I want to store "SenderViewURL" and "RecipientViewURL" URLs into database so that I can use it in my website.

I solved my problem using "GetEmbeddedSignerView" method

    public void EmbeddedRecepientView()
    {        
        Account account = InitializeDocSign();                   
        Envelope envelope = new Envelope();
        envelope.Login = account;
        // assign the envelope id that was passed in
        envelope.EnvelopeId = "xxxx-xxx-xxxx-xxx-xxxxxxxx";         

        var signer = new Signer
        {
            email = "xxxxx@gmail.com",
            name = "AV Gmail 1",
            clientUserId = "101",
            recipientId = "1"
        };           
        string signingUrl = envelope.GetEmbeddedSignerView("http://www.google.com", signer);                 
    }
InbarGazit commented 9 years ago

yup, was going to suggest that. Let me know if you have any other questions

ahv1982 commented 9 years ago

Thank Inbar: Now I run into another issue. This is serious one I guess. We can not afford to make external calls to API. Even we can not allow to store pdf files in docusign server. Is there any API available where we can leverage all the docusign features without making external calls and without hosting files in docusign server.

larrykluger commented 9 years ago

Hi,

The CoSign Central product line from DocuSign may be of help. It consists of a secure signing appliance that is attached to your network: CoSign Central is an on-premises solution.

CoSIgn Central enables you to digitally sign PDF, Word, Excel and other documents. The CoSign Central appliance includes API access to enable your applications to sign documents. The API itself, and all document operations on on-premises—nothing leaves your network.

Note that CoSign Central does not offer all of the capabilities of the DocuSign DTM solution. CoSIgn Central focuses on signing the document using secure, legal, standard technology. Other document handling features that you may want can be added using additional tools. For example, you can add workflow via K2, Nintex, SharePoint Designer, etc. You can add storage of the signed document via SharePoint, OpenText, Alfresco, or other systems.

For more information, contact sales@arx.com

API information is available from developer.arx.com

Regards, Larry