Jump to content
  • Samples for HTTP Connector


    Ana Bahr

    In TIBCO Cloud? Integration - Connect, the REST Web Services Connector configures API calls for you based on a Swagger specification but is limited to RESTful HTTP/API calls. You can use the TIBCO Scribe® Online Connector for HTTP to build your own HTTP requests. The flexibility of HTTP allows you to configure Uri, Verb, Query Parameters, Headers, and Content. Content can be hard-coded in a formula or configured with the TIBCO Scribe® Online Connector for Mapper.

    These simple flows attempt to demonstrate some of these concepts and how they can be achieved using the HTTP Connector. Review the Block descriptions in the flows that explain the purpose of the associated Block.

    Prerequisites

    You can import the Sample App from the marketplace listing by searching for Samples for HTTP Connector and selecting Get. You will also need to Install the other prerequisite Connectors (if not installed already):

    • Sample - CRM Connector and an associated Connection named SampleCRM with no spaces or special characters. On the Connection Configuration dialog set the Use Sample Data field to true to use the sample data distributed with the Connector. See the Sample CRM Connector notes.
    • Variables Connector and an associated Connection named Variables.
    • Tools Connector and an associated Connection named Tools.
    • HTTP Connector and an associated Connection named HTTP.
    • Mapper Connector and an associated Connection named Mapper.

    If Connection names do not match the names specified in the prerequisites, you will have to reassign the Connections in the Sample Flows after you import them.

    Sample CRM Connector 

    Note the following when using the Sample CRM Connector:

    • A sample database is installed in the agent folder when the Connector is installed.
    • If you have more than one Connect on-premise agent installed, there is a separate database for each agent. In this case, the database associated with the agent that runs an app using the Sample CRM Connection is the database that is updated. If you have multiple agents, you can expect the databases to be different over time.
    • If you are using a Connect cloud agent, there is a separate database for each app that uses the Connect cloud agent. In this case, you can expect the database for each app to be different over time.

    Creating Requests by HTTP Verb Flow

    This flow demonstrates the following:

    • Starting a flow with no source data for the Query Block.
    • Using Send Blocks to send HTTP requests.
    • Using Postman Echo to echo the entire HTTP request back to TIBCO Cloud? Integration - Connect.
    • Recording that echoed response in the Agent log.
    http_verbs.thumb.png.bd4d9b68c49dfbd5f23eea2499c3c25b.png
     

    Adding Request Details Flow

    This flow demonstrates the following: 

    • Adding query parameters by mapping the entire query in a formula field.
    • Adding query parameters by selecting QueryParameters on the Include tab of the Send Block and using an Add Block for each parameter or Key Value pair.
    • Adding headers by selecting Headers on the Include tab of the Send Block and using an Add Block for each header or Key Value pair.
    • Adding cookies by selecting Cookies on the Include tab of the Send Block and using an Add Block for each cookie or Key Value pair.
    • Using Postman Echo to echo each HTTP request back to TIBCO Cloud? Integration - Connect.
    • Recording each echoed response in the Agent log.

    http_req_details.thumb.png.af583b9e74c77ee8686180a964133da4.png

    Configuring Body with Content Type Flow

    This flow provides examples for specific types of content and demonstrates the following:

    • Using a string variable.
    • Sending the value of the variable as content type plain text.
    • Sending the value of the variable as content type XML.
    • Sending the value of the variable as content type JSON.
    • Using Postman Echo to echo each HTTP request back to TIBCO Cloud? Integration - Connect.
    • Recording each echoed response in the Agent log.

    Best practice is to keep mappings to the Content field very simple. Complex formulas may generate errors. You can use the Mapper and Variables Connectors to create the Content value you want to send.



    http_contentype.thumb.png.acb2eb6756b2713a7c210f799d9cc7e3.png
     

    Authenticating Requests Flow

    This flow demonstrates how to configure authorization and authentication for HTTP web service calls, as follows: 

    Warning: Information stored in variables, such as Username and Password, is stored in plain text making the variable values visible to other TIBCO Cloud? Integration - Connect users.

    • Using Basic Authentication.

      - Store Username and Password as variables.

      - Encode the Username and Password.

      - Use a Send Block with Headers selected on the Include tab.

      - Use an Add Block to send a header with a Key Value pair containing the authentication type and the encoded output.
       
    • Using Token Authentication.

      - Store ClientID and ClientSecret as variables.

      - Use a Send Block to send the authentication information.

      - Parse the token in the response to the Send Block. This step is not configured, but is represented by a Comment Block.

      - Store the token as a variable.

      - Use a Send Block with Headers selected on the Include tab.

      - Use an Add Block to send a header with a Key Value pair containing the token variable.
       
    • Using HMAC Signature.

      - Store Access Key, HMAC Key, date stamp, and a string value as variables.

      - Use an Execute Block to generate an HMAC256 Hash for a signature.

      - Use a Send Block with Headers selected on the Include tab.

      - Use an Add Block to send a header with a Key Value pair containing the authentication type and the encoded output.
       
    • Using Postman Echo to echo each HTTP request back to TIBCO Cloud? Integration - Connect.
    • Recording each echoed response in the Agent log.

    http_auth.png.0244adba559bd076f68d4f2e12592c26.png
     

    Response Status Codes Flow

    Some APIs may return more detailed status codes that can be used to modify flow behavior. For example, with an HTTP POST, a 201 code could indicate that the operation created a new record instead of updating an existing record. Review the documentation for the API you are accessing to determine if any of these codes would be useful to you. The Response Status Codes flow demonstrates the following:

    • Sending a request that returns a status code. In this example, the code returned is 201.
    • Using an If/Else block to decide what to do if the status code returned is a 201 and what to do if it is any other code.
    • Writing to the Agent log when a 201 status code is returned.

    http_stat_codes.png.a26dd2b838ace34df1baac94a2b47c12.png
     

    HTTP Messages Flow

    This flow demonstrates the following: 

    • Support for Message flows
    • Support for any string data, such as XML, JSON, or CSV.
    • Responses to requests return a GUID (RequestID) that can be used in the flow.

    http_event.png.76d7f75ae604b022f74b607e990b53af.png
     

    DISCLAIMER 

    Copyright © 2022, TIBCO Software Inc. All rights reserved.

    No Support. You acknowledge that TIBCO will not provide any maintenance or support for this software. You have no right to receive any upgrades, patches, enhancements, bug fixes, new versions or new releases of the software.

    Internal Use Only License Grant. TIBCO hereby grants you a limited, non?transferable, non?exclusive license to use the software solely for your internal business purposes. The name of TIBCO Software Inc. may not be used to endorse or promote products derived from this software without specific prior written permission of TIBCO Software Inc.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT OWNERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...