From the course: REST APIs, Vectors, and AI in SQL Server 2025
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Secure API Consumption via T-SQL in SQL Server 2025 - SQL Server Tutorial
From the course: REST APIs, Vectors, and AI in SQL Server 2025
Secure API Consumption via T-SQL in SQL Server 2025
- [Instructor] To access REST API through T-SQL, you simply call a start procedure called sp_invoke_external_rest_endpoint. It has a couple of parameters, some of which are optional and some of which are required. You'll pretty much always have a URL in the response. If your URL is the endpoint you're talking to, and the response will store the endpoints answer. In most cases, you will define the HTTP methods as a get, a post, a put, patch, delete, or head request. In many cases, you will also provide a payload or headers to provide additional queries on your context or request, as well as a credential for secured authentication and potentially a timeout if the endpoint is running longer procedures for you. To make sure such requests happen in a secure manner, SQL Server only accepts REST APIs that can be accessed through a secure, trusted HT DPS endpoint. While you could send them in plain text, credentials should be…