{"info":{"_postman_id":"dc50cbdb-07f4-49e3-8bc4-9d91999cadd4","name":"Doc-Generator","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"10166110","collectionId":"dc50cbdb-07f4-49e3-8bc4-9d91999cadd4","publishedId":"UyxogiW3","public":true,"customColor":{"top-bar":"303030","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2022-05-20T08:57:33.000Z"},"item":[{"name":"API DOCUMENTATION","item":[{"name":"Generate Bulk Doc","id":"ad40e44d-18d3-438f-a504-deddcd0e7109","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"[{\n    \"config_id\": 1,\n    \"data\": {\n        \"1\": \"Developer\",\n        \"17\": \"09-02-2022\",\n        \"2\": \"Software engineer\",\n        \"4\": \"D.K\",\n        \"6\": \"R.V Bangalore\",\n        \"7\": \"09-02-2022\",\n        \"8\": \"3\",\n        \"9\": \"Rahul\",\n        \"10\": \"Math\",\n        \"11\": \"50\",\n        \"12\": \"50\",\n        \"13\": \"Yes\",\n        \"14\": \"Yes\",\n        \"15\": \"5\",\n        \"16\": \"5\",\n        \"17\": \"5\",\n        \"18\": \"Yes\",\n        \"19\": \"Yes\",\n        \"20\": \"Concept\",\n        \"21\": \"Teaching way\",\n        \"22\": \"Practical\",\n        \"23\": \"Yes\",\n        \"24\": \"3 hours\",\n        \"25\": \"100%\",\n        \"26\": \"100%\",\n        \"27\": \"Yes\",\n        \"28\": \"09-02-2022\",\n        \"29\": \"Math\",\n        \"30\": \"Rahul\",\n        \"31\": \"50\",\n        \"32\": \"50\",\n        \"33\": \"Yes\",\n        \"34\": \"Yes\",\n        \"35\": \"5\",\n        \"36\": \"5\",\n        \"37\": \"5\",\n        \"38\": \"Yes\",\n        \"39\": \"Yes\",\n        \"40\": \"Concept\",\n        \"41\": \"Teaching way\",\n        \"42\": \"Practical\",\n        \"43\": \"Yes\",\n        \"44\": \"3 hours\",\n        \"45\": \"100%\",\n        \"46\": \"100%\",\n        \"47\": \"Yes\",\n        \"48\": \"09-02-2022\"\n    },\n    \"template_id\": 31,\n    \"plugin\": \"pdf\"\n},\n{\n    \"config_id\": 1,\n    \"data\": {\n        \"1\": \"Developer\",\n        \"17\": \"09-02-2022\",\n        \"2\": \"Software engineer\",\n        \"4\": \"D.K\",\n        \"6\": \"R.V Bangalore\",\n        \"7\": \"09-02-2022\",\n        \"8\": \"3\",\n        \"9\": \"Rahul\",\n        \"10\": \"Math\",\n        \"11\": \"50\",\n        \"12\": \"50\",\n        \"13\": \"Yes\",\n        \"14\": \"Yes\",\n        \"15\": \"5\",\n        \"16\": \"5\",\n        \"17\": \"5\",\n        \"18\": \"Yes\",\n        \"19\": \"Yes\",\n        \"20\": \"Concept\",\n        \"21\": \"Teaching way\",\n        \"22\": \"Practical\",\n        \"23\": \"Yes\",\n        \"24\": \"3 hours\",\n        \"25\": \"100%\",\n        \"26\": \"100%\",\n        \"27\": \"Yes\",\n        \"28\": \"09-02-2022\",\n        \"29\": \"Math\",\n        \"30\": \"Rahul\",\n        \"31\": \"50\",\n        \"32\": \"50\",\n        \"33\": \"Yes\",\n        \"34\": \"Yes\",\n        \"35\": \"5\",\n        \"36\": \"5\",\n        \"37\": \"5\",\n        \"38\": \"Yes\",\n        \"39\": \"Yes\",\n        \"40\": \"Concept\",\n        \"41\": \"Teaching way\",\n        \"42\": \"Practical\",\n        \"43\": \"Yes\",\n        \"44\": \"3 hours\",\n        \"45\": \"100%\",\n        \"46\": \"100%\",\n        \"47\": \"Yes\",\n        \"48\": \"09-02-2022\"\n    },\n    \"template_id\": 31,\n    \"plugin\": \"docx\"\n}]","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/bulk/generate/","description":"<p><strong>plugins available:</strong></p>\n<ul>\n<li><strong>pdf</strong></li>\n<li><strong>docx</strong></li>\n<li><strong>html</strong></li>\n<li><strong>qr</strong> (<a href=\"https://github.com/Path-Check/paper-cred#paper-first-verifiable-credentials-uri-specification\">path-check paper VC</a>)</li>\n<li><strong>qr-json</strong> (<a href=\"https://github.com/Samagra-Development/Doc-Generator/issues/32\">Github Issue</a>)</li>\n</ul>\n","urlObject":{"path":["bulk","generate",""],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"ad40e44d-18d3-438f-a504-deddcd0e7109"},{"name":"Get Status of Doc Generation Process","id":"bd0cbf01-773a-4183-a1a2-dc8a18568eed","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url}}/bulk/generate/566f832f-fbfc-4ae5-944d-fb452569e57f","urlObject":{"path":["bulk","generate","566f832f-fbfc-4ae5-944d-fb452569e57f"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"bd0cbf01-773a-4183-a1a2-dc8a18568eed"}],"id":"f4b53459-d89a-4d9b-89d8-e4d0963a19ad","description":"<p>Postman Collection <a href=\"https://www.getpostman.com/collections/906eb4679af014e264fc\">here</a></p>\n<h2 id=\"introduction\">Introduction</h2>\n<p>An easy to integrate and resusable microservice built on OSS, can be easily leveraged to generate single and bulk documents in the any available formats interoperably and at same time it can upload the docs to your CDN and generate a short url for the content, you can integerate any url shortener service like bit.ly, tinyurl, etc (check our own url shortener service here). This service is developed on a plugin based model to ensure API federation across service and allow easy development of new plugins with less chances of error.</p>\n<h2 id=\"overview\">Overview</h2>\n<p>A simple doc generating service which is capable of generating single and bulk docs from templates, the service is capable of generating real time on demand docs along with bulk doc generation for a provided template at scale and at same time allows doc uploading to a provided CDN. It allows integrations with services like URL shorteners for shortening the CDN object url to a short url, etc. It has inbuilt audit features to track doc generation status for async API calls. The service currently supports below formats for doc generation.</p>\n<h3 id=\"current-features\">Current Features:</h3>\n<ul>\n<li>Allow doc generation(.pdf, .docx, .png) from Google Doc templates</li>\n<li>Allow bulk request processing</li>\n<li>Allow easy integration for multiple CDN providers</li>\n<li>Allow easy integrations for URL shortener services</li>\n<li>Allow real time transforms on the raw data for complex template processing</li>\n<li>Allow audit logs for tracking doc generation stages (useful in case of tracking async requests like bulk processing requests)</li>\n</ul>\n<h2 id=\"authentication\">Authentication</h2>\n<p>Presently APIs are not authenticated. The secrets and configs are allowed to be stored via the inbuilt Config Service schema which stores the secrets after encrypting and the data is only decrypted within the service.</p>\n<p>The future need for any use case for Authentication mechanism will be shared here.</p>\n<h2 id=\"api-specifications\">API Specifications</h2>\n<p><strong>PRODUCTION ENDPOINT:</strong> <a href=\"http://68.183.94.187:8000\">http://68.183.94.187:8000</a></p>\n<h3 id=\"glossary\">Glossary:</h3>\n<ul>\n<li><strong>config_id</strong>: Unique Id which returns the saved configs and secret saved.</li>\n<li><strong>data</strong>: JSON key,value pairs for template formatting and transformation.</li>\n<li><strong>type</strong>: Attribute sent in the request to classify which type of template is being registered.</li>\n<li><strong>plugin</strong>: It helps in determining which plugin should be used for the final document output.</li>\n<li><strong>templater</strong>: Microservice that is used as the base engine for transforming data in a template</li>\n<li><strong>transformers</strong>: Set of rules for transformation defined for a data in a template. Ex. A transformer for MCQ data that can hold separate transformations for different provided choices. oc generator helps in defining mapping logics for the incoming data and do on request transformations on the provided data.</li>\n<li><strong>template_id: The id of the registered template</strong></li>\n</ul>\n<blockquote>\n<p>Templater Repository can be found <a href=\"%5Bhttps://github.com/Samarth-HP/templater/tree/master%5D(https://desktop.postman.com/?desktopVersion=9.13.0&amp;userId=10166110&amp;teamId=2534551)\">here</a></p>\n</blockquote>\n<h3 id=\"bulk-generation\">Bulk Generation:</h3>\n<p>Doc Generator allows for bulk doc generations in background with API for tracking doc generation status and stages.The backgorund ctasks are carried out by celery workers.</p>\n<h3 id=\"auditing\">Auditing:</h3>\n<p>Doc generation stages are audited and stored in separate table which can be used to ship logs to other platforms or for log management purposes.</p>\n","_postman_id":"f4b53459-d89a-4d9b-89d8-e4d0963a19ad"},{"name":"Register Template","id":"d00ee871-fc02-4792-aa77-7af51500b388","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"type\": \"GOOGLE_DOC\",\n    \"data\": \"1LUSRxM5iYivLqtJXb4KzcCFmMJVRxxofsDOHq7wFtPU\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/register/","description":"<p><strong>type can be</strong>:</p>\n<ul>\n<li><strong>GOOGLE_DOC</strong>: when registering a template from a google doc</li>\n<li><strong>JSON</strong>: when registering with a JSON string</li>\n<li><strong>STRING</strong>: when registering with a raw string</li>\n</ul>\n","urlObject":{"path":["register",""],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"d00ee871-fc02-4792-aa77-7af51500b388"},{"name":"Get Registered Templates","id":"139aba7a-43bf-41d4-a176-750f80958cc1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url}}/register/?id=31","urlObject":{"path":["register",""],"host":["{{base_url}}"],"query":[{"key":"id","value":"31"}],"variable":[]}},"response":[],"_postman_id":"139aba7a-43bf-41d4-a176-750f80958cc1"},{"name":"RealTime Doc","id":"af67b038-bc72-404d-95db-611eec81741c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"config_id\": 1,\n    \"data\": {\n        \"1\": \"Developer\",\n        \"17\": \"09-02-2022\",\n        \"2\": \"Software engineer\",\n        \"4\": \"D.K\",\n        \"6\": \"R.V Bangalore\",\n        \"7\": \"09-02-2022\",\n        \"8\": \"3\",\n        \"9\": \"Rahul\",\n        \"10\": \"Math\",\n        \"11\": \"50\",\n        \"12\": \"50\",\n        \"13\": \"Yes\",\n        \"14\": \"Yes\",\n        \"15\": \"5\",\n        \"16\": \"5\",\n        \"17\": \"5\",\n        \"18\": \"Yes\",\n        \"19\": \"Yes\",\n        \"20\": \"Concept\",\n        \"21\": \"Teaching way\",\n        \"22\": \"Practical\",\n        \"23\": \"Yes\",\n        \"24\": \"3 hours\",\n        \"25\": \"100%\",\n        \"26\": \"100%\",\n        \"27\": \"Yes\",\n        \"28\": \"09-02-2022\",\n        \"29\": \"Math\",\n        \"30\": \"Rahul\",\n        \"31\": \"50\",\n        \"32\": \"50\",\n        \"33\": \"Yes\",\n        \"34\": \"Yes\",\n        \"35\": \"5\",\n        \"36\": \"5\",\n        \"37\": \"5\",\n        \"38\": \"Yes\",\n        \"39\": \"Yes\",\n        \"40\": \"Concept\",\n        \"41\": \"Teaching way\",\n        \"42\": \"Practical\",\n        \"43\": \"Yes\",\n        \"44\": \"3 hours\",\n        \"45\": \"100%\",\n        \"46\": \"100%\",\n        \"47\": \"Yes\",\n        \"48\": \"09-02-2022\"\n    },\n    \"template_id\": 31\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/generate/?plugin=pdf","urlObject":{"path":["generate",""],"host":["{{base_url}}"],"query":[{"key":"plugin","value":"pdf"}],"variable":[]}},"response":[],"_postman_id":"af67b038-bc72-404d-95db-611eec81741c"}]}