Chilkat Online Tools

DataFlex / Orchestrator / Folders - Get all

Back to Collection Items

Use ChilkatAx-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vSbResponseBody
    Handle hoSbResponseBody
    String sTemp1
    Integer iTemp1

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

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    Send ComSetRequestHeader To hoHttp "Content-Type" "application/json"
    // Adds the "Authorization: Bearer <access_token>" header.
    Set ComAuthToken Of hoHttp To "<access_token>"
    Send ComSetRequestHeader To hoHttp "X-UIPATH-TenantName" "{{tenantName}}"

    Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
    If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
        Send CreateComObject of hoSbResponseBody
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComQuickGetSb Of hoHttp "https://domain.com/odata/Folders" vSbResponseBody To iSuccess
    If (iSuccess = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComLastStatus Of hoHttp To iTemp1
    Showln "Response status code = " iTemp1
    Get ComGetAsString Of hoSbResponseBody To sTemp1
    Showln sTemp1


End_Procedure

Curl Command

curl -X GET
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: application/json"
	-H "X-UIPATH-TenantName: {{tenantName}}"
https://domain.com/odata/Folders

Postman Collection Item JSON

{
  "name": "Folders - Get all",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Content-Type",
        "name": "Content-Type",
        "type": "text",
        "value": "application/json"
      },
      {
        "key": "X-UIPATH-TenantName",
        "value": "{{tenantName}}",
        "type": "text"
      }
    ],
    "url": {
      "raw": "{{url}}/odata/Folders",
      "host": [
        "{{url}}"
      ],
      "path": [
        "odata",
        "Folders"
      ]
    },
    "description": "Experimental Feature: Retrieves all Organization Units."
  },
  "response": [
    {
      "name": "Organization Units - Get all",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "key": "Content-Type",
            "name": "Content-Type",
            "type": "text",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{url}}/odata/OrganizationUnits",
          "host": [
            "{{url}}"
          ],
          "path": [
            "odata",
            "OrganizationUnits"
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "html",
      "header": [
        {
          "key": "Date",
          "value": "Wed, 27 Feb 2019 13:49:44 GMT"
        },
        {
          "key": "Content-Type",
          "value": "text/html; charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "1028"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "Cache-Control",
          "value": "no-cache, no-store, must-revalidate"
        },
        {
          "key": "Pragma",
          "value": "no-cache"
        },
        {
          "key": "Content-Encoding",
          "value": "gzip"
        },
        {
          "key": "Expires",
          "value": "-1"
        },
        {
          "key": "Vary",
          "value": "Accept-Encoding"
        },
        {
          "key": "Set-Cookie",
          "value": "XSRF-TOKEN=eJhbVvmvo60rErmC3ydbu-EewNysAnyf6tCKVomQvy2n_wBJwC_MQ081rGozSsQ0cryKgfkNmzTmo373xIZ0cwh9Z_rgUXedq8C0YcSTa5PVnatXsl0ELqFvp0aXZG96RXPx9CLeUj_hnbXAZbWC4w2; path=/; secure; SameSite=lax"
        },
        {
          "key": "X-Robots-Tag",
          "value": "noindex, nofollow"
        },
        {
          "key": "X-Download-Options",
          "value": "noopen"
        },
        {
          "key": "X-XSS-Protection",
          "value": "1; mode=block"
        },
        {
          "key": "Content-Security-Policy",
          "value": "default-src 'self';script-src 'self' cdn.mxpnl.com;style-src 'self' 'unsafe-inline';img-src 'self' data:;connect-src 'self' ws: wss: api.mixpanel.com https: sentry.io"
        },
        {
          "key": "Request-Context",
          "value": "appId=cid-v1:d00ce63d-0891-41e4-a17c-25b2c5382e49"
        },
        {
          "key": "Access-Control-Expose-Headers",
          "value": "Request-Context"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        },
        {
          "key": "X-Frame-Options",
          "value": "DENY"
        },
        {
          "key": "Strict-Transport-Security",
          "value": "max-age=31536000; includeSubDomains"
        },
        {
          "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": "4afb1dd2abf16439-FRA"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"@odata.context\": \"https://beta.uipath.com/odata/$metadata#OrganizationUnits\",\n    \"@odata.count\": 2,\n    \"value\": [\n        {\n            \"DisplayName\": \"Default\",\n            \"Id\": 715\n        },\n        {\n            \"DisplayName\": \"a\",\n            \"Id\": 846\n        }\n    ]\n}"
    }
  ]
}