> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Local OpenAPI Access in Cluster Mode

> Learn how to call YiDA OpenAPI in a dedicated cluster environment, including how to obtain the domain and AK/SK, use access_token for API calls, understand the main differences between the DingTalk Open Platform and cluster-edition OpenAPI, and configure the SDK.

App data in a dedicated cluster environment is stored in a private environment and cannot access the public network. As a result, the YiDA OpenAPI on the DingTalk Open Platform cannot retrieve this data. You must call the OpenAPI from within the cluster environment. The cluster-environment OpenAPI is essentially the same as on the DingTalk Open Platform, differing only in the host and the required AK/SK.

This article explains how to call the YiDA OpenAPI in a dedicated cluster environment.

<Note>
  Note:

  YiDA Dedicated currently exposes its high-frequency data service APIs. Based on the YiDA API capabilities available on the DingTalk Open Platform as of December 31, 2023, a total of 52 OpenAPIs are available.
</Note>

## Call Flow

Calling YiDA APIs in a cluster environment is similar to calling them on the DingTalk Open Platform. All related OpenAPIs on the DingTalk Open Platform are called via api.dingtalk.com. For cluster-edition OpenAPI, simply replace api.dingtalk.com with your organization's cluster-edition YiDA domain.

1. Obtain the domain of your organization's YiDA dedicated cluster, for example, ddyd.corp.com.
2. Obtain the AK and SK for your organization's cluster edition.

<Note>
  Contact your organization's DingTalk admin. Sign in to the DingTalk Open Platform, search for "YiDA Dedicated Cluster" under internal apps, and get the relevant information from the app named **YiDA Dedicated Cluster Authentication App**.
</Note>

<Steps>
  <Step title="Step 1">
    Use the AK/SK obtained in the previous step to call the /v1.0/oauth2/accessToken endpoint and obtain the app's access\_token. For request parameters, refer to Obtain the access\_token for an internal app.

    <Warning>
      On the Open Platform, the call is [https://api.dingtalk.com/v1.0/oauth2/accessToken](https://api.dingtalk.com/v1.0/oauth2/accessToken).

      Assuming your organization's YiDA domain is [https://your-org-private-yida-domain.com](https://your-org-private-yida-domain.com), the cluster-edition call is:

      [https://your-org-private-yida-domain.com/v1.0/oauth2/accessToken](https://your-org-private-yida-domain.com/v1.0/oauth2/accessToken)

      The access\_token is valid for 2 hours by default.
    </Warning>
  </Step>

  <Step title="Call YiDA APIs with the access_token" />
</Steps>

The DingTalk Open Platform provides SDKs in Java, PHP, Python, and .NET for developers. Cluster-edition OpenAPI supports similar calls.

<Note>
  Internal apps and third-party enterprise apps share the same Server-side SDK. Click either of the links below to download it.

  * Internal app: Download the Server-side SDK.
  * Third-party enterprise app: Download the Server-side SDK.
</Note>

5. If you use the DingTalk Open Platform SDK, apply the following changes:

Change 1: If the domain uses http, set config.protocol = "http".

Change 2: Explicitly set client.\_endpoint to your organization's actual YiDA domain.

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
private static com.aliyun.dingtalkyida_2_0.Client createOpenApiClient() {
        Config config = new Config();
        config.regionId = "central";
        config.protocol = "http";
        config.connectTimeout = 60 * 1000;
        config.readTimeout = 60 * 1000;
        try {
            com.aliyun.dingtalkyida_2_0.Client client = new com.aliyun.dingtalkyida_2_0.Client(config);
          client._endpoint =  "your-org-private-yida-domain.com";
            return client;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
```

## Cluster API List

YiDA provides a rich set of open API capabilities, enabling developers to integrate YiDA with enterprise business systems. Currently, APIs are primarily open for forms, workflows, and apps.

<table>
  <tr>
    <td>Module</td>
    <td>Standard Server API</td>
    <td>Description</td>
  </tr>

  <tr>
    <td rowSpan={7}>Workflow</td>
    <td>Start a YiDA approval process</td>
    <td>Start a YiDA approval process on the DingTalk Open Platform.</td>
  </tr>

  <tr>
    <td>Delete a workflow instance</td>
    <td>Delete a workflow instance.</td>
  </tr>

  <tr>
    <td>Terminate a workflow instance</td>
    <td>Terminate a workflow instance.</td>
  </tr>

  <tr>
    <td>Get a list of instance IDs</td>
    <td>Get a list of instance IDs.</td>
  </tr>

  <tr>
    <td>Get multiple workflow instances in bulk</td>
    <td>Get details of multiple workflow instances by their IDs in bulk.</td>
  </tr>

  <tr>
    <td>Get a workflow instance</td>
    <td>Get workflow instance information from YiDA.</td>
  </tr>

  <tr>
    <td>Get a workflow instance by ID</td>
    <td>Get the details of a workflow instance by its ID.</td>
  </tr>

  <tr>
    <td rowSpan={20}>Form</td>
    <td>Get the form list of a specified app</td>
    <td>Get the form list of an app with pagination.</td>
  </tr>

  <tr>
    <td>Get component information in a form</td>
    <td>Get component information in a form or workflow form by form ID.</td>
  </tr>

  <tr>
    <td>Query form instance data</td>
    <td>Query form instance data.</td>
  </tr>

  <tr>
    <td>Save form data</td>
    <td>Create a YiDA form instance without an approval process.</td>
  </tr>

  <tr>
    <td>Update form data</td>
    <td>Update form data.</td>
  </tr>

  <tr>
    <td>Query form data</td>
    <td>Query form data by form instance ID.</td>
  </tr>

  <tr>
    <td>Get the value of an employee component</td>
    <td>Get the value of an employee component.</td>
  </tr>

  <tr>
    <td>Get the list of form component definitions</td>
    <td>Get the list of form component definitions.</td>
  </tr>

  <tr>
    <td>Get subform component data</td>
    <td>Get subform component data by form instance ID and subform component ID.</td>
  </tr>

  <tr>
    <td>Delete form data</td>
    <td>Delete form data.</td>
  </tr>

  <tr>
    <td>Get multiple form instance IDs</td>
    <td>Get multiple form instance IDs.</td>
  </tr>

  <tr>
    <td>Get multiple form instances in bulk</td>
    <td>Get details of multiple form instances in bulk.</td>
  </tr>

  <tr>
    <td>Delete multiple form instances in bulk</td>
    <td>Delete multiple form instance records in bulk.</td>
  </tr>

  <tr>
    <td>Create multiple form instances in bulk</td>
    <td>Create multiple form instance records in bulk.</td>
  </tr>

  <tr>
    <td>Update component values in form instances in bulk</td>
    <td>Update component values in YiDA form instances in bulk by form instance ID.</td>
  </tr>

  <tr>
    <td>Create or update a form instance</td>
    <td>Create or update a form instance using filters.</td>
  </tr>

  <tr>
    <td>Query form instance data with advanced query conditions (including subform component data)</td>
    <td>Get form instance details using filters.</td>
  </tr>

  <tr>
    <td>Query form instance data with advanced query conditions (excluding subform component data)</td>
    <td>Get form instance details using filters, excluding subform component data.</td>
  </tr>

  <tr>
    <td>Update form instances in bulk with form instance data</td>
    <td>Update form instance information in bulk using YiDA form component data.</td>
  </tr>

  <tr>
    <td>Query form change records</td>
    <td>Query form change records.</td>
  </tr>

  <tr>
    <td rowSpan={5}>Approval task</td>
    <td>Get approval records</td>
    <td>Get approval records.</td>
  </tr>

  <tr>
    <td>Accept or decline a YiDA approval task</td>
    <td>Accept or decline a YiDA approval task.</td>
  </tr>

  <tr>
    <td>Transfer a task</td>
    <td>Transfer a task.</td>
  </tr>

  <tr>
    <td>Submit a comment</td>
    <td>Submit a comment on a form or workflow instance.</td>
  </tr>

  <tr>
    <td>Query comments on YiDA form instances in bulk</td>
    <td>Query all comments on YiDA forms in bulk.</td>
  </tr>

  <tr>
    <td>App</td>
    <td>Query the YiDA app list</td>
    <td>Query the list of YiDA apps in your organization.</td>
  </tr>
</table>
