跳转至

通过 API 访问端点功能

通过 API 访问端点功能

简介

CCH Tagetik 还允许通过 API(RESTful API)管理端点。

使用此查询模式需要满足某些条件。

访问条件

要使用这些特定的 API,用户必须经过身份验证(Basic Auth、OAuth2)。

还必须在存储库中启用 API。对于反向代理,还需要进行其他设置。它们可用于 httphttps 两种协议。

有关身份验证和启用的更多详细信息,请参阅 REST API Overview。

用于读取默认端点的 API

方法

GET

URL

http://server:port/tagetikcpm/api/admintools/endpoint/v1/default

用于读取所有端点的 API

方法

GET

URL

http://server:port/tagetikcpm/api/admintools/import/v1/elements

用于按代码筛选读取所有端点的 API

方法

GET

URL

http://server:port/tagetikcpm/api/admintools/import/v1/elements?filter=code_filter

用于读取单个端点的 API

方法

GET

URL

http://server:port/tagetikcpm/api/admintools/import/v1/elements/endpoint_code

用于创建新端点的 API

方法

POST

URL

http://server:port/tagetikcpm/api/admintools/import/v1/elements

属性

在请求正文中,可以包含以下 JSON 格式的属性:

属性 描述 选项
code 必填。 -
description 必填。 -
endpointType 必填。 可以取以下值: - U:URL - A:Tagetik Data Loader - P:Application - O:OData V4 - 2:OData V2 - R:REST API - S:SharePoint - B:Google Big Query - F:Snowflake

endpointType 属性

此外,根据端点类型的不同,可以添加以下属性:

URL:属性 描述 选项
url 必填。 -
defaultEndpoint - true/false(默认值 = false)
authenticationType - 可以取以下值: - N:None(默认值) - B:Basic
basicUsername 如果 authenticationType = B,则为必填。 -
basicPassword 如果 authenticationType = B,则定义。 -
pgpEnabled - true/false(默认值 = false)
pgpPublicKey 如果 pgpEnabled = true,则为必填 -
pgpPrivateKey 如果 pgpEnabled = true,则为必填 -
pgpPassphrase 如果 pgpEnabled = true,则为必填 -
Agent:属性 描述 选项
tdlAgentId 必填。 -
tdlSourceType 必填。 可以取以下值: - P:Path - D:Datasource
tdlPath 如果 tdlSourceType = P,则为必填 -
tdlDatasource 如果 tdlSourceType = D,则为必填 -
pgpEnabled - true/false(默认值 = false)
pgpPublicKey 如果 pgpEnabled = true,则为必填 -
pgpPrivateKey 如果 pgpEnabled = true,则为必填 -
pgpPassphrase 如果 pgpEnabled = true,则为必填 -
Application:属性 描述 选项
url 必填。 -
applicationDatasource 必填。 -
Odata(V4、V2):属性 描述 选项
url 必填。 -
odataPaginationSize 必填。 >= 0(默认值 = 0)
authenticationType 必填。 可以取以下值: - N:None(默认值) - B:Basic - O:OAuth2.0
basicUsername 如果 authenticationType = B,则为必填 -
basicPassword 如果 authenticationType = B,则定义 -
oauth2GrantType 如果 authenticationType = O,则定义 可以取以下值: - CLIENT(默认值) - PASSWORD
oauth2TokenEndpoint 如果 authenticationType = O,则为必填 -
oauth2ClientId 如果 authenticationType = O,则为必填 -
oauth2ClientSecret 如果 authenticationType = O,则为必填 -
oauth2Username 如果 authenticationType = O 且 oauth2GrantType = PASSWORD,则为必填 -
oauth2Password 如果 authenticationType = O 且 oauth2GrantType = PASSWORD,则为必填 -
oauth2Scopes 如果 authenticationType = O,则定义 -
oauth2Resources 如果 authenticationType = O,则定义 -
oauth2ClientAuthentication 如果 authenticationType = O,则定义 可以取以下值: - HEADER(默认值) - BODY - JWT
oauth2Kid Header 参数 'kid'(密钥 ID)是用于提示使用哪个密钥来保护 JWS。如果 authenticationType = O 且 oauth2GrantType = CLIENT 且 oauth2ClientAuthentication = JWT,则定义 -
oauth2Lifetime 该持续时间是添加到 iat(签发时间)的以秒为单位的时间,用于创建 JWT 到期时间,达到或超过该时间后 JWT 不得被接受用于数据处理)。如果 authenticationType = O 且 oauth2GrantType = CLIENT 且 oauth2ClientAuthentication = JWT,则定义 >= 1 且 <= 3600(默认值 = 300)
jwtCertificateFile 生成的 PEM 格式私钥代码。如果 authenticationType = O 且 oauth2GrantType = CLIENT 且 oauth2ClientAuthentication = JWT,则为必填 -
oauth2UseProxy - true/false(默认值 = false)
oauth2UseCertificates - true/false(默认值 = false)
proxyServer - -
proxyServerPort - -
proxyUsername - -
proxyPassword - -
customHeaders - -
REST API:属性 描述 选项
url 必填。 -
restResponseType 必填。 可以取以下值: - JSON(默认值) - CSV
restPath 如果 restResponseType = JSON,则定义 -
restJsonArrayLevel - >= 0(默认值 0)
restCsvHeader 如果 restResponseType = CSV,则定义 true/false(默认值 = false)
restCsvColumnSeparator 如果 restResponseType = CSV,则为必填 可以取以下值: - ","(默认值) - ";" - "
restCsvValueDelimiterMode 如果 restResponseType = CSV,则为必填 可以取以下值: - NONE(默认值) - MINIMAL - NON_NUMERIC - ALL
restCsvValueDelimiter 如果 restResponseType = CSV,则为必填 可以取以下值: - N(默认值) - " - '
restCsvRowSeparator 如果 restResponseType = CSV,则为必填 可以取以下值: - CRLF(默认值) - CR - LF
restPaginationUsage 必填。 可以取以下值: - N:None(默认值) - H:Header - Q:Query param
restPaginationPropertyName 仅当 restPaginationUsage = H 或 Q 时为必填 -
restPaginationSize 仅当 restPaginationUsage = H 或 Q 时为必填 必须 > 0
restNextPageResponsePosition 必填。 可以取以下值: - N:None(默认值) - H:Header - B:Body attribute(仅当 restResponseType = JSON 时)
restNextPageResponsePropertyName 仅当 restPaginationUsage = H 或 B 时为必填 -
restNextPageRequestPosition 必填。 可以取以下值: - N:None(默认值) - H:Header - Q:Query param - U:Complete URL
restNextPageRequestPropertyName 仅当 restPaginationUsage = H 或 Q 时为必填 -
authenticationType 必填。 可以取以下值: - N:None(默认值) - B:Basic - O:OAuth2.0
basicUsername 如果 authenticationType = B,则为必填。 -
basicPassword 如果 authenticationType = B,则定义 -
oauth2GrantType 如果 authenticationType = O,则定义 可以取以下值: - CLIENT(默认值) - PASSWORD
oauth2TokenEndpoint 如果 authenticationType = O,则为必填 -
oauth2ClientId 如果 authenticationType = O,则为必填 -
oauth2ClientSecret 如果 authenticationType = O,则为必填 -
oauth2Username 如果 authenticationType = O 且 oauth2GrantType = PASSWORD,则为必填 -
oauth2Password 如果 authenticationType = O 且 oauth2GrantType = PASSWORD,则为必填 -
oauth2Scopes 如果 authenticationType = O,则定义 -
oauth2Resources 如果 authenticationType = O,则定义 -
oauth2ClientAuthentication 如果 authenticationType = O,则定义 可以取以下值: - HEADER(默认值) - BODY - JWT
oauth2Kid Header 参数 'kid'(密钥 ID)是用于提示使用哪个密钥来保护 JWS。如果 authenticationType = O 且 oauth2GrantType = CLIENT 且 oauth2ClientAuthentication = JWT,则定义 -
oauth2Lifetime 该持续时间是添加到 iat(签发时间)的以秒为单位的时间,用于创建 JWT 到期时间,达到或超过该时间后 JWT 不得被接受用于数据处理)。如果 authenticationType = O 且 oauth2GrantType = CLIENT 且 oauth2ClientAuthentication = JWT,则定义 >= 1 且 <= 3600(默认值 = 300)
jwtCertificateFile 生成的 PEM 格式私钥代码。如果 authenticationType = O 且 oauth2GrantType = CLIENT 且 oauth2ClientAuthentication = JWT,则为必填 -
oauth2UseProxy - true/false(默认值 = false)
oauth2UseCertificates - true/false(默认值 = false)
proxyServer - -
proxyServerPort - -
proxyUsername - -
proxyPassword - -
customHeaders - -

无法通过 API 配置证书

Sharepoint:属性 描述 选项
sharepointTenantId 必填 -
sharepointClientId 必填 -
sharepointSiteName 必填 -
sharepointScope - -
sharepointAuthenticationType 必填 可以取以下值: - S:Secret 注意:该字段可以取只读值 C(Certificate)
sharepointSecretValue 必填 -
MS Fabric:属性 描述 选项
fabricSqlEndpoint 必填 SQL Warehouse Endpoint
fabricWarehouse 必填 Warehouse Name
fabricTenantId 必填 Tenant Id
fabricClientId 必填 Apllication Azure client id
fabricSecret 必填 为 Application Azure 生成的 Secret。

证书身份验证不通过 API 管理。

使用 REST API 服务时,不允许对 Google BigQuerySnowflake 端点执行创建、替换、更新和删除操作。执行这些操作将返回 "501 – Not Implemented" 响应。

用于替换端点的 API

方法

PUT

URL

http://server:port/tagetikcpm/api/admintools/import/v1/elements/endpoint_code

属性

在请求正文中,以 JSON 格式,可以根据端点类型包含与创建时相同的属性,但 'code' 除外,因为它已在 url 中指定。

对于 oauth2ClientAuthentication = JWT 的端点,此操作将无效(400 - Bad request: The following endpoint cannot be replaced:

用于更新端点的 API

方法

PATCH

URL

http://server:port/tagetikcpm/api/admintools/import/v1/elements/endpoint_code

属性

在请求正文中,以 JSON 格式,可以作为要更新的属性包含与创建时相同的属性,但以下不可更改的字段除外:

  • code
  • endpointType
  • tdlAgentId
  • tdlSourceType
  • sharepointAuthenticationType

其他不可编辑字段属于 oauth2ClientAuthentication = JWT 的端点修改情况:

  • authenticationType
  • oauth2GrantType
  • oauth2ClientAuthentication
  • jwtCertificateFile

用于删除端点的 API

方法

DELETE

URL

http://server:port/tagetikcpm/api/admintools/import/v1/elements/endpoint_code