Generate documents and capture e-signatures in your apps using Document Generation and Sign APIs

A look at how the Adobe Document Generation API provides a powerful new way to generate impactful documents. In this session, you will learn how Adobe Document Generation API combined with Adobe Sign API, provides an easy way to generate dynamic documents ready to be processed through the Sign workflow.

Transcript
Thank you all for joining this session. My name is Sudhanshu, and I work as a strategic business development manager, and I’ve been with Adobe for seven years now. Today we are going to talk about some exciting features and technology of Adobe, that is a talk about Adobe Sign. So let me share my screen. All right, so I’ll just spin up my deck. So this is what we’re going to cover today, to talk how we can bring automation to document generation process, and then once we have the document generated, how it can be sent out for signature. And this is my agenda for today. We will talk about the DocChain and Adobe Sign API that can be used, how to get access to those APIs, and then I will talk about an exciting feature, Word Add-In, that plays a key role during the whole document generation journey. And then in the end, I will show you a quick demo of how to generate a document and send it out for signature. Now, when we talk about documents, so the first thing that comes to our mind and we need to solve for that problem is the data is going to be scattered at various other places. We may have data residing in a CRM system like Salesforce. We may have data residing on-premise or probably if there is an in-house ERP system or you have an ERP system or wherever, does not matter. So we need to collect all that data and process to generate a document. It seems a very cumbersome and tedious and difficult task, but this DocChain API that we are going to talk about shortly is going to make life very easy. It will make the complete process of getting the data and creating a PDF out of it dynamically with all the control in a very streamlined way. So if you are worried about generating invoices, contracts, reports, letters, notices, policy packages, any kind of document, so the prerequisite that you need to have is you need to know where the data is so that you can fetch the data. I’ll tell you how to structure that data so that it can be converted into a PDF document. So the prerequisite is you need to have a Word document with all the placeholders that are going to hold the data and you need to have a JSON file, and that JSON is going to have all the raw content, the data that you want to push in a PDF document or a Word document. So as long as you have a JSON file with all that data, you can create a Word document or a PDF dynamically using our DocGen API, that is the document generation API. That’s part of the document cloud suite. And then once you have that PDF generated, you can use the Adobe Sign API to send it out for signature. DocGen has a native integration with Adobe Sign. So what I mean is that DocGen is going to generate some tags that Adobe Sign can very easily recognize. The moment you generate a document and send it out, hand it over to Adobe Sign, which is the cloud-based signature system, then Adobe Sign will very easily recognize those tags because it is already integrated. And then Adobe will get to know that these tags need to be converted and showed or handled in a specific manner. So these two systems, the DocGen API and Adobe Sign API, they know each other pretty well. There is a handshake that’s already there. There is an integration that is already there that we are going to use. So the whole crux of this session, the takeaway is how to automate the complete process of generating a document and sending out for signature. And the prerequisite is one, you got to have the Word template that is going to hold the data. I’ll show you how it works. And the second is you need to have a JSON file. Having all that raw content or data that you want to push in the Word document and then ultimately you can also create a PDF document out of it. And this is how it works. So let’s say this is a quick example. If this is your Word document, it is going to have certain tags. So these are the tags that are going to hold data, candidate first name, last name, address. And other tags. And then this is going to be the output file. And the data is going to come from the JSON document. The JSON file is going to have all the data. So you need to build a logical kind of an application that is going to get all the data from various other systems like CRM system or wherever you have the data residing. And then create a JSON file. And then the JSON file and the Word document will go as an input to that docgen endpoint. And then you’ll have a Word document or a PDF document as an output. All right? I will show you that in action. So that will make things clear. Now, if you talk about the benefits of it, it’s more than just generating a document. In fact, way more than that. So we have the intelligence of Adobe Sensei that is the artificial intelligence and machine learning engine that is being used in Adobe APIs. And then second is, as I said, it’s more than generating a document. It means you can add your own intelligence. In terms of the tags, if you want, you can hide or show certain sections in the document based on some conditions. Or if you want to generate invoices, I’ll give you an example. So you might want to make some calculations using some arithmetic operations, like you want to sum some values, do some aggregate or average. So we have all those functions to support you. So without wasting any time, let me quickly jump over to the section where I will show you how to get access to the API and then we’ll go into the demo. But before we do that, there is one important thing that you need to understand is, what if Doc Gen API is not there? Then what is the way to generate a document? Well, you can use Adobe Sign, and you can create a document. So Adobe Sign has its own way of placing, so we call it as a text tag. You need to tag the document, and then dynamically while calling the API, you will pass the data in JSON request, it will go as a body. And then in the end, you’ll have an output document that will go out for signature. So that will work in Adobe Sign, that’s how it will work. Now, the problem here is, let’s say if you have a table in the document, and then tomorrow, if two new column or gets added to the table, then you need to go back to that Word document and add those tags manually again. So you’ll have to keep on changing the Word document. So it is kind of partially automated, not fully automated. And the document that you’re going to generate in Adobe Sign will be used for signature purpose. So you need a way only to generate a document with all those fancy features of adding a condition, doing mathematical calculations. And even if tomorrow, let’s say if the row or even a column is going to grow, then you should be able to accommodate that dynamically without having to make changes to the Word document. So that’s exactly, these are the problems that the Document Generation API is going to solve for. Let me quickly show you how to get access to the API. So this is the adobe.io page, you go to get credentials, and then go to Document Generation. It’s a client-side, server-side API. And then you can go to start a free trial. And then it will let you create new credentials for Document Services API. So if you have an existing credential, you can manage that from IO console. And if you don’t have one, you can always create a new credential from here, get started. And then it will give you all the credentials that you need to use to generate the documents. So it will give you a private key and a client ID and secret that you can use. So, and the second thing is, this will give you the access to Document Generation API, whatever Adobe sign, right? So that is also important. Now, to Adobe sign, you can go to this URL adobe.com, like there is a developer form, so you can fill out this form and submit, and then you’ll get access to Adobe Sign Developer Account. And a developer account comes up with access to all the REST API, for Adobe sign, right? So now, you know how to get access to this API. Now you have access to the Talk chain API, and then you have access to the Adobe sign API. Now let me show you how the Adobe sign API looks like. I mean, just at a high level. Now this is once you create a developer account, this is going to be the dashboard of Adobe sign. And now let’s say if you want to send a document out for signature, you can click the send button. And you can add a document, you can create a, you know, you can provide a recipient email ID here, and if you want, you can add a document from here, and then click send, it will send the document out for signature. So this guy, adobe sign4uplus2 at the gmail.com will receive that document in terms of a signature requested email. Right? And that will be a link, I’ll show you shortly, that you need to click and then you’ll sign the document. But this is still from the user interface. Well, we are looking to automate this, right? So there is an API, so that is a post call, that is post slash agreements, right? So in Adobe, you need an access token, right? So you can refer to the documentation to how to get an access token to access Adobe sign API. But once you have the access, you know, to access these API, then you can go to, so there is a swagger page for Adobe sign. If you scroll down, right, all the way to the bottom on the API information and go to REST API methods documentation. So this is all the endpoints, the REST endpoint that Adobe has, Adobe sign has, right? You can upload a document using transient documents, right? You can create an agreement using post agreements call. And this is extremely developer friendly, right? So it is going to follow the OAuth 2 process to create an access token. And then you have all the details over here, like, so you need to, so these are the mandatory fields that you want to have in order to make this post agreements call. And once you make this post agreements call, the agreement will be created and it will be sent out for signature. So here it is mentioned, like you need to specify this as a header and there is a JSON request that you need to create and that will be in the JSON body, the content type is application of JSON. And once you hit try it out, there is a link like minimal model schema, and there is a complete model schema. And then you can go to model to get all the details about the elements that you’re going to include in the JSON. And the best part is, it’s very developer friendly. If you click here, it will pre-populate this thing. So you just need to fill out all this information. Now, why I’m showing this to you is, this is the swagger page. Now you need to have a client system, like you can use a postman to do that, or you can develop your own client system that is going to consume this API. Now let’s see how these two APIs can be clubbed, or interconnected to accomplish that automation end to end, generate the document and send it out for signature. So we have the prerequisites met, you have access to the API for DocChain and for Adobe Sign. Now, for DocChain, you need to have a Word document that is going to hold the data. And the data is going to come from the JSON file. So let’s take a look at both of them. So this is the Word document that I have, that I’m going to use for this demo. If you look at this, it’s a sales order. And then there is an image placeholder. So this is going to hold an image. That image is going to come from the JSON file. So in JSON, we are going to have the base64 format of the image. And then these are the tags, customer.name, customer.company. And then there is a table, and this is going to go dynamically. Let’s say if you have multiple products, then it will list down multiple rows. And then it is going to make some calculations, and it is calculating total fees. Likewise, we are including two more images, and then there is a list, kind of a table. And then there is a list that is going to display the products. And this is going to be multiple. Now, you must be wondering, quite tedious job, right? I mean, if you have to tag this document manually, well, yes, of course. But there is a very easy way that Adobe has come up with. So Adobe has partnered with Microsoft and has developed a word add-in. So you can add that word add-in to your Word document, and that will let you place these tags in a very intuitive way. So once you add that add-in, you’ll see this link, document generation. If you click here, it will open up. So this is document dagger. Then you need to click on Get Started, Upload your JSON. So this is my sales order JSON file. I’ll upload this, and this is the JSON document. So if you look at this, it has the agreement, you know, currency, revenue, these are product details. And then this is the fee structure. I mean, I’ll show you. So this is the table, and this is the data that is going to get filled out in this table when we’re going to generate either a PDF or a Word document. And then it has, you know, multiple products like this. So this is the company product list. If you scroll down all the way, like this is where we are including the products, right? And these are the logos. So there is a logo at the top right here. So this is a base64 format of the logo. And likewise, I’ve included the base64 format of these two images. And these are the placeholders, right? So you can get more details by visiting the documentation site of a document generation API on adobe.io. Now, once you upload this JSON, you need to click the Generate Tags. Click here, and then it is smart enough to recognize all the tags that are there in the JSON document. So it is able to identify, hey, there is an agreement, you know, a number, currency, renewal, payment terms, company. Likewise, these are all under tags. Now, let’s say if you want to include country, select, move your cursor, and click Insert Text. There you go. Can you see this? This guy got auto-placed. Likewise, this is one-time activity. You don’t need to have any technical expertise. A business user can very easily author this document. And as I said, this is one-time activity, right? So likewise, just place all your tags, right? And then your Word document is ready. It has all the placeholders, as I said, to hold the data. And data is there in the JSON file. Now, it is more than just placing simple tags, right? So if you go to, this is a basic, right? And if you go to Advanced section, so there you have more intelligence. You can add images, right? The way I’ve done, I’ve added these to placeholders for the images. Likewise, you can do it from here, like this. So you have these, if you click on the drop-down, you can search for a tag that is there in the JSON document. Likewise, you can add your tables, list, you can add conditional content, right? So let’s say if the price is more than, let’s say, $500, then only show a specific section in the document. You can do that. You can add conditional content, very similar to if-else condition. If price is greater than this, then show, right? So you don’t have to write all those tags. It will be automatically placed by this guy. And likewise, you can add numerical calculations right here. And remember, I said there is a native integration with Adobe Sign? So for that, if you want to place Adobe Sign tags, let’s say if someone needs to sign the document, then you need to have a signature field on the document, right? I’ll show you. Excuse me, I’ve placed two signature fields for these two guys. Sign up one and sign in two, right? And then you need to click on the generate document. Now, let me show you. I’ve developed a client application that is calling this docchain API, right? And then I’m passing this JSON file and the Word document as an input, right? So it is going to generate a PDF document. So there are two ways. One is you can also generate a Word document with all the data and you can also generate a PDF document, right? So I’m going to show you a PDF one. So our program is going to generate the document and it will be sent for signature. And then I’ll show you how to get the document signed, right? So this is my code. And then this is the sales order that I just showed you. And this is the JSON file. This is a JSON file that has all the data. Right, now what I’m going to do is… Sorry, this guy, this is a JSON file. Now what I’m going to do is I’m going to run my API. I’m calling that create merge document to PDF. And now the API is running. It is getting data, right? And I’m expecting that output here and an email to my inbox saying that a document is waiting for you to sign, right? So this is my inbox. I should receive an email to sign the document and I should also receive a document right here. There you go. So I just got this document generated right away, 9.54 AM. Now if I try to view this document… There you go. So I have this logo added to the document. I got a customer name, agreement number and currency. This number all coming from the JSON document. Let’s call now. Now I have this table that got generated. Now if tomorrow two new rows gets added, I mean, I don’t need to touch this document. All we need to have is that data getting added to the JSON file. You already have an application or system that is going to generate that JSON document, right? So just call the API. Document is not going to change. You’ll have all those two rows added dynamically here and this calculation will be done automatically, right? And then I added these two images. I dynamically created charts and graphs and added them as a base64 format. And this is the summary of the fees, right? So this is the table. And then if you scroll down all the way to the bottom, so I have two signature tags, right? And let me show you the significance of these signature tags, right? So there you go. So I just received this email from Adobe Sign. So what I did is, I mean, just on a button click, I initiated the document generation process and then the document got generated and we got data from various other sources and created a JSON file and then we are getting the system, the API is getting all the data from the JSON, pushing that in the Word document, that is the Word document that we tagged using the Word tagger, right? That is going to hold data and then it is fully automated. I didn’t have to do anything. It also sent out the document to a recipient for signature, right? So I got this email, signature requested on sales order. Well, I’m going to click on this link. Okay, sorry, I should have. I’ll right click and open it in a private window. Now, this is the document that I received. This is a sales order and this is, I have all the data intact. I’ll directly jump on to the next required field. I’ll apply my signature in Miller. I’ll sign this document, I’ll apply my signature and then I added a field to provide some comments. So this is my comment from King, something like that, right? I’ll click to sign. Now, this document is signed by the first recipient. Now, the recipients, I have another recipient who need to sign this document, right? So I got another email just zero minutes ago and now I’ll do the same thing. I’ll open it in a new private window and then I’ll jump on to the next required field. There you will see the signature from King is already there. Now, I will sign on behalf of John. So John is going to sign this document. I’ll hit apply. The signature is applied and then I’ll move on. There is a comment, so comment from John. I’ll hit click to sign. So document is signed. I can download a copy of it and now if I open it, there you go. So this is the signed copy of the document. And by the way, it is fully certified. If you look at the top blue ribbon bar, it is certified by Adobe sign. It means it is tampered proof. You cannot edit this document. If you try to click edit PDF, it will say the document is signed. It cannot be edited. So it’s secure, tampered proof. Now, if you scroll all the way to the bottom, you’ll see the signatures from King and John. So what we did is we are having data coming from various other sources. It could be a CRM system like Salesforce or any other source from where we’re going to get the data. We need to create a JSON document. So we’ll have a system or application that will be able to create so we’ll have a system or application that is going to… The job is just to create that JSON file. There is a one-time activity to author or tag a Word document that is going to act as a placeholder. And once you have that placeholder Word document, just feed it to the API. API is going to take two inputs. One is the JSON file, the other is the Word document. And the output is going to be a PDF document. And since it is already integrated with Adobe sign, I’ve made it fully automated. It is calling the Adobe Sign API. It is setting it up for signature. And then you have the signed copy of the document in front of you. So we can automate all these processes by using the Doc Gen and Adobe Sign API or generating a document and sending it out for signature. So that’s all I wanted to cover today. And I hope it helps. So please go to Adobe Sign documentation and Adobe.io to create your own credentials and access token for Adobe Sign and get your hands dirty. Thank you.

Additional Resources

recommendation-more-help
3c5a5de1-aef4-4536-8764-ec20371a5186