SQL Server / Orchestrator / Settings - Get all
Back to Collection Items
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
DECLARE @hr int
-- Important: Do not use nvarchar(max). See the warning about using nvarchar(max).
DECLARE @sTmp0 nvarchar(4000)
-- This example assumes the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
DECLARE @http int
-- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
IF @hr <> 0
BEGIN
PRINT 'Failed to create ActiveX component'
RETURN
END
DECLARE @success int
EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Content-Type', 'application/json'
-- Adds the "Authorization: Bearer <access_token>" header.
EXEC sp_OASetProperty @http, 'AuthToken', '<access_token>'
EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'X-UIPATH-OrganizationUnitId', '{{folderId}}'
EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'X-UIPATH-TenantName', '{{tenantName}}'
DECLARE @sbResponseBody int
-- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT
EXEC sp_OAMethod @http, 'QuickGetSb', @success OUT, 'https://domain.com/odata/Settings', @sbResponseBody
IF @success = 0
BEGIN
EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @sbResponseBody
RETURN
END
DECLARE @jResp int
-- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jResp OUT
EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody
EXEC sp_OASetProperty @jResp, 'EmitCompact', 0
PRINT 'Response Body:'
EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT
PRINT @sTmp0
DECLARE @respStatusCode int
EXEC sp_OAGetProperty @http, 'LastStatus', @respStatusCode OUT
PRINT 'Response Status Code = ' + @respStatusCode
IF @respStatusCode >= 400
BEGIN
PRINT 'Response Header:'
EXEC sp_OAGetProperty @http, 'LastHeader', @sTmp0 OUT
PRINT @sTmp0
PRINT 'Failed.'
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @sbResponseBody
EXEC @hr = sp_OADestroy @jResp
RETURN
END
-- Sample JSON response:
-- (Sample code for parsing the JSON response is shown below)
-- {
-- "@odata.context": "https://platform.uipath.com/AccountName/TenantName/odata/$metadata#Settings",
-- "@odata.count": 37,
-- "value": [
-- {
-- "Name": "Abp.Localization.DefaultLanguageName",
-- "Value": "en",
-- "Scope": null,
-- "Id": "Abp.Localization.DefaultLanguageName"
-- },
-- {
-- "Name": "Abp.Net.Mail.Smtp.Host",
-- "Value": "smtp.sendgrid.net",
-- "Scope": null,
-- "Id": "Abp.Net.Mail.Smtp.Host"
-- },
-- {
-- "Name": "Abp.Net.Mail.Smtp.Port",
-- "Value": "587",
-- "Scope": null,
-- "Id": "Abp.Net.Mail.Smtp.Port"
-- },
-- {
-- "Name": "Abp.Net.Mail.Smtp.UserName",
-- "Value": "apikey",
-- "Scope": null,
-- "Id": "Abp.Net.Mail.Smtp.UserName"
-- },
-- {
-- "Name": "Abp.Net.Mail.Smtp.Password",
-- "Value": "••••••••••••",
-- "Scope": null,
-- "Id": "Abp.Net.Mail.Smtp.Password"
-- },
-- {
-- "Name": "Abp.Net.Mail.Smtp.Domain",
-- "Value": "",
-- "Scope": null,
-- "Id": "Abp.Net.Mail.Smtp.Domain"
-- },
-- {
-- "Name": "Abp.Net.Mail.Smtp.EnableSsl",
-- "Value": "true",
-- "Scope": null,
-- "Id": "Abp.Net.Mail.Smtp.EnableSsl"
-- },
-- {
-- "Name": "Abp.Net.Mail.Smtp.UseDefaultCredentials",
-- "Value": "false",
-- "Scope": null,
-- "Id": "Abp.Net.Mail.Smtp.UseDefaultCredentials"
-- },
-- {
-- "Name": "Abp.Net.Mail.DefaultFromAddress",
-- "Value": "noreply-platform@uipath.com",
-- "Scope": null,
-- "Id": "Abp.Net.Mail.DefaultFromAddress"
-- },
-- {
-- "Name": "Abp.Net.Mail.DefaultFromDisplayName",
-- "Value": "UiPath Platform",
-- "Scope": null,
-- "Id": "Abp.Net.Mail.DefaultFromDisplayName"
-- },
-- {
-- "Name": "Abp.Timing.TimeZone",
-- "Value": "UTC",
-- "Scope": null,
-- "Id": "Abp.Timing.TimeZone"
-- },
-- {
-- "Name": "InternalDeployment",
-- "Value": "true",
-- "Scope": null,
-- "Id": "InternalDeployment"
-- },
-- {
-- "Name": "DeploymentUrl",
-- "Value": "",
-- "Scope": null,
-- "Id": "DeploymentUrl"
-- },
-- {
-- "Name": "NuGet.Packages.ApiKey",
-- "Value": "eb6h29310-5ie0-4724-a54f-v8f4js9km3",
-- "Scope": null,
-- "Id": "NuGet.Packages.ApiKey"
-- },
-- {
-- "Name": "Deployment.Processes.AuthenticationType",
-- "Value": "ApiKey",
-- "Scope": null,
-- "Id": "Deployment.Processes.AuthenticationType"
-- },
-- {
-- "Name": "DeploymentBasicUsername",
-- "Value": "",
-- "Scope": null,
-- "Id": "DeploymentBasicUsername"
-- },
-- {
-- "Name": "DeploymentBasicPassword",
-- "Value": "",
-- "Scope": null,
-- "Id": "DeploymentBasicPassword"
-- },
-- {
-- "Name": "Deployment.Libraries.Url",
-- "Value": "",
-- "Scope": null,
-- "Id": "Deployment.Libraries.Url"
-- },
-- {
-- "Name": "Deployment.Libraries.Internal",
-- "Value": "true",
-- "Scope": null,
-- "Id": "Deployment.Libraries.Internal"
-- },
-- {
-- "Name": "Deployment.Libraries.AuthenticationType",
-- "Value": "apiKey",
-- "Scope": null,
-- "Id": "Deployment.Libraries.AuthenticationType"
-- },
-- {
-- "Name": "NuGet.Activities.ApiKey",
-- "Value": "019d78dh-89d0-42f7-8b50-88f6eh3k87",
-- "Scope": null,
-- "Id": "NuGet.Activities.ApiKey"
-- },
-- {
-- "Name": "Deployment.Libraries.UseSharedFeed",
-- "Value": "true",
-- "Scope": null,
-- "Id": "Deployment.Libraries.UseSharedFeed"
-- },
-- {
-- "Name": "Deployment.Libraries.BasicUsername",
-- "Value": "",
-- "Scope": null,
-- "Id": "Deployment.Libraries.BasicUsername"
-- },
-- {
-- "Name": "Deployment.Libraries.BasicPassword",
-- "Value": "",
-- "Scope": null,
-- "Id": "Deployment.Libraries.BasicPassword"
-- },
-- {
-- "Name": "PasswordComplexity",
-- "Value": "{\"HasDigit\":true,\"HasLowercase\":true,\"HasSpecialCharacter\":false,\"HasUppercase\":false,\"Length\":6,\"RegexComplexity\":{\"HasDigitRegex\":\"(?=.*\\\\d)\",\"HasLowercaseRegex\":\"(?=.*[a-z])\",\"HasSpecialCharacterRegex\":\"(?=.*[^a-zA-Z\\\\d])\",\"HasUppercaseRegex\":\"(?=.*[A-Z])\",\"LengthRegex\":\"{6,}\",\"Regex\":\"(?=.*\\\\d)(?=.*[a-z]).{6,}\"}}",
-- "Scope": null,
-- "Id": "PasswordComplexity"
-- },
-- {
-- "Name": "Alerts.Email.Enabled",
-- "Value": "true",
-- "Scope": null,
-- "Id": "Alerts.Email.Enabled"
-- },
-- {
-- "Name": "Auth.UserLockOut.IsEnabled",
-- "Value": "true",
-- "Scope": null,
-- "Id": "Auth.UserLockOut.IsEnabled"
-- },
-- {
-- "Name": "Auth.UserLockOut.MaxFailedAccessAttemptsBeforeLockout",
-- "Value": "10",
-- "Scope": null,
-- "Id": "Auth.UserLockOut.MaxFailedAccessAttemptsBeforeLockout"
-- },
-- {
-- "Name": "Auth.UserLockOut.DefaultAccountLockoutSeconds",
-- "Value": "300",
-- "Scope": null,
-- "Id": "Auth.UserLockOut.DefaultAccountLockoutSeconds"
-- },
-- {
-- "Name": "Auth.Password.DefaultExpirationDays",
-- "Value": "0",
-- "Scope": null,
-- "Id": "Auth.Password.DefaultExpirationDays"
-- },
-- {
-- "Name": "Auth.Password.PreviousUseLimit",
-- "Value": "1",
-- "Scope": null,
-- "Id": "Auth.Password.PreviousUseLimit"
-- },
-- {
-- "Name": "Auth.Password.ShouldChangePasswordAfterFirstLogin",
-- "Value": "true",
-- "Scope": null,
-- "Id": "Auth.Password.ShouldChangePasswordAfterFirstLogin"
-- },
-- {
-- "Name": "GlobalExecutionSettings",
-- "Value": "{}",
-- "Scope": null,
-- "Id": "GlobalExecutionSettings"
-- },
-- {
-- "Name": "AttendedRobot.RunDisconnectedHours",
-- "Value": "0",
-- "Scope": null,
-- "Id": "AttendedRobot.RunDisconnectedHours"
-- },
-- {
-- "Name": "Scalability.SignalR.Enabled",
-- "Value": "true",
-- "Scope": null,
-- "Id": "Scalability.SignalR.Enabled"
-- },
-- {
-- "Name": "Scalability.SignalR.Transport",
-- "Value": "7",
-- "Scope": null,
-- "Id": "Scalability.SignalR.Transport"
-- },
-- {
-- "Name": "Features.ModernFolders.Enabled",
-- "Value": "true",
-- "Scope": null,
-- "Id": "Features.ModernFolders.Enabled"
-- }
-- ]
-- }
-- Sample code for parsing the JSON response...
-- Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
DECLARE @Name nvarchar(4000)
DECLARE @Value nvarchar(4000)
DECLARE @Scope nvarchar(4000)
DECLARE @Id nvarchar(4000)
DECLARE @odata_context nvarchar(4000)
EXEC sp_OAMethod @jResp, 'StringOf', @odata_context OUT, '"@odata.context"'
DECLARE @odata_count int
EXEC sp_OAMethod @jResp, 'IntOf', @odata_count OUT, '"@odata.count"'
DECLARE @i int
SELECT @i = 0
DECLARE @count_i int
EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'value'
WHILE @i < @count_i
BEGIN
EXEC sp_OASetProperty @jResp, 'I', @i
EXEC sp_OAMethod @jResp, 'StringOf', @Name OUT, 'value[i].Name'
EXEC sp_OAMethod @jResp, 'StringOf', @Value OUT, 'value[i].Value'
EXEC sp_OAMethod @jResp, 'StringOf', @Scope OUT, 'value[i].Scope'
EXEC sp_OAMethod @jResp, 'StringOf', @Id OUT, 'value[i].Id'
SELECT @i = @i + 1
END
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @sbResponseBody
EXEC @hr = sp_OADestroy @jResp
END
GO
Curl Command
curl -X GET
-H "Authorization: Bearer <access_token>"
-H "Content-Type: application/json"
-H "X-UIPATH-TenantName: {{tenantName}}"
-H "X-UIPATH-OrganizationUnitId: {{folderId}}"
https://domain.com/odata/Settings
Postman Collection Item JSON
{
"name": "Settings - Get all",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"type": "text",
"value": "application/json"
},
{
"key": "X-UIPATH-TenantName",
"type": "text",
"value": "{{tenantName}}"
},
{
"key": "X-UIPATH-OrganizationUnitId",
"type": "text",
"value": "{{folderId}}"
}
],
"url": {
"raw": "{{url}}/odata/Settings",
"host": [
"{{url}}"
],
"path": [
"odata",
"Settings"
]
},
"description": "A template for future calls. You can ignore this one."
},
"response": [
{
"name": "Settings - Get all",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"type": "text",
"value": "application/json"
},
{
"key": "X-UIPATH-TenantName",
"type": "text",
"value": "{{tenantName}}"
},
{
"key": "X-UIPATH-OrganizationUnitId",
"type": "text",
"value": "{{folderId}}"
}
],
"url": {
"raw": "{{url}}/odata/Settings",
"host": [
"{{url}}"
],
"path": [
"odata",
"Settings"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Date",
"value": "Tue, 21 Jan 2020 13:58:47 GMT"
},
{
"key": "Content-Type",
"value": "application/json; odata.metadata=minimal"
},
{
"key": "Transfer-Encoding",
"value": "chunked"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Cache-Control",
"value": "no-store, must-revalidate, no-cache, max-age=0"
},
{
"key": "Content-Encoding",
"value": "gzip"
},
{
"key": "Vary",
"value": "Accept-Encoding"
},
{
"key": "api-supported-versions",
"value": "9.0"
},
{
"key": "OData-Version",
"value": "4.0"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-Frame-Options",
"value": "DENY"
},
{
"key": "Strict-Transport-Security",
"value": "max-age=31536000; includeSubDomains"
},
{
"key": "CF-Cache-Status",
"value": "DYNAMIC"
},
{
"key": "Expect-CT",
"value": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""
},
{
"key": "Server",
"value": "cloudflare"
},
{
"key": "CF-RAY",
"value": "5589cdca2ba5ccc6-EWR"
}
],
"cookie": [
],
"body": "{\n \"@odata.context\": \"https://platform.uipath.com/AccountName/TenantName/odata/$metadata#Settings\",\n \"@odata.count\": 37,\n \"value\": [\n {\n \"Name\": \"Abp.Localization.DefaultLanguageName\",\n \"Value\": \"en\",\n \"Scope\": null,\n \"Id\": \"Abp.Localization.DefaultLanguageName\"\n },\n {\n \"Name\": \"Abp.Net.Mail.Smtp.Host\",\n \"Value\": \"smtp.sendgrid.net\",\n \"Scope\": null,\n \"Id\": \"Abp.Net.Mail.Smtp.Host\"\n },\n {\n \"Name\": \"Abp.Net.Mail.Smtp.Port\",\n \"Value\": \"587\",\n \"Scope\": null,\n \"Id\": \"Abp.Net.Mail.Smtp.Port\"\n },\n {\n \"Name\": \"Abp.Net.Mail.Smtp.UserName\",\n \"Value\": \"apikey\",\n \"Scope\": null,\n \"Id\": \"Abp.Net.Mail.Smtp.UserName\"\n },\n {\n \"Name\": \"Abp.Net.Mail.Smtp.Password\",\n \"Value\": \"••••••••••••\",\n \"Scope\": null,\n \"Id\": \"Abp.Net.Mail.Smtp.Password\"\n },\n {\n \"Name\": \"Abp.Net.Mail.Smtp.Domain\",\n \"Value\": \"\",\n \"Scope\": null,\n \"Id\": \"Abp.Net.Mail.Smtp.Domain\"\n },\n {\n \"Name\": \"Abp.Net.Mail.Smtp.EnableSsl\",\n \"Value\": \"true\",\n \"Scope\": null,\n \"Id\": \"Abp.Net.Mail.Smtp.EnableSsl\"\n },\n {\n \"Name\": \"Abp.Net.Mail.Smtp.UseDefaultCredentials\",\n \"Value\": \"false\",\n \"Scope\": null,\n \"Id\": \"Abp.Net.Mail.Smtp.UseDefaultCredentials\"\n },\n {\n \"Name\": \"Abp.Net.Mail.DefaultFromAddress\",\n \"Value\": \"noreply-platform@uipath.com\",\n \"Scope\": null,\n \"Id\": \"Abp.Net.Mail.DefaultFromAddress\"\n },\n {\n \"Name\": \"Abp.Net.Mail.DefaultFromDisplayName\",\n \"Value\": \"UiPath Platform\",\n \"Scope\": null,\n \"Id\": \"Abp.Net.Mail.DefaultFromDisplayName\"\n },\n {\n \"Name\": \"Abp.Timing.TimeZone\",\n \"Value\": \"UTC\",\n \"Scope\": null,\n \"Id\": \"Abp.Timing.TimeZone\"\n },\n {\n \"Name\": \"InternalDeployment\",\n \"Value\": \"true\",\n \"Scope\": null,\n \"Id\": \"InternalDeployment\"\n },\n {\n \"Name\": \"DeploymentUrl\",\n \"Value\": \"\",\n \"Scope\": null,\n \"Id\": \"DeploymentUrl\"\n },\n {\n \"Name\": \"NuGet.Packages.ApiKey\",\n \"Value\": \"eb6h29310-5ie0-4724-a54f-v8f4js9km3\",\n \"Scope\": null,\n \"Id\": \"NuGet.Packages.ApiKey\"\n },\n {\n \"Name\": \"Deployment.Processes.AuthenticationType\",\n \"Value\": \"ApiKey\",\n \"Scope\": null,\n \"Id\": \"Deployment.Processes.AuthenticationType\"\n },\n {\n \"Name\": \"DeploymentBasicUsername\",\n \"Value\": \"\",\n \"Scope\": null,\n \"Id\": \"DeploymentBasicUsername\"\n },\n {\n \"Name\": \"DeploymentBasicPassword\",\n \"Value\": \"\",\n \"Scope\": null,\n \"Id\": \"DeploymentBasicPassword\"\n },\n {\n \"Name\": \"Deployment.Libraries.Url\",\n \"Value\": \"\",\n \"Scope\": null,\n \"Id\": \"Deployment.Libraries.Url\"\n },\n {\n \"Name\": \"Deployment.Libraries.Internal\",\n \"Value\": \"true\",\n \"Scope\": null,\n \"Id\": \"Deployment.Libraries.Internal\"\n },\n {\n \"Name\": \"Deployment.Libraries.AuthenticationType\",\n \"Value\": \"apiKey\",\n \"Scope\": null,\n \"Id\": \"Deployment.Libraries.AuthenticationType\"\n },\n {\n \"Name\": \"NuGet.Activities.ApiKey\",\n \"Value\": \"019d78dh-89d0-42f7-8b50-88f6eh3k87\",\n \"Scope\": null,\n \"Id\": \"NuGet.Activities.ApiKey\"\n },\n {\n \"Name\": \"Deployment.Libraries.UseSharedFeed\",\n \"Value\": \"true\",\n \"Scope\": null,\n \"Id\": \"Deployment.Libraries.UseSharedFeed\"\n },\n {\n \"Name\": \"Deployment.Libraries.BasicUsername\",\n \"Value\": \"\",\n \"Scope\": null,\n \"Id\": \"Deployment.Libraries.BasicUsername\"\n },\n {\n \"Name\": \"Deployment.Libraries.BasicPassword\",\n \"Value\": \"\",\n \"Scope\": null,\n \"Id\": \"Deployment.Libraries.BasicPassword\"\n },\n {\n \"Name\": \"PasswordComplexity\",\n \"Value\": \"{\\\"HasDigit\\\":true,\\\"HasLowercase\\\":true,\\\"HasSpecialCharacter\\\":false,\\\"HasUppercase\\\":false,\\\"Length\\\":6,\\\"RegexComplexity\\\":{\\\"HasDigitRegex\\\":\\\"(?=.*\\\\\\\\d)\\\",\\\"HasLowercaseRegex\\\":\\\"(?=.*[a-z])\\\",\\\"HasSpecialCharacterRegex\\\":\\\"(?=.*[^a-zA-Z\\\\\\\\d])\\\",\\\"HasUppercaseRegex\\\":\\\"(?=.*[A-Z])\\\",\\\"LengthRegex\\\":\\\"{6,}\\\",\\\"Regex\\\":\\\"(?=.*\\\\\\\\d)(?=.*[a-z]).{6,}\\\"}}\",\n \"Scope\": null,\n \"Id\": \"PasswordComplexity\"\n },\n {\n \"Name\": \"Alerts.Email.Enabled\",\n \"Value\": \"true\",\n \"Scope\": null,\n \"Id\": \"Alerts.Email.Enabled\"\n },\n {\n \"Name\": \"Auth.UserLockOut.IsEnabled\",\n \"Value\": \"true\",\n \"Scope\": null,\n \"Id\": \"Auth.UserLockOut.IsEnabled\"\n },\n {\n \"Name\": \"Auth.UserLockOut.MaxFailedAccessAttemptsBeforeLockout\",\n \"Value\": \"10\",\n \"Scope\": null,\n \"Id\": \"Auth.UserLockOut.MaxFailedAccessAttemptsBeforeLockout\"\n },\n {\n \"Name\": \"Auth.UserLockOut.DefaultAccountLockoutSeconds\",\n \"Value\": \"300\",\n \"Scope\": null,\n \"Id\": \"Auth.UserLockOut.DefaultAccountLockoutSeconds\"\n },\n {\n \"Name\": \"Auth.Password.DefaultExpirationDays\",\n \"Value\": \"0\",\n \"Scope\": null,\n \"Id\": \"Auth.Password.DefaultExpirationDays\"\n },\n {\n \"Name\": \"Auth.Password.PreviousUseLimit\",\n \"Value\": \"1\",\n \"Scope\": null,\n \"Id\": \"Auth.Password.PreviousUseLimit\"\n },\n {\n \"Name\": \"Auth.Password.ShouldChangePasswordAfterFirstLogin\",\n \"Value\": \"true\",\n \"Scope\": null,\n \"Id\": \"Auth.Password.ShouldChangePasswordAfterFirstLogin\"\n },\n {\n \"Name\": \"GlobalExecutionSettings\",\n \"Value\": \"{}\",\n \"Scope\": null,\n \"Id\": \"GlobalExecutionSettings\"\n },\n {\n \"Name\": \"AttendedRobot.RunDisconnectedHours\",\n \"Value\": \"0\",\n \"Scope\": null,\n \"Id\": \"AttendedRobot.RunDisconnectedHours\"\n },\n {\n \"Name\": \"Scalability.SignalR.Enabled\",\n \"Value\": \"true\",\n \"Scope\": null,\n \"Id\": \"Scalability.SignalR.Enabled\"\n },\n {\n \"Name\": \"Scalability.SignalR.Transport\",\n \"Value\": \"7\",\n \"Scope\": null,\n \"Id\": \"Scalability.SignalR.Transport\"\n },\n {\n \"Name\": \"Features.ModernFolders.Enabled\",\n \"Value\": \"true\",\n \"Scope\": null,\n \"Id\": \"Features.ModernFolders.Enabled\"\n }\n ]\n}"
}
]
}