[Extensions] How to connect a PostgreSQL database in Blip Smart Contacts April 12, 2024 15:08 Updated Introduction Features Installation and configuration User manual Dependencies Support The PostgreSQL for Blip extension is here to make developers' lives easier. Connect Blip directly to your PostgreSQL database without the need for intermediary APIs. With PostgreSQL for Blip, enter your connection credentials and execute database queries and operations directly in Builder or Studio. Keywords: PostgreSQL, database, Integration, Connection, Queries, SQL, API, router, Blip extension, efficiency. IntroductionPostgreSQL for Blip, developed by Sharkdev, is an extension that allows you to connect Blip directly to your PostgreSQL database using connection data, eliminating the need to build and maintain an intermediary API.As a practical example of its use, you can use the extension directly in Builder or Studio to query the status of an order in your company's database and display this information to the customer in real time during the conversational flow. FeaturesThe PostgreSQL for Blip extension was developed to allow developers to access databases directly through Builder or Studio, without the need for an intermediary API.The following features are offered: Database connection; Execution of SQL statements on the database through HTTP requests; Viewing SQL statements executed on the database within the last 30 days; Installation and configurationTo use the PostgreSQL for Blip extension, you need to access the contract where you want to install it, and then access the Router bot. Once this is done, go to the extensions section, which will open the Blip Store, and search for “PostgreSQL for Blip”. Once you find it, you will need to activate and install it.After it has been activated and installed, and the terms have been accepted, a small configuration is required before you can start using it. Follow the step-by-step instructions below.Step 1) Connecting to the databaseOn the extension's main page, enter name, host, port, user, password and SSL in the connection form and click "Connect". If the connection is successful, you will quickly see the message "Database connected". If it is not successful, we suggest reviewing the connection information entered in the form.Step 2) Defining a token in the bots' configuration variablesFor your bot to use the extension, the authorization token must be provided at the time of the request.Therefore, we suggest that * This step is not mandatory, but it is a suggestion aimed at maintaining the Smart Contact. Step 3) Now you can use it!At this stage, the extension is configured and you can now use it. To do so, learn about the concept of commands in the “User manual”. User manualSQL statementsFollow the instructions below to communicate with the extension through Builder or Studio:Basic informationBase URL: https://postgresqlforblip.blip.sharkdev.com.br/queryAuthorization token: {{config.token}} or Authentication header (Authorization)How to execute a commandTo execute a command, configure an HTTP Request using the POST method for the URL provided in the Base URL, entering the Authorization token in the "Authorization" key of the Header. To make this easier, see the image below:Now, you need to define the request Body. To do this, the JSON sent must contain the attributes below: DependenciesFor this extension to work correctly, you need to purchase it through the Blip Store by accessing Blip through a paid account. In addition, you need to use your own database. SupportIf you have any questions or encounter any issues with the extension, contact us by email at suporter@sharkdev.com.br or by phone at +55 (35) 99148-3887. Need more help? Explore our content on Blip Academy or Blip Community, watch tutorials on our YouTube channel or get your questions answered through our support channel 😃 Related articles [Extension] How to connect the MySQL database in Blip Smart Contacts Dashboard - Date Filter & Comparison Indicator Hubspot Extension (Lanum) Dashboard - Data Analysis How to Use Blip Store and Manage Extensions in Blip