Guest User

Untitled

a guest
Dec 17th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. enter code here String templateId = "45deb3ff-6054-4316-bd4d-a3cee82ff527";
  2. TemplatesApi templateApi = new TemplatesApi();
  3. EnvelopeTemplate envelopeTemplate;
  4. try {
  5. envelopeTemplate = templateApi.get(accountId, templateId);
  6.  
  7. List<Document> documentList = envelopeTemplate.getDocuments();
  8.  
  9. Document document = documentList.get(0);
  10.  
  11. String documentId = document.getDocumentId();
  12.  
  13. DocumentFieldsInformation dfi = templateApi.listDocumentFields(accountId, templateId, documentId);
  14. CustomFields cf= templateApi.listCustomFields(accountId, templateId);
  15. List<TextCustomField> lcf = cf.getTextCustomFields();
  16.  
  17. for(int i = 0; i < lcf.size(); i++) {
  18. TextCustomField aaa = lcf.get(i);
  19. }
  20.  
  21. List<NameValue> nv = dfi.getDocumentFields();
  22. Iterator<NameValue> i = nv.iterator();
  23. while(i.hasNext()) {
  24. NameValue nv2 = i.next();
  25. String name = nv2.getName();
  26. String value = nv2.getValue();
  27. nv2.setValue("test");
  28. }
  29. } catch (ApiException e) {
  30. }
Add Comment
Please, Sign In to add comment