docusign send on behalf functionality

后端 未结 1 1176
感动是毒
感动是毒 2021-01-28 12:29

i am a newbie to docusign and api\'s in general. i have created a master account manually on docusign and now i want to create new users using this account and use the send on

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-28 12:45

    Please go through the DocuSign Dev Center as there is some very useful information throughout the site, including the exact SOBO (Send On Behalf Of) steps that you are looking for.

    Go to Dev Center -> Explore -> Features -> SOBO. Generally speaking these are steps you need to take:

    1. Obtain an access token for User1 (the authenticating user)
    2. Obtain an access token for User2 (the operating user - you're sending on behalf of this person)
    3. Send Request on behalf of User2

    See this page of the Dev Center for the exact steps to take and potential account settings you need to have turned on:

    http://www.docusign.com/developer-center/explore/features/sobo


    To summarize what the page explains and have the answer here too, here are the details:

    STEP #1:

    POST https://{server}/restapi/{apiVersion}/oauth2/token
    
    Accept: application/json
    Content-Type: application/x-www-form-urlencoded
    Content-Length: {length of body}
    
    grant_type=password&client_id={IntegratorKey}&username={email}&password={password}&scope=api
    

    Make sure you supply your account email, password, and integrator key in the body.

    A successful response returns the following JSON:

    {
        "access_token": "",
        "scope": "api",
        "token_type": "bearer"
    }
    

    STEP #2:

    Here you add the header Authorization: bearer where is the token that was returned in step 1 and the email is now the email address of the user you want to send on behalf of:

    POST https://{server}/restapi/{apiVersion}/oauth2/token
    
    Authorization: bearer 
    Accept: application/json
    Content-Type: application/x-www-form-urlencoded
    Content-Length: {length of body}
    
    grant_type=password&client_id={IntegratorKey}&username={$emailOnBehalf}&password={password}&scope=api
    

    The result is another access token, let's say it's 12345.

    Step #3:

    Now you can send on behalf of this user by using the following auth headers in your signature request:

    Authorization: bearer 12345
    X-DocuSign-Act-As-User: $emailOnBehalf
    

    0 讨论(0)
提交回复
热议问题