Chilkat Online Tools

PureBasic / Cognite API v1 / List available outputs

Back to Collection Items

IncludeFile "CkStringBuilder.pb"
IncludeFile "CkHttp.pb"

Procedure ChilkatExample()

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

    http.i = CkHttp::ckCreate()
    If http.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    success.i

    CkHttp::ckSetRequestHeader(http,"api-key","{{api-key}}")

    sbResponseBody.i = CkStringBuilder::ckCreate()
    If sbResponseBody.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    success = CkHttp::ckQuickGetSb(http,"https://domain.com/api/v1/projects/{{project}}/3d/models/:modelId/revisions/:revisionId/outputs",sbResponseBody)
    If success = 0
        Debug CkHttp::ckLastErrorText(http)
        CkHttp::ckDispose(http)
        CkStringBuilder::ckDispose(sbResponseBody)
        ProcedureReturn
    EndIf

    Debug "Response status code = " + Str(CkHttp::ckLastStatus(http))
    Debug CkStringBuilder::ckGetAsString(sbResponseBody)


    CkHttp::ckDispose(http)
    CkStringBuilder::ckDispose(sbResponseBody)


    ProcedureReturn
EndProcedure

Curl Command

curl -X GET
	-H "api-key: {{api-key}}"
https://domain.com/api/v1/projects/{{project}}/3d/models/:modelId/revisions/:revisionId/outputs?

Postman Collection Item JSON

{
  "id": "list3dModelOutputs",
  "name": "List available outputs",
  "request": {
    "url": {
      "host": "{{baseUrl}}",
      "path": [
        "api",
        "v1",
        "projects",
        "{{project}}",
        "3d",
        "models",
        ":modelId",
        "revisions",
        ":revisionId",
        "outputs"
      ],
      "query": [
        {
          "key": "format",
          "description": "Format identifier, e.g. 'ept-pointcloud' (point cloud). Well known formats are: \n'ept-pointcloud' (point cloud data), 'reveal-directory' (output supported by Reveal), \n'nodes-json' (a JSON dump of all nodes in the file) and 'preview-glb' (a GLTF preview\nof the 3D model). In addition, 'all-outputs' can be provided to return all outputs. Note\nthat many of the outputs are internal, where the format might change without any warning.\n",
          "disabled": true
        }
      ],
      "variable": [
        {
          "key": "modelId",
          "description": "Model ID.",
          "disabled": true,
          "type": "number"
        },
        {
          "key": "revisionId",
          "description": "Revision ID.",
          "disabled": true,
          "type": "number"
        }
      ]
    },
    "method": "GET",
    "header": [
      {
        "key": "api-key",
        "value": "{{api-key}}",
        "description": "An admin can create API keys in the Cognite console."
      }
    ],
    "description": "Retrieve a list of available outputs for a processed 3D model. An output can be a format that can be consumed by a viewer (e.g. Reveal) or import in external tools. Each of the outputs will have an associated version which is used to identify the version of output format (not the revision of the processed output). Note that the structure of the outputs will vary and is not covered here."
  }
}