Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

객체 유형 조회(Get Object Type) (V2)

객체 유형의 API 이름으로 정의를 조회합니다. 기본 키와 제목 속성, 속성 자료형 및 상태를 확인하여 실제 객체 요청을 구성합니다.

API 이름의 대소문자는 그대로 사용합니다. 이 요청은 API 이름을 받으며 RID 조회는 일괄 조회에서 제공합니다. 기반 데이터소스가 필요하면 includeDatasources=true를 지정합니다.

HTTP 요청

GET /api/v2/ontologies/{ontology}/objectTypes/{objectType}

작업 식별자는 v2.getObjectTypeV2입니다. OAuth2로 호출하는 타사 애플리케이션에는 api:ontologies-read 권한 범위가 필요합니다. 각 요청에 Authorization: Bearer <접근 토큰>을 전달합니다.

경로 매개변수

이름자료형필수 여부의미와 조건예시 값
ontologystring필수온톨로지의 API 이름 또는 RID입니다. List Ontologies 또는 Ontology Manager에서 확인합니다.palantir
objectTypestring필수객체 유형의 API 이름입니다. List Object Types 또는 Ontology Manager에서 확인합니다.employee

쿼리 매개변수

이름자료형필수 여부의미와 조건예시 값
branchstring선택객체 유형 정의를 읽을 Foundry 브랜치입니다. 생략하면 기본 브랜치를 사용합니다. 브랜치는 실험적 기능이며 모든 작업 경로를 지원하지 않습니다.ri.branch..branch.d827184f-ee0e-4351-8b70-efbe51e07252
includeDatasourcesboolean선택true이면 객체 유형의 datasources에 기반 데이터소스를 채웁니다. 기본값은 false입니다.

요청 본문

요청 본문을 사용하지 않습니다.

응답

응답 형식은 ObjectTypeV2입니다.

성공 응답입니다.

전체 필드는 ObjectTypeV2 메타데이터를 따릅니다.

employee 객체 유형의 응답 예시입니다.

{
  "apiName": "employee",
  "description": "A full-time or part-time employee of our firm",
  "displayName": "Employee",
  "status": "ACTIVE",
  "primaryKey": "employeeId",
  "properties": {
    "employeeId": {
      "dataType": {
        "type": "integer"
      },
      "rid": "ri.ontology.main.property.571d3d4d-150a-4dd4-b1a7-d16c1ed7d996"
    },
    "fullName": {
      "dataType": {
        "type": "string"
      },
      "rid": "ri.ontology.main.property.5721baa7-26d5-4ca8-b092-d47dcc724ab1"
    },
    "office": {
      "description": "The unique ID of the employee's primary assigned office",
      "dataType": {
        "type": "string"
      },
      "rid": "ri.ontology.main.property.554fa8c4-3b6e-4d3f-adef-acc9f0f54633"
    },
    "startDate": {
      "description": "The date the employee was hired (most recently, if they were re-hired)",
      "dataType": {
        "type": "date"
      },
      "rid": "ri.ontology.main.property.3b081417-fe68-4010-ade8-68b298116ed4"
    }
  },
  "rid": "ri.ontology.main.object-type.0381eda6-69bb-4cb7-8ba0-c6158e094a04",
  "pluralDisplayName": "Employees",
  "icon": {
    "type": "blueprint",
    "name": "globe",
    "color": "#2D72D2"
  },
  "titleProperty": "fullName"
}

개별 오류

오류 응답 처리는 공통 API 오류 계약을 따릅니다.

요청 예제

FOUNDRY_HOST에는 https://를 제외한 Foundry 호스트를, FOUNDRY_TOKEN에는 유효한 토큰을 환경 변수로 제공합니다. 예시 식별자와 매개변수 값은 실제 작업 대상에 맞게 바꿉니다.

API 이름이 employee인 유형을 조회하는 예제입니다. 예시 Foundry 브랜치 RID는 실제 조회 맥락에 맞게 바꿉니다. 기본 브랜치를 사용하려면 branch 쿼리를 생략합니다. 브랜치는 실험적 기능입니다.

cURL

curl \
	-H "Authorization: Bearer ${FOUNDRY_TOKEN}" \
	"https://${FOUNDRY_HOST}/api/v2/ontologies/palantir/objectTypes/employee?branch=ri.branch..branch.d827184f-ee0e-4351-8b70-efbe51e07252"

Python

Requests 라이브러리가 설치된 Python 환경에서 사용합니다.

import os
import requests

HOSTNAME = os.environ["FOUNDRY_HOST"]
TOKEN = os.environ["FOUNDRY_TOKEN"]
headers = {
    "authorization": "Bearer {}".format(TOKEN)
}

response = requests.get('https://{}/api/v2/ontologies/palantir/objectTypes/employee?branch=ri.branch..branch.d827184f-ee0e-4351-8b70-efbe51e07252'.format(HOSTNAME), headers=headers)
print(response)

Java

Apache HttpClient 4.5 API와 try-with-resources를 사용합니다. 클래스 이름에 맞는 GetObjectTypeV2Example.java 파일에서 사용합니다.

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;

public class GetObjectTypeV2Example {
    public static void main(String[] args) throws Exception {
        String HOSTNAME = System.getenv("FOUNDRY_HOST");
        String TOKEN = System.getenv("FOUNDRY_TOKEN");

        try (CloseableHttpClient httpClient = HttpClientBuilder.create().build()) {
            HttpGet request = new HttpGet("https://" + HOSTNAME + "/api/v2/ontologies/palantir/objectTypes/employee?branch=ri.branch..branch.d827184f-ee0e-4351-8b70-efbe51e07252");
            request.addHeader("authorization", String.format("Bearer %s", TOKEN));
            try (CloseableHttpResponse response = httpClient.execute(request)) {
                System.out.println(response);
            }
        }
    }
}

JavaScript

fetch를 제공하는 Node.js 환경에서 사용합니다. 서비스 사용자 토큰을 브라우저로 전달하지 않습니다.

const HOSTNAME = process.env.FOUNDRY_HOST;
const TOKEN = process.env.FOUNDRY_TOKEN;

fetch(`https://${HOSTNAME}/api/v2/ontologies/palantir/objectTypes/employee?branch=ri.branch..branch.d827184f-ee0e-4351-8b70-efbe51e07252`, {
    method: 'GET',
    headers: {
        'Authorization': `Bearer ${TOKEN}`,
    }
}).then((response) => {
    console.log(response)
});

PowerShell

$ErrorActionPreference = 'Stop'
$TOKEN = $env:FOUNDRY_TOKEN
$HOSTNAME = $env:FOUNDRY_HOST

$headers = @{
    "authorization" = "Bearer $TOKEN"
}

$response = Invoke-WebRequest -Uri "https://$HOSTNAME/api/v2/ontologies/palantir/objectTypes/employee?branch=ri.branch..branch.d827184f-ee0e-4351-8b70-efbe51e07252" `
	-Headers $headers

$response.content