File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed 
certified-connectors/DocuSignDemo Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 545545    "/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/fields" : {
546546      "get" : {
547547        "summary" : " Get envelope document custom fields" 
548-         "description" : " Get envelope  document custom  fields." 
548+         "description" : " Get custom  document fields of envelope document ." 
549549        "operationId" : " GetEnvelopeDocumentFields" 
550550        "parameters" : [
551551          {
Original file line number Diff line number Diff line change @@ -1797,6 +1797,29 @@ public class Script : ScriptBase
17971797      body [ "workflowIds" ]  =  workflowsArray ; 
17981798      response . Content  =  new  StringContent ( body . ToString ( ) ,  Encoding . UTF8 ,  "application/json" ) ; 
17991799    } 
1800+ 
1801+     if  ( "GetEnvelopeDocumentFields" . Equals ( this . Context . OperationId ,  StringComparison . OrdinalIgnoreCase ) ) 
1802+     { 
1803+       var  body  =  ParseContentAsJObject ( await  response . Content . ReadAsStringAsync ( ) . ConfigureAwait ( false ) ,  false ) ; 
1804+       var  query  =  HttpUtility . ParseQueryString ( this . Context . Request . RequestUri . Query ) ; 
1805+       var  newBody  =  new  JObject ( ) ; 
1806+       JArray  envelopeDocumentFields  =  new  JArray ( ) ; 
1807+ 
1808+       foreach ( JProperty  documentFields  in  body . Properties ( ) ) 
1809+       { 
1810+         foreach ( var  field  in  documentFields . Value ) 
1811+         { 
1812+           envelopeDocumentFields . Add ( new  JObject ( ) 
1813+           { 
1814+             [ "name" ]  =  field [ "name" ] , 
1815+             [ "value" ]  =  field [ "value" ] 
1816+           } ) ; 
1817+         } 
1818+       } 
1819+ 
1820+       newBody [ "envelopeDocumentFields" ]  =  envelopeDocumentFields ; 
1821+       response . Content  =  new  StringContent ( newBody . ToString ( ) ,  Encoding . UTF8 ,  "application/json" ) ; 
1822+     } 
18001823
18011824    if  ( "GetEnvelopeDocumentTabs" . Equals ( this . Context . OperationId ,  StringComparison . OrdinalIgnoreCase ) ) 
18021825    { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments