To run the batch make a POST request to following API
This API expects an empty json object as a parameter in the request body.
This API returns a unique URL in the response header identified by location key.
A GET request to this unique URL will tell you the status of the batch execution
The following video demonstrates the triggering of the batch configuration
Now that our batch configuration monthly statements is created, we are ready to execute against that particular configuration. So to execute, we need to make a post call. And the URL is this. This is the base URL followed by the config, the name of the configuration and then the execution here. We need to pass the authorization, which is of type bearer with the access token here and in the body we need to pass an MTGs on string here, JSON object. Let’s click on send to execute the post call here.
And the result that you get is a status code of 202. That means that our execution request has been accepted. And if you want to know the status of your execution request, you can go into the headers of the response that you got back, open up the, go to the location key and copy its value here. So this is the value. So you will get a URL here. You can copy this URL.
Copy this URL and make a get request against that particular URL. So let’s change this and make a get request against that particular URL which we got back from our previous post invocation. So this is the URL. Again, the headers will remain the same, authorization content type and the body is an empty JSON object, click on send.
So if you go to the response body, the status is 200. That means the call went through, go to the body here and here it’ll tell you the status of your batch request. So source container, the data files and output type is a PDF. And the status it says is processing, records count is three, and it’ll give you the details of your batch. So this is how you can execute against a configuration and then check the status of that batch. So if you were to click on this again, you can see if it is executed. So it still says, okay, now the success count is three. That means the batch has done its job of merging the data with the template and it has placed the PDF files in the appropriate location in your Azure storage container.
To view the generated PDF files. You’ll have to log in to your portal account Azure portal account, and you can open up the storage account that you have created. So go into the storage account. The storage account that we have used was called formcs going there, drill down into the container. So the container that we used was batch demo and inside the batch demo we had these data files and the statements so the generated PDF files will be placed under this folder here statements, and then go into the PDF folder in the success folders you should have the PDF files that were generated. So all the PDF files associated with that particular batch configuration that were executed will be stored here. And then from here you can download this PDF files using this UI or you can use the Azure Portal Rest APIs to download this PDF onto your system. -