...
Section | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Download Request JSON not required Download Response JSON Should response 200 OK Attention: You can choose between three document ID`s which you got from the “get the envelope” request. For the “LogDocumentId” you get an Audit, for the “LogXmlDocumentId” you get an XML and for the “FlowDocumentId” you get the original document with the sign of the recipient. Please also see the following video which shows the process of downloading all different documents:
After the tutorial you should have the same requests which are shown in the next Figure. Please also see the following video which shows the process from the version call until the get envelope api call:
How to use variables in PostmanLet us start with the authorization but this time we will use variables, so we do not have to remember the api token for all other requests. Manage environmentsAfter selecting the configuration button which is shown in Figure 11 another window should appear which is shown in Figure 12. There you must give the environment a name and we have to create the two variables which are necessary for the authorization. Further details in the next Figure: First give your variable a name (it does not matter how you name them). Then fill in “initial value” and “current value” your api token. After filling up the environments for the variable, we now can use it in the header of the next request. AuthorizationFigure 13 shows you the same request we have already done in the tutorial above but this time we will use the variables we have just created. In the first column we have our api token. In the second column we now do not have to fill in our api token, but we must write {{##name_of_the_variable##}}. From now on you can always use the variable instead of continual writing your api token because all the dates are saved in the environments. If you run this request, you should get the status “200 OK”. Upload a fileNow we will upload a file and save the file ID which we will get from the request in another variable in the environments. Just these three lines of code are necessary to save the file ID in another variable. First we will parse the response, then we set the file ID with the command (“pm.environment.set(“name_of_the_variable”, response.” name_of_the_response”). After running this request, the new variable “sspFileId” should be in the environments. See next Figure: Send an envelopeAfter saving the file id we can now send the envelope with an integration of the variable. Therefore we just fill in {{ name_of_the_variable_for_the_fileID}} instead of copy paste the file ID. This is shown in the next Figure. In the Figure 17 there is another example of how you save a date from the response. In this case we will save the envelope ID. Get envelope description
We now want to save the different document ID`s (LogDocumentId, LogXmlDocumentId, FlowMDocumentId). Therefore, we must check if the array has a length higher than 0. After that, we must do the same “set” command as in the previous once but now we have to “go” into the array. So we write again response.”name_of_the_array[on which place].”name_of_the_variable”.
After we have saved all documentId we can use them for the download request. You can find the configuration for saving the documentId here: Configuration Download the fileTherefore, we just have to attach the variable to the URL which is shown in the next Figure. Overview of all variablesAdvantages of using variables in PostmanFirst, we do not have to remember all dates which we get through all the requests. Furthermore, we can simply change the organization key and the username and wen can play all requests without other changes because the variables auto fill in the new dates in the requests. Moreover we have a better overview of all ID`s so that we can easily match them with the requirements of the requests. |
...