This topic contains 15 replies, has 3 voices, and was last updated by  Duo_Liang 3 months ago.

  • Author
    Posts
  • Participant
    Motard
    Newbie
    Member since: 05.07.2018
    Number of posts: 8

    Hello, I am getting the following response, and I believe that I am sending the correct data.

    I will copy here the request I am making

    request: 
       { debugId: 1,
         uri: 'https://sandbox.esignlive.com/api/packages/oGGmH-MrSdWrf3hPBMirqiiCgG8=/documents/b98bb1fa64f49dc9003b230c401426c9cf86be9bbe319ca7/approvals/CZbduLYWcIEG/sign',
         method: 'POST',
         headers: 
          { Authorization: 'Basic xxxxxxxxxxxxxx',
            Accept: 'application/json; esl-empty-json=true; esl-api-version=11.0.3',
            'Accept-Encoding': 'gzip, deflate, br',
            'Content-Type': 'application/json; esl-api-version=11.0.3; esl-empty-json=true',
            Cookie: 'ESIGNLIVE_SESSION_ID=xxxxxxxxxxxxxxxxxx',
            host: 'sandbox.esignlive.com',
            'content-length': 299 },
         body: '{"data":{},"fields":[{"binding":null,"data":{},"height":60,"id":"Zt0ZzUtqcBAZ","left":76,"name":"","page":0,"subtype":"FULLNAME","top":453,"type":"SIGNATURE","validation":null,"value":null,"width":270}],"id":"CZbduLYWcIEG","name":"Entity 1530779831891","role":"58fec672-635a-4071-91c9-fd823330ec4e"}' } }

    And this is the response I am getting:

    response: 
       { debugId: 1,
         headers: 
          { server: 'nginx',
            date: 'Thu, 05 Jul 2018 09:42:23 GMT',
            'content-type': 'application/json',
            'transfer-encoding': 'chunked',
            connection: 'close',
            'x-powered-by': 'Undertow',
            allow: 'GET, POST, HEAD, PUT, PATCH, DELETE' },
         statusCode: 403,
         body: 
          { messageKey: 'error.forbidden.signatureNotAssigned',
            code: 403,
            message: 'This signature is not assigned to you for signing.',
            name: 'Access Denied' } }
    • This topic was modified 8 months, 2 weeks ago by  Motard.
    • This topic was modified 8 months, 2 weeks ago by  Motard.
    • This topic was modified 8 months, 2 weeks ago by  Motard.
    • This topic was modified 8 months, 2 weeks ago by  Duo_Liang.
    • This topic was modified 8 months, 2 weeks ago by  Duo_Liang.
    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 688

    Score

    0

    Hi Motard,

    In this case, please remove the Authorization: 'Basic xxxxxxxxxxxxxx' attribute from your request headers, as you are using ESIGNLIVE_SESSION_ID to simulating signer to sign the signature approval, there shouldn’t appear anything about sender.

    I noticed that you are using api to sign for the specific approval, please make sure the signer has confirmed the consent-document already otherwise you could probably get another error response telling you “violate the signing order”. Because in our Bulk Sign guidance, we used a “sign all documents in one call” api which could be different from your case.

    And I removed the api-key from your post. Thanks for posting and hope this reply could help you! 🙂


    Duo Liang
    OneSpan Junior Technical Evangelist
    • This reply was modified 8 months, 2 weeks ago by  Duo_Liang.
    • This reply was modified 8 months, 2 weeks ago by  Duo_Liang.
    Participant
    Motard
    Newbie
    Member since: 05.07.2018
    Number of posts: 8

    Score

    0

    I have done that and removed the apikey from the request, but now I am getting unathorized session,

    body: 
          { messageKey: 'error.unauthorised.noSession',
            message: 'Failed to retrieve Session',
            code: 401,
            name: 'Unauthorized' }
    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 688

    Score

    0

    Hi Motard,

    The “401 unauthorized” error could probably because of the wrong ESIGNLIVE_SESSION_ID. Could you please check whether you have input the right sessionToken?


    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    Motard
    Newbie
    Member since: 05.07.2018
    Number of posts: 8

    Score

    0

    Well probably not. How can I get the ESIGNLIVE_SESSION_ID?

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 688
    Approved answer

    Score

    0

    Hi Motard,

    To get a session token for a specific signer, there are two steps:

    1. To create an authenticationToken for this signer by using the following api and request payload:

    POST /api/authenticationTokens/signer/multiUse
    
    {
      "packageId": "packageId",
      "signerId": "signer1",
      "sessionFields": {
        "Bulk Signing on behalf of": "signer1"
      },
      "value": null
    }

    The generated token would appear in the value attribute in response payload.

    2. Using this authenticationToken to generate the session token:

    POST /auth?signerAuthenticationToken={signerAuthenticationToken}

    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    Motard
    Newbie
    Member since: 05.07.2018
    Number of posts: 8

    Score

    0

    Ok this working now.

    So I just need your help regarding two more calls.

    One is the call for the signer to confirm the consent-document.

    And the other call is the call to confirm the signature. So after I make this call

    https://sandbox.esignlive.com/api/packages/soem_package_id/documents/some_document_id/approvals/some_approval_id/sign

    I need to make another one to confirm the signature. Could you please tell me what that call is, and what type of payload I need to send?

    • This reply was modified 8 months, 2 weeks ago by  Motard.
    • This reply was modified 8 months, 2 weeks ago by  Motard.
    • This reply was modified 8 months, 2 weeks ago by  Motard.
    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 688

    Score

    0

    Hi Motard,

    If you simply want to sign all signatures in a transaction in one single call, you can directly use our Bulk Sign For a Signer feature by using the following api call, as /api/packages/{packageId}/documents/{documentId}/approvals/{approvalId}/sign isn’t one we’d suggest use of:

    HTTP Request
    POST /api/packages/{packageId}/documents/signed_documents
    
    HTTP Headers
    Accept: application/json
    Content-Type: application/json
    Cookie: ESIGNLIVE_SESSION_ID={sessionToken}
    
    Request Payload
    {
      "documents": [
        {
          "id": "default-consent"
        },
        {
          "id": "your document id1"
        },
        {
          "id": "your document id2"
        },
        {...}
      ]
    }

    Thanks for your post and hope you find this reply helpful!


    Duo Liang
    OneSpan Junior Technical Evangelist
    • This reply was modified 8 months, 2 weeks ago by  Duo_Liang.
    Participant
    Motard
    Newbie
    Member since: 05.07.2018
    Number of posts: 8

    Score

    0

    Hello, I am doing the request to bulk sign but getting This signature is not assigned to you for signing.

    This is my request

    { request: 
       { debugId: 3,
         uri: 'https://sandbox.esignlive.com/api/packages/i2ULoALa37cb4jimHnHsvcnrNqs=/documents/signed_documents',
         method: 'POST',
         headers: 
          { Cookie: 'ESIGNLIVE_SESSION_ID=xxxxxxxx',
            host: 'sandbox.esignlive.com',
            accept: 'application/json',
            'content-type': 'application/json',
            'content-length': 98 },
         body: '{"documents":[{"id":"default-consent"},{"id":"b6960c2641cd63503866cef5ce364a9772ff61436ceae70d"}]}' } }

    And this is the reply:

    body: 
          { messageKey: 'error.forbidden.signatureNotAssigned',
            message: 'This signature is not assigned to you for signing.',
            code: 403,
            name: 'Access Denied' }
    • This reply was modified 8 months, 1 week ago by  Motard.
    • This reply was modified 8 months, 1 week ago by  Duo_Liang.
    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 688

    Score

    0

    Hi Motrad,

    Usually when you encountered this 403 “Signature not assigned for you” error, it could because of:
    1. The documents id in payload is not available, which I think is your case.
    I checked the package info for you, it seems that the second document id is “0ec13fe06e7066304e0d0e5d63e16bba6275944dff73f22a” other than the one you put in the payload, in that case, our system can’t find the signature approval for this signer in this document.
    2. There’s no signature approval assigned to this signer in the documents which are involved in body payload
    3. You are generating the wrong session token for this signer( using maybe another signer’s id to generate session token), may cause the same issue like point 2.

    Hope you find this reply helpful!


    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    jmramirezo
    Newbie
    Member since: 21.11.2018
    Number of posts: 5

    Score

    0

    Hi.

    I’m having the same issue when trying to bulk sign on behalf of a signer.

    I get an 403 error with message “This signature is not assigned to you for signing.” when I have more than 1 signer.

    If I have just 1 signer, it works fine.

    Attached you can find the code where I’m getting the error and the JSON with the package info. (I’m getting the error on last POST)

    I hope you can help me.

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 688

    Score

    0

    Hi jmramirezo,

    Your attachments are not uploaded successfully, you can put them in a zip file and post them in a new reply.

    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    jmramirezo
    Newbie
    Member since: 21.11.2018
    Number of posts: 5

    Score

    0

    I’m sorry.

    Here they go again.

    Thanks.

    Attachments:
    You must be logged in to view attached files.
    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 688

    Score

    0

    Hi jmramirezo,

    I received the same error at my side using the same code. So in your fourth call, can you build your request payload in this way instead of adding all documents’ metadata?

    StringBuilder sb = new StringBuilder(200);
                sb.Append("{\"documents\": [");
                foreach (JObject document in documents) {
                    sb.Append("{ \"id\": \"").Append(document["id"]).Append("\"},");
                }
                sb.Remove(sb.Length - 1, 1);
                sb.Append("]}");
    
                Debug.WriteLine(sb.ToString());
                StringContent jsonContent2 = new StringContent(sb.ToString(), Encoding.UTF8, "application/json");

    This seems solved the issue, and please create a new package and test the code.

    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    jmramirezo
    Newbie
    Member since: 21.11.2018
    Number of posts: 5

    Score

    0

    It worked!

    Thanks a lot!

You must be logged in to reply to this topic.