{"id":5970,"date":"2021-01-20T06:16:00","date_gmt":"2021-01-20T06:16:00","guid":{"rendered":"https:\/\/www.greytrix.com\/blogs\/salesforce\/?p=5970"},"modified":"2021-01-18T06:21:19","modified_gmt":"2021-01-18T06:21:19","slug":"how-to-set-cookies-in-http-callout-apex-salesforce","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/salesforce\/2021\/01\/20\/how-to-set-cookies-in-http-callout-apex-salesforce\/","title":{"rendered":"How to set cookies in HTTP Callout (APEX Salesforce)"},"content":{"rendered":"\n<p>We were planning on adding one more integration between Salesforce and an Online ERP system. As part of our R&amp;D process, we were trying to connect and retrieve a sample data from Online ERP. But the ERP systems web services works little differently than other. Here, in addition we needed to assign the cookie information to subsequent web services call after successful login web services callout.<\/p>\n\n\n\n<p>First, we had tried to call the ERP system web services from Postman tool and collected all the information rather than directly writing apex code to save time. We easily got to know exact information required by the subsequent call for ERP web service by using Postman.<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2021\/01\/PostmanCookie.jpg\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2021\/01\/PostmanCookie.jpg\" alt=\"Postman Tool Cookie\"><\/a><\/center>\n<font size=\"2\"><center><i>Postman Tool Cookie<\/i><\/center><\/font>\n\n\n\n<p>Below is the code snippet that you can use to assign the cookies for web service call.<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2021\/01\/Code.jpg\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2021\/01\/Code.jpg\" alt=\"Code Snippet\"><\/a><\/center>\n<font size=\"2\"><center><i>Code Snippet<\/i><\/center><\/font>\n\n\n\n<p>In other words, data of any matter which is stored in Salesforce\/ERP is of a very important nature and depending on your business; it becomes crucial to manage this data in a secure manner. With GUMU&#x2122; it can be easy and a simple task, and you have better control over your business. <\/p>\n\n\n\n<p>We hope you may find this blog resourceful and helpful. If you still have concerns and need more help, please contact us at\u00a0<a rel=\"noreferrer noopener\" href=\"mailto:salesforce@greytrix.com\" target=\"_blank\">salesforce@greytrix.com<\/a><\/p>\n\n\n\n<p style=\"text-align: justify\"><b>About Us<\/b><\/br>\n<p><a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a> \u2013 a globally recognized and one of the oldest Sage Development Partner and a Salesforce Product development partner offers a wide variety of integration products and services to the end users as well as to the Partners and Sage PSG across the globe. We offer Consultation, Configuration, Training and support services in out-of-the-box functionality as well as customizations to incorporate custom business rules and functionalities that require apex code incorporation into the Salesforce platform.<br><br> Greytrix has some unique solutions for Cloud CRM such as <a href=\"\">Salesforce Sage integration<\/a> for <a href=\"https:\/\/www.greytrix.com\/sage-x3-erp\/integration\/\">Sage X3<\/a>, <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/sage-100-integration\/\">Sage 100<\/a> and <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/sage-300-integration\/\">Sage 300 (Sage Accpac)<\/a>. We also offer best-in-class Cloud CRM <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/crm-development\/\">Salesforce customization and development services<\/a> along with services such as Salesforce <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/data-migration-support\/\">Data Migration<\/a>, <a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/crm-development\/\">Integrated App development<\/a>, Custom App development and Technical Support business partners and end users. Salesforce Cloud CRM integration offered by Greytrix works with Lightning web components and supports standard opportunity workflow. Greytrix GUMU&#x2122; integration for Sage ERP \u2013 Salesforce is a 5-star rated app listed on <a href=\"https:\/\/appexchange.salesforce.com\/appxListingDetail?listingId=a0N30000000psM5EAI\" target=\"_blank\" rel=\"noopener\">Salesforce AppExchange<\/a>.<br> The GUMU&#x2122; Cloud framework by Greytrix forms the backbone of cloud integrations that are managed in real-time for processing and execution of application programs at the click of a button.<br><br> For more information on our Salesforce products and services, contact us at <a href=\"mailto:salesforce@greytrix.com\">salesforce@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n\n\n\n<p><strong>Related Posts<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2019\/09\/10\/gumu-features-security-matrix-in-salesforce-lightning-interface\/#:~:text=The%20Security%20Matrix%20of%20GUMU,to%20a%20specific%20User%20Profile.\" target=\"_blank\" rel=\"noreferrer noopener\">GUMU&#x2122; Features \u2013 Security Matrix in Salesforce Lightning Interface<\/a><\/li><li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2019\/08\/21\/import-entity-routine-in-gumus-new-pure-lightning-interface\/\" target=\"_blank\" rel=\"noreferrer noopener\">Import Entity Routine in GUMU\u2019s New Pure Lightning Interface<\/a><\/li><li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2019\/07\/31\/gumu-salesforce-import-routine-tricks-and-facts-about-the-use-of-filter-functionality\/\" target=\"_blank\" rel=\"noreferrer noopener\">GUMU&#x2122; Salesforce Import Routine \u2013 Tricks and Facts about the use of Filter Functionality<\/a><\/li><li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2019\/08\/21\/gumu-salesforce-import-routine-tricks-and-facts-about-creating-relationship-between-entities\" target=\"_blank\" rel=\"noreferrer noopener\">GUMU&#x2122; Salesforce Import Routine \u2013 Tricks and Facts about creating Relationship between Entities<\/a><\/li><li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2017\/10\/30\/import-data-from-sage-100-erp-to-salesforce-using-last-sync-field-and-value\/\" target=\"_blank\" rel=\"noreferrer noopener\">Import Data from Sage 100 ERP to Salesforce using Last Sync Field and Value.<\/a><\/li><li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2016\/01\/29\/allowrestrict-salesforce-user-access-to-erp-data-with-gumu-security-matrix\/\" target=\"_blank\" rel=\"noreferrer noopener\">Allow\/Restrict Salesforce user access to ERP data with GUMU&#x2122; Security Matrix.<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>We were planning on adding one more integration between Salesforce and an Online ERP system. As part of our R&amp;D process, we were trying to connect and retrieve a sample data from Online ERP. But the ERP systems web services works little differently than other. Here, in addition we needed to assign the cookie information\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2021\/01\/20\/how-to-set-cookies-in-http-callout-apex-salesforce\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[159,901,190,1027,1028,1045,1048,1026],"class_list":["post-5970","post","type-post","status-publish","format-standard","hentry","category-salesforce-srv","tag-gumu-sf-integration","tag-gumu-lightning-interface","tag-integration","tag-patch-method","tag-patch-verb","tag-postman-tool","tag-postman-tool-cookie-settings","tag-web-services"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/5970","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/comments?post=5970"}],"version-history":[{"count":2,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/5970\/revisions"}],"predecessor-version":[{"id":5974,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/5970\/revisions\/5974"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/media?parent=5970"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/categories?post=5970"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/tags?post=5970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}