{"id":162,"date":"2018-12-31T00:55:36","date_gmt":"2018-12-31T00:55:36","guid":{"rendered":"https:\/\/vestigios.com\/blog\/?p=162"},"modified":"2023-02-08T22:59:50","modified_gmt":"2023-02-08T22:59:50","slug":"sl-proxyapi-manager","status":"publish","type":"post","link":"https:\/\/vestigios.com\/blog\/?p=162","title":{"rendered":"SL proxyAPI Manager"},"content":{"rendered":"\n<p class=\"portfolio-date wp-block-paragraph\">[2018] <\/p>\n\n\n\n<p class=\"textjustify wp-block-paragraph\">I never decided on the name for this project SL proxyAPI Manager or Salesforce Doc Generator, sometimes the naming makes us spend a lot of time. Serious\u2026  This was a small project that came up at the request of a friend of mine who has a business that uses the Salesforce CRM platform. The project would be limited (or not) by a shared linux server (cPanel), using PHP and MySQL. I embraced this little challenge because my background was mainly ASP.NET C# and the company where I was we were using PHP and mySQL.  It would do just fine.<\/p>\n\n\n\n<p class=\"textjustify wp-block-paragraph\">He needed to generate PDF documents from predefined templates, with data from an object he created in Salesforce. But he wanted to do this outside of the Salesforce platform and without using any plugins or other purchased integrations. As the CRM platform allows you to create &#8220;frontend buttons&#8221; that can call external links (urls) using parameters, I created a service that receives this call and returns an HTML rendered and merged with the data, thus being able to print or create a PDF.<\/p>\n\n\n\n<p class=\"textjustify wp-block-paragraph\">The Salesforce platform had an API with methods that exposed the object&#8217;s data through parameters, and it wasn&#8217;t hard to think of start creating a service\/API working as a proxy to obtain data from an object in Salesforce as the main bone of the process.<\/p>\n\n\n\n<p class=\"textjustify wp-block-paragraph\">I could generate a final PDF through templates embedded in project, but one of the requirements was that my friend be free to create other templates, thus making it easy in HTML for him or his employees. This way he can create the HTML&#8217;s as he wants, as well as include the TOKENs he wants. So I created then a web app, a manager for the &#8220;proxy API&#8221; where he can create new objects to map, define TOKENs etc\u2026 SL proxyAPI Manager.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-video aligncenter\"><video autoplay controls loop preload=\"auto\" src=\"https:\/\/vestigios.com\/blog\/wp-content\/uploads\/_movies\/sl-proxyapi-manager_demo.mp4\"><\/video><figcaption class=\"wp-element-caption\">viewing object, object variables and managing tokens<\/figcaption><\/figure>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-2 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_01.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"851\" data-id=\"587\" src=\"https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_01-1024x851.png\" alt=\"\" class=\"wp-image-587\" srcset=\"https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_01-1024x851.png 1024w, https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_01-300x249.png 300w, https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_01-768x638.png 768w, https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_01.png 1300w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_02.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"851\" data-id=\"586\" src=\"https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_02-1024x851.png\" alt=\"\" class=\"wp-image-586\" srcset=\"https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_02-1024x851.png 1024w, https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_02-300x249.png 300w, https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_02-768x638.png 768w, https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_02.png 1300w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_03.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"851\" data-id=\"588\" src=\"https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_03-1024x851.png\" alt=\"\" class=\"wp-image-588\" srcset=\"https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_03-1024x851.png 1024w, https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_03-300x249.png 300w, https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_03-768x638.png 768w, https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_03.png 1300w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_04.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"851\" data-id=\"589\" src=\"https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_04-1024x851.png\" alt=\"\" class=\"wp-image-589\" srcset=\"https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_04-1024x851.png 1024w, https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_04-300x249.png 300w, https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_04-768x638.png 768w, https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_04.png 1300w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<figcaption class=\"blocks-gallery-caption wp-element-caption\">main dashboard, main config for Saleforce API auth, objects management and list, detailed object and settings<\/figcaption><\/figure>\n\n\n\n<p class=\"textjustify wp-block-paragraph\">A third web service was created to be called by the &#8220;frontend button&#8221; in Salesforce, with the object ID and desired HTML template name, as parameters. Returning the final document rendered in HTML with the data of the object&#8230; neat!<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:15%\"><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:70%\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_05.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"838\" src=\"https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_05-1024x838.png\" alt=\"\" class=\"wp-image-590\" srcset=\"https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_05-1024x838.png 1024w, https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_05-300x246.png 300w, https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_05-768x629.png 768w, https:\/\/vestigios.com\/blog\/wp-content\/uploads\/2018\/12\/sl-proxyapi-manager_05.png 1319w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">(the template is not my design, its an oficial template&#8230; I know it&#8217;s ugly)<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:15%\"><\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[2018] I never decided on the name for this project SL proxyAPI Manager or Salesforce Doc Generator, sometimes the naming makes us spend a lot of time. Serious\u2026 This was a small project that came up at the request of a (&#8230;)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39],"tags":[42,49,48],"class_list":["post-162","post","type-post","status-publish","format-standard","hentry","category-solo-work-folio","tag-php","tag-webapp","tag-webservice"],"_links":{"self":[{"href":"https:\/\/vestigios.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vestigios.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vestigios.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vestigios.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vestigios.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=162"}],"version-history":[{"count":74,"href":"https:\/\/vestigios.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/162\/revisions"}],"predecessor-version":[{"id":715,"href":"https:\/\/vestigios.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/162\/revisions\/715"}],"wp:attachment":[{"href":"https:\/\/vestigios.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vestigios.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vestigios.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}