Chilkat Online Tools

Ruby / Orchestrator / Settings - Get all

Back to Collection Items

require 'chilkat'

# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.

http = Chilkat::CkHttp.new()

http.SetRequestHeader("Content-Type","application/json")
# Adds the "Authorization: Bearer <access_token>" header.
http.put_AuthToken("<access_token>")
http.SetRequestHeader("X-UIPATH-OrganizationUnitId","{{folderId}}")
http.SetRequestHeader("X-UIPATH-TenantName","{{tenantName}}")

sbResponseBody = Chilkat::CkStringBuilder.new()
success = http.QuickGetSb("https://domain.com/odata/Settings",sbResponseBody)
if (success == false)
    print http.lastErrorText() + "\n";
    exit
end

jResp = Chilkat::CkJsonObject.new()
jResp.LoadSb(sbResponseBody)
jResp.put_EmitCompact(false)

print "Response Body:" + "\n";
print jResp.emit() + "\n";

respStatusCode = http.get_LastStatus()
print "Response Status Code = " + respStatusCode.to_s() + "\n";
if (respStatusCode >= 400)
    print "Response Header:" + "\n";
    print http.lastHeader() + "\n";
    print "Failed." + "\n";
    exit
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

odata_context = jResp.stringOf("\"@odata.context\"")
odata_count = jResp.IntOf("\"@odata.count\"")
i = 0
count_i = jResp.SizeOfArray("value")
while i < count_i
    jResp.put_I(i)
    Name = jResp.stringOf("value[i].Name")
    Value = jResp.stringOf("value[i].Value")
    Scope = jResp.stringOf("value[i].Scope")
    Id = jResp.stringOf("value[i].Id")
    i = i + 1
end

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}"
    }
  ]
}