Calling One IAM REST API from VB.NET

Hi All,

I need some help from you.

I have below the PowerShell code and it is working fine.

We have a requirement to call this One IAM rest API from VB.Net  code and don't know how to pass all these parameters. Looked on google and tried but always failed.

Does anyone has called REST API from VB.NET code and if so could you please share sample code. Thank you in advance.

$authdata = @{AuthString="Module=DialogUser;User=***;Password=*****"}

$authJson = ConvertTo-Json $authdata -Depth 2

# Login (important, pass the NAME for your session variable in -SessionVariable)

Invoke-RestMethod -Uri "http://<Server>/AppServer/auth/apphost" -Body $authJson.ToString() -Method Post -UseDefaultCredentials -Headers @{Accept="application/json"} -SessionVariable wsession

# Sample 1: Load collection using Post method

$body = @{parameters = @("test1284@test.com","98456798","FirstName","LastName","Middle Name","Department name")} | ConvertTo-Json

Invoke-RestMethod -Uri "http://<Server>//AppServer/api/script/CCC_CreateDepartment_TPA" -WebSession $wsession -Method PUT -Body $body -ContentType application/json

Invoke-RestMethod -Uri "http://<Server>//AppServer/auth/logout" -WebSession $wsession -Method Post
Kind Regards,
Dnyandev