Asked by:
How to create connectiion manager to REST api

Question
-
Hi All,
I need to create a connection manager to access a REST api on a remote server. I have the static IP of the server. I am expecting I need to create a REST connection manager but when I attempt to do so I don't know which configuration to select if any.
Can someone kindly give a some guidance? A bit new at this so if I doing something fundamentally wrong please excuse,
Thanks tonnes, Roscoe
All replies
-
- Proposed as answer by Yang.Z Friday, November 16, 2018 6:01 AM
-
This is an example of how you can do it in SSIS. Would require some C# coding though
https://www.c-sharpcorner.com/article/how-to-consume-web-api-through-ssis-package/
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
----------------------------
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Hi,
You can create a HTTP client in c# and use script task something like below. Check the API documentation and check how you need to send the request i.e. GET, POST or other operations, do you need to pass informations via headers or query string etc.
static async Task Main()
{
HttpClient client = new HttpClient();
try
{
HttpResponseMessage response = await client.GetAsync("http://www.contoso.com/");
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch(HttpRequestException e)
{
Console.WriteLine(e.Message);
}
client.Dispose(true);
}Refer following link https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=netframework-4.7.2
Cheers,