{"id":994,"date":"2022-02-07T21:13:51","date_gmt":"2022-02-07T21:13:51","guid":{"rendered":"https:\/\/logicbuilder.integroscrm.com\/help\/?page_id=994"},"modified":"2022-08-10T16:32:14","modified_gmt":"2022-08-10T16:32:14","slug":"rest-client","status":"publish","type":"page","link":"https:\/\/logicbuilder.integroscrm.com\/help\/rest-client\/","title":{"rendered":"Rest Client"},"content":{"rendered":"\n<p><a name=\"abstract\"><\/a>Sends HTTP requests to a provided web server and receives responses from it. Supports URI-encoded and JSON-formatted requests. With this operator, it is possible to build integration with 3d part systems like marketing tools (HubSpot, Active Campaign, SalesManago), validation services (VAT Validators, e-mail verification services), or with your custom-developed systems if they have REST API.<\/p>\n\n\n\n<p><strong>inputs:<\/strong><\/p>\n\n\n\n<p><span style=\"color:#9ed267;\">url<\/span> &#8211; input the link to the REST API, a specific method to call, or a URI-encoded call. To compose URL it is possible to use either <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/concatenate-strings\/\">Concatenate Strings<\/a> and combine URL from several Strings or <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-http-query-string-from-array\/\">Get Http Query String From Array<\/a><\/p>\n\n\n\n<p><em>example of composing URL request to ActiveCampaign API to get specific Tags using string concatenation<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/rest_client_1-1024x529.png\" alt=\"\" class=\"wp-image-1125\" width=\"776\" height=\"401\" srcset=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/rest_client_1-1024x529.png 1024w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/rest_client_1-300x155.png 300w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/rest_client_1-768x397.png 768w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/rest_client_1.png 1078w\" sizes=\"auto, (max-width: 776px) 100vw, 776px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Required: yes<\/li><\/ul>\n\n\n\n<p><span style=\"color:#9ed267;\">http method<\/span> &#8211; select from the list HTTP method of the request: GET, POST, PUT, DELETE<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Required: yes<\/li><\/ul>\n\n\n\n<p><span style=\"color:#ec8f45;\">headers<\/span> &#8211; input link from <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-http-headers-from-structure\/\">Get Http Headers From Structure<\/a> to provide Headers of the request.&nbsp;Headers are formed as &#8216;Header Name&#8217; = &#8216;Header Value&#8217;. Headers are composed using Structure operators: in <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/structure-schema\/\">Structure Schema<\/a> define&nbsp;Headers Names&nbsp;and with <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/set-structure-fields\/\">Set Structure Fields<\/a> define Header Values. Finally with <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-http-headers-from-structure\/\">Get Http Headers From Structure<\/a> convert Structure into Headers and input into <span style=\"color:#ec8f45;\">REST Client<\/span> operator.<\/p>\n\n\n\n<p><em>example of composing header to request ActiveCampaign API&nbsp;<\/em><\/p>\n\n\n<p><a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/rest_client_2.png\" rel=\"prettyPhoto\"><img decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/rest_client_2-1024x217.png\" alt=\"\" class=\"wp-image-378\"><\/a><\/p>\n\n\n<ul class=\"wp-block-list\"><li>Required: no (depends on web server to which request is sent, but doesn&#8217;t require by the operator itself)<\/li><\/ul>\n\n\n\n<p><span style=\"color:#ec8f45;\">query parameters<\/span> &#8211; input request body or payload.&nbsp;Query parameters may be composed with:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><em>structure<\/em>&nbsp;following with <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-rest-parameters-from-structure\/\">Get Rest Parameters From Structure<\/a><\/li><li><em>array<\/em>&nbsp;using operators from <span style=\"color:#ec8f45;\">Array<\/span> group<\/li><li><em>strings<\/em>&nbsp;following with <span style=\"color:#ec8f45;\">Get Rest Parameters from String<\/span><\/li><\/ol>\n\n\n\n<p><em>example of composing query parameters with array operators:<\/em><\/p>\n\n\n<p><a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/rest_client_3.png\" rel=\"prettyPhoto\"><img decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/rest_client_3-1024x339.png\" alt=\"\" class=\"wp-image-378\"><\/a><\/p>\n\n\n<ul class=\"wp-block-list\"><li>Required: no (depends on web server to which request is sent and request)<\/li><\/ul>\n\n\n<div style=\"background-color: #ddeaff; border-left: 6px solid #0072b3; padding: 12px;\">\n<p>Note: POST request requires a body. If there is no body expected for POST request use an empty JSON like this:&nbsp;{\u200b\u200b\u200b\u200b\u200b}\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b\u200b<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1125\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/rest_client_4.png\" alt=\"\" width=\"663\" height=\"369\"><\/p>\n<\/div>\n\n\n<p><span style=\"color:#ec8f45;\">authentication<\/span> &#8211; input authentication data for the request when it is not provided directly in URL or Headers.&nbsp;Authentication may be defined in one of the following ways depending on particular REST API requirements:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Basic Http Authentication &#8211; the simplest one, when login and password are transmitted in the &#8216;Authorization&#8217;&nbsp; header in unencrypted form. For this type of authentication, it is needed to input the output from <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/basic-http-authentication\/\">Basic Http Authentication<\/a> with defined login and password<\/li><li>Oath2 &#8211; input the output from <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/oauth2-authentication\/\">OAuth2 Authentication<\/a> operator filled with OAuth2 parameters.<\/li><li>If you already have an access token, you can use it in the <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-oauth2-authentication-from-token\/\">Get Oauth2 Authentication From Token<\/a> operator and input its output to authentication input.<\/li><\/ol>\n\n\n\n<ul class=\"wp-block-list\"><li>Required: no&nbsp; (depends on web server to which request is sent and request, but doesn&#8217;t require by the operator itself)<\/li><\/ul>\n\n\n\n<p><span style=\"color:#ec8f45;\">proxy<\/span> &#8211; input proxy settings if they are required to request REST API.&nbsp;Proxy can be defined in two ways:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Use Proxy Settings defined in Sugar settings (Administration-&gt;System Settings-&gt;Proxy Settings). In this case, input the output from operator <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/sugar-proxy\/\">Sugar Proxy<\/a><\/li><li>Use own proxy settings with operator <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/proxy\/\">Proxy<\/a><\/li><\/ol>\n\n\n\n<ul class=\"wp-block-list\"><li>Required: no<\/li><\/ul>\n\n\n\n<p><strong>outputs:<\/strong><\/p>\n\n\n\n<p><span style=\"color:#ec8f45;\">response<\/span> &#8211; the result of the request to REST API. Please note that only JSON format can be processed. It is possible to process the response with:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Structure with <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-structure-from-json\/\">Get Structure From JSON<\/a>, providing input schema with needed parameters from the response<\/li><li>Collection with <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-collection-from-json\/\">Get Collection From JSON<\/a><br><em>below is an example of parsing response from HubSpot API of GET \/contacts\/v1\/lists\/all\/contacts\/recent using structures and collections<\/em><\/li><li>Array with <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-array-from-json\/\">Get Array from Json<\/a> following with <span style=\"color:#ec8f45;\">Array<\/span> operators<br><em>below is the same parsing of response as on the screenshot above but using Array operators<\/em><\/li><\/ol>\n\n\n<p><a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/rest_client_6.png\" rel=\"prettyPhoto\"><img decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/rest_client_6-1024x361.png\" alt=\"\" class=\"wp-image-378\"><\/a><\/p>\n\n\n<p><span style=\"color:#b197cb;\">response code<\/span> &#8211; code that was returned as a result. A successful response is 200. Can be used to handle errors:<\/p>\n\n\n<p><a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/rest_client_7.png\" rel=\"prettyPhoto\"><img decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/rest_client_7-1024x507.png\" alt=\"\" class=\"wp-image-378\"><\/a><\/p>\n\n\n<p>The request to Sugar REST API can be configured like this:<\/p>\n\n\n<p><a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-128-7db4c5dbef7e49d99eb4336c9b2e457e.png\" rel=\"prettyPhoto\"><img decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-128-7db4c5dbef7e49d99eb4336c9b2e457e-1024x536.png\" alt=\"\" class=\"wp-image-378\"><\/a><\/p><div style=\"text-align:left\" class=\"yasr-auto-insert-visitor\"><!--Yasr Visitor Votes Shortcode--><div id='yasr_visitor_votes_994' class='yasr-visitor-votes'><div class=\"yasr-custom-text-vv-before yasr-custom-text-vv-before-994\">Click to rate this post!<\/div><div id='yasr-vv-second-row-container-49e687dada017' \n                                        class='yasr-vv-second-row-container'><div id='yasr-visitor-votes-rater-49e687dada017'\n                                      class='yasr-rater-stars-vv'\n                                      data-rater-postid='994' \n                                      data-rating='0'\n                                      data-rater-starsize='24'\n                                      data-rater-readonly='false'\n                                      data-rater-nonce='fa81b01ba5' \n                                      data-issingular='false'\n                                    ><\/div><div class=\"yasr-vv-stats-text-container\" id=\"yasr-vv-stats-text-container-49e687dada017\"><svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" width=\"20\" height=\"20\" \n                               class=\"yasr-dashicons-visitor-stats\"\n                               data-postid=\"994\" \n                               id=\"yasr-stats-dashicon-49e687dada017\">\n                            <path d=\"M18 18v-16h-4v16h4zM12 18v-11h-4v11h4zM6 18v-8h-4v8h4z\"><\/path>\n                          <\/svg><span id=\"yasr-vv-text-container-49e687dada017\" class=\"yasr-vv-text-container\">[Total: <span id=\"yasr-vv-votes-number-container-49e687dada017\">0<\/span>  Average: <span id=\"yasr-vv-average-container-49e687dada017\">0<\/span>]<\/span><\/div><div id='yasr-vv-loader-49e687dada017' class='yasr-vv-container-loader'><\/div><\/div><div id='yasr-vv-bottom-container-49e687dada017' class='yasr-vv-bottom-container'><\/div><\/div><!--End Yasr Visitor Votes Shortcode--><\/div>","protected":false},"excerpt":{"rendered":"<p>Sends HTTP requests to a provided web server and receives responses from it. Supports URI-encoded and JSON-formatted requests. With this operator, it is possible to build integration with 3d part systems like marketing tools (HubSpot, Active Campaign, SalesManago), validation services (VAT Validators, e-mail verification services), or with your custom-developed systems if they have REST API. &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/logicbuilder.integroscrm.com\/help\/rest-client\/\"> <span class=\"screen-reader-text\">Rest Client<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","footnotes":""},"tags":[],"class_list":["post-994","page","type-page","status-publish","hentry"],"yasr_visitor_votes":{"number_of_votes":0,"sum_votes":0,"stars_attributes":{"read_only":false,"span_bottom":false}},"_links":{"self":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/994","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/comments?post=994"}],"version-history":[{"count":7,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/994\/revisions"}],"predecessor-version":[{"id":2108,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/994\/revisions\/2108"}],"wp:attachment":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/media?parent=994"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/tags?post=994"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}