### callStart() Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/okhttp/internal/connection/Transmitter.html Marks the start of a call, initiating necessary connection setup. ```APIDOC ## callStart() ### Description Marks the start of a call, initiating necessary connection setup. ### Method void ### Endpoint None ### Parameters None ### Request Example None ### Response #### Success Response (200) None #### Response Example None ``` -------------------------------- ### Minimal LarkChannel Integration Example Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/CHANNEL.md This example demonstrates the basic setup for a LarkChannel bot. It connects to Lark using WebSocket, listens for 'message' events, processes user input by calling a dummy agent function, and sends a response back, replying to the original message. Ensure you have APP_ID and APP_SECRET set as environment variables. ```java import com.lark.oapi.channel.LarkChannel; import com.lark.oapi.channel.ChannelEventHandler; import com.lark.oapi.channel.LarkChannelFactory; import com.lark.oapi.channel.config.LarkChannelOptions; import com.lark.oapi.channel.model.NormalizedMessage; import com.lark.oapi.channel.model.SendInput; import com.lark.oapi.channel.model.SendOptions; public class AgentBot { public static void main(String[] args) throws Exception { LarkChannel channel = LarkChannelFactory.createLarkChannel( LarkChannelOptions.newBuilder(System.getenv("APP_ID"), System.getenv("APP_SECRET")) .transport("websocket") .build() ); channel.on("message", new ChannelEventHandler() { @Override public void handle(NormalizedMessage message) { try { String answer = callAgent(message.getContent()); channel.send( message.getChatId(), SendInput.markdown(answer), SendOptions.newBuilder().replyTo(message.getMessageId()).build() ); } catch (Exception e) { channel.send( message.getChatId(), SendInput.text("处理失败,请稍后重试。"), SendOptions.newBuilder().replyTo(message.getMessageId()).build() ); } } }); channel.connect().get(); Thread.currentThread().join(); } private static String callAgent(String userInput) { return "收到:" + userInput; } } ``` -------------------------------- ### Set Out Start Time Method Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/approval/v4/model/P1OutApprovalV4Data.html Sets the out-of-office start time. Requires a String argument for the out-of-office start time. ```Java setOutStartTime(String outStartTime) ``` -------------------------------- ### RoomStatus Builder Initialization Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/vc/v1/model/class-use/RoomStatus.Builder.html Demonstrates how to initialize the RoomStatus builder. ```APIDOC ## RoomStatus Builder Initialization ### Description Initializes a new builder for the RoomStatus object. ### Method Signature `RoomStatus.newBuilder()` ### Returns `RoomStatus.Builder` - A new instance of the builder. ``` -------------------------------- ### Get Start Index Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/baike/v1/model/Span.html Retrieves the start index of the span. This method returns an Integer representing the starting position. ```java public [Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true "java.lang中的类或接口") getStart() ``` -------------------------------- ### Get Start Time Method Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/approval/v4/model/P1OutApprovalV4Data.html Retrieves the start time. Returns a long. ```Java getStartTime() ``` -------------------------------- ### Get Out Start Time Method Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/approval/v4/model/P1OutApprovalV4Data.html Retrieves the start time of an out-of-office event. Returns a String. ```Java getOutStartTime() ``` -------------------------------- ### Setting State Information Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/hire/v1/model/class-use/AppliOfferOnboardProfileCity.html Demonstrates how to set the state for an onboarding profile using the AppliOfferOnboardProfileAdd.Builder. ```APIDOC ## Setting State Information ### Description This method allows you to set the state for an onboarding profile. ### Method Signature `AppliOfferOnboardProfileAdd.Builder.state(AppliOfferOnboardProfileCity state)` ### Parameters * **state** (`AppliOfferOnboardProfileCity`) - The state object to set. ``` -------------------------------- ### WebSocket Creation Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/okhttp/class-use/Request.html Shows how to establish a new WebSocket connection using OkHttpClient or WebSocket.Factory. ```APIDOC ## POST /api/websockets ### Description Establishes a new WebSocket connection using the provided Request and WebSocketListener. ### Method POST ### Endpoint /api/websockets ### Parameters #### Request Body - **request** (Request) - Required - The request object for the WebSocket connection. - **listener** (WebSocketListener) - Required - The listener to handle WebSocket events. ### Request Example ```json { "request": { "url": "wss://example.com/socket" }, "listener": "..." } ``` ### Response #### Success Response (200) - **webSocket** (WebSocket) - The created WebSocket object. #### Response Example ```json { "webSocket": "..." } ``` ``` -------------------------------- ### Event Time Management Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/calendar/v4/model/CalendarEvent.html Methods for setting and getting the start and end times of an event. ```APIDOC ## Event Time Management ### Description Methods for setting and getting the start and end times of an event. ### Methods #### `setEndTime` Sets the end time of the event. - **Parameter**: `endTime` (TimeInfo) - The end time of the event. #### `getVchat` Retrieves the Vchat information associated with the event. - **Returns**: Vchat - The Vchat object. #### `setVchat` Sets the Vchat information for the event. - **Parameter**: `vchat` (Vchat) - The Vchat object to set. #### `getVisibility` Retrieves the visibility setting of the event. - **Returns**: String - The visibility status (e.g., 'public', 'private'). #### `setVisibility` Sets the visibility of the event. - **Parameter**: `visibility` (String) - The desired visibility status. #### `getAttendeeAbility` Retrieves the attendee ability setting for the event. - **Returns**: String - The attendee ability status. #### `setAttendeeAbility` Sets the attendee ability for the event. - **Parameter**: `attendeeAbility` (String) - The desired attendee ability status. #### `getFreeBusyStatus` Retrieves the free/busy status of the event. - **Returns**: String - The free/busy status (e.g., 'free', 'busy'). #### `setFreeBusyStatus` Sets the free/busy status for the event. - **Parameter**: `freeBusyStatus` (String) - The desired free/busy status. #### `getLocation` Retrieves the location of the event. - **Returns**: EventLocation - The location object. #### `setLocation` Sets the location for the event. - **Parameter**: `location` (EventLocation) - The location object to set. #### `getColor` Retrieves the color associated with the event. - **Returns**: Integer - The color value. #### `setColor` Sets the color for the event. - **Parameter**: `color` (Integer) - The color value to set. #### `getReminders` Retrieves the reminders set for the event. - **Returns**: Reminder[] - An array of reminder objects. #### `setReminders` Sets the reminders for the event. - **Parameter**: `reminders` (Reminder[]) - An array of reminder objects to set. #### `getRecurrence` Retrieves the recurrence rule for the event. - **Returns**: String - The recurrence rule string. #### `setRecurrence` Sets the recurrence rule for the event. - **Parameter**: `recurrence` (String) - The recurrence rule string to set. #### `getStatus` Retrieves the status of the event. - **Returns**: String - The event status. #### `setStatus` Sets the status for the event. - **Parameter**: `status` (String) - The event status to set. #### `getIsException` Checks if the event is an exception to a recurring event. - **Returns**: Boolean - True if it's an exception, false otherwise. #### `setIsException` Sets whether the event is an exception. - **Parameter**: `isException` (Boolean) - True to mark as an exception, false otherwise. #### `getRecurringEventId` Retrieves the ID of the recurring event this event is an exception to. - **Returns**: String - The recurring event ID. ``` -------------------------------- ### Get Encoded Path from URL Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/okhttp/HttpUrl.html Use `encodedPath()` to get the entire URL path, encoded for HTTP resource resolution. The returned path always starts with a forward slash ('/'). ```java encodedPath() ``` -------------------------------- ### Device Constructor Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/acs/v1/AcsService.Device.html Initializes a new instance of the Device class with the provided configuration. ```APIDOC ## Device Constructor ### Description Initializes a new instance of the Device class with the provided configuration. ### Signature `public Device(Config config)` ``` -------------------------------- ### RequestLine.requestPath Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/okhttp/internal/http/RequestLine.html Extracts and returns the path component of a URL, which is used in the request line, for example, the '/' in 'GET / HTTP/1.1'. ```APIDOC ## GET RequestLine.requestPath ### Description Returns the path to request, like the '/' in 'GET / HTTP/1.1'. This method isolates the path from a given HttpUrl. ### Method static ### Parameters #### Path Parameters - **url** (HttpUrl) - Required - The HttpUrl object from which to extract the path. ``` -------------------------------- ### Build configuration object Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/hire/v1/model/OfferApplyFormObjectDisplayConfigInfo.Builder.html Constructs the final OfferApplyFormObjectDisplayConfigInfo instance. ```java public OfferApplyFormObjectDisplayConfigInfo build() ``` -------------------------------- ### Setting District Information Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/hire/v1/model/class-use/AppliOfferOnboardProfileCity.html Demonstrates how to set the district for an onboarding profile using the AppliOfferOnboardProfileAdd.Builder. ```APIDOC ## Setting District Information ### Description This method allows you to set the district for an onboarding profile. ### Method Signature `AppliOfferOnboardProfileAdd.Builder.district(AppliOfferOnboardProfileCity district)` ### Parameters * **district** (`AppliOfferOnboardProfileCity`) - The district object to set. ``` -------------------------------- ### Set Offset for CommentAtInfo Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/approval/v4/model/CommentAtInfo.Builder.html Sets the position of the @mentioned user within the comment, starting from 0. Example value: 1. ```java public CommentAtInfo.Builder offset(String offset) ``` -------------------------------- ### OkHttpClient Usage and Customization Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/okhttp/OkHttpClient.html This section explains how to create and customize OkHttpClient instances. It highlights the importance of reusing a single client instance for all HTTP calls to optimize performance by leveraging connection and thread pools. Examples demonstrate creating a default client and a client with custom settings like logging interceptors and caching. ```APIDOC ## OkHttpClient Usage and Customization ### Description OkHttpClient is the factory for calls, which can be used to send HTTP requests and read their responses. It is recommended to create a single `OkHttpClient` instance and reuse it for all HTTP calls to benefit from its connection pool and thread pools, which reduces latency and saves memory. ### Creating a Default Client Use `new OkHttpClient()` to create a shared instance with default settings. ```java public final OkHttpClient client = new OkHttpClient(); ``` ### Creating a Customized Client Use `new OkHttpClient.Builder()` to create a shared instance with custom settings. ```java public final OkHttpClient client = new OkHttpClient.Builder() .addInterceptor(new HttpLoggingInterceptor()) .cache(new Cache(cacheDir, cacheSize)) .build(); ``` ### Customizing an Existing Client You can customize a shared OkHttpClient instance with `newBuilder()`. This builds a client that shares the same connection pool, thread pools, and configuration. Use the builder methods to configure the derived client for a specific purpose. #### Example: Setting a Short Timeout This example shows a call with a short 500 millisecond read timeout: ```java OkHttpClient eagerClient = client.newBuilder() .readTimeout(500, TimeUnit.MILLISECONDS) .build(); Response response = eagerClient.newCall(request).execute(); ``` ### Shutdown Shutdown is not strictly necessary as threads and connections held by the client will be released automatically if they remain idle. However, for applications needing aggressive resource release, manual shutdown mechanisms can be implemented. ``` -------------------------------- ### Setting up Certificate Pinning Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/okhttp/CertificatePinner.html To set up certificate pinning, start with a broken configuration and read the expected configuration from the resulting exception. This method should be used on a trusted network without man-in-the-middle tools. ```java String hostname = "publicobject.com"; CertificatePinner certificatePinner = new CertificatePinner.Builder() .add(hostname, "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") .build(); OkHttpClient client = OkHttpClient.Builder() .certificatePinner(certificatePinner) .build(); Request request = new Request.Builder() .url("https://" + hostname) .build(); client.newCall(request).execute(); ``` -------------------------------- ### Job Requirement Management Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/hire/v1/model/JobRequirementDto.html Methods for setting and getting recruiter lists, direct leader lists, start times, deadlines, priority, degree requirements, salary ranges, addresses, descriptions, customized data, and job IDs within the Larksuite Hire module. ```APIDOC ## Job Requirement Management ### Description This section details the methods available in the Larksuite OAPI Java SDK for managing job requirements. It includes functions to set and retrieve recruiter information, direct leader details, job start and end times, priority levels, required educational degrees, salary ranges, location, descriptions, and customized data. ### Methods #### `setRecruiterList` - **Description**: Sets the list of recruiters for a job. - **Method**: Setter - **Parameters**: - `recruiterList` (IdNameObject[]) - Required - The list of recruiters. #### `getDirectLeaderList` - **Description**: Retrieves the list of direct leaders for a job. - **Method**: Getter - **Returns**: IdNameObject[] - The list of direct leaders. #### `setDirectLeaderList` - **Description**: Sets the list of direct leaders for a job. - **Method**: Setter - **Parameters**: - `directLeaderList` (IdNameObject[]) - Required - The list of direct leaders. #### `getStartTime` - **Description**: Retrieves the start time of the job posting. - **Method**: Getter - **Returns**: String - The start time. #### `setStartTime` - **Description**: Sets the start time for the job posting. - **Method**: Setter - **Parameters**: - `startTime` (String) - Required - The start time. #### `getDeadline` - **Description**: Retrieves the deadline for the job application. - **Method**: Getter - **Returns**: String - The deadline. #### `setDeadline` - **Description**: Sets the deadline for job applications. - **Method**: Setter - **Parameters**: - `deadline` (String) - Required - The deadline. #### `getPriority` - **Description**: Retrieves the priority level of the job. - **Method**: Getter - **Returns**: Integer - The priority level. #### `setPriority` - **Description**: Sets the priority level for the job. - **Method**: Setter - **Parameters**: - `priority` (Integer) - Required - The priority level. #### `getRequiredDegree` - **Description**: Retrieves the required educational degree for the job. - **Method**: Getter - **Returns**: Integer - The required degree code. #### `setRequiredDegree` - **Description**: Sets the required educational degree for the job. - **Method**: Setter - **Parameters**: - `requiredDegree` (Integer) - Required - The required degree code. #### `getMaxSalary` - **Description**: Retrieves the maximum salary offered for the job. - **Method**: Getter - **Returns**: String - The maximum salary. #### `setMaxSalary` - **Description**: Sets the maximum salary for the job. - **Method**: Setter - **Parameters**: - `maxSalary` (String) - Required - The maximum salary. #### `getMinSalary` - **Description**: Retrieves the minimum salary offered for the job. - **Method**: Getter - **Returns**: String - The minimum salary. #### `setMinSalary` - **Description**: Sets the minimum salary for the job. - **Method**: Setter - **Parameters**: - `minSalary` (String) - Required - The minimum salary. #### `getAddress` - **Description**: Retrieves the address associated with the job location. - **Method**: Getter - **Returns**: IdNameObject - The job address. #### `setAddress` - **Description**: Sets the address for the job location. - **Method**: Setter - **Parameters**: - `address` (IdNameObject) - Required - The job address. #### `getDescription` - **Description**: Retrieves the detailed description of the job. - **Method**: Getter - **Returns**: String - The job description. #### `setDescription` - **Description**: Sets the detailed description for the job. - **Method**: Setter - **Parameters**: - `description` (String) - Required - The job description. #### `getCustomizedDataList` - **Description**: Retrieves the list of customized data fields for the job requirement. - **Method**: Getter - **Returns**: JobRequirementCustomizedDataDto[] - The list of customized data. #### `setCustomizedDataList` - **Description**: Sets the customized data fields for the job requirement. - **Method**: Setter - **Parameters**: - `customizedDataList` (JobRequirementCustomizedDataDto[]) - Required - The list of customized data. #### `getJobIdList` - **Description**: Retrieves the list of job IDs. (Note: The return type is not specified in the provided text, assuming it's a getter for a list of job IDs). - **Method**: Getter ``` -------------------------------- ### Set Start Index Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/baike/v1/model/Span.html Sets the start index for the span. This method takes an Integer value to define the starting position. ```java public void setStart([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true "java.lang中的类或接口") start) ``` -------------------------------- ### build Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/hire/v1/model/BasicInfo.Builder.html Builds and returns the BasicInfo object with the configured properties. ```APIDOC ## build ### Description Builds and returns the BasicInfo object with the configured properties. ### Method Builder method ### Returns * BasicInfo - The constructed BasicInfo object. ``` -------------------------------- ### OkHttpClient.Builder Configuration Methods Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/okhttp/class-use/OkHttpClient.Builder.html Methods for configuring the OkHttpClient instance, including network settings, security, and event listeners. ```APIDOC ## OkHttpClient.Builder Configuration ### Description Methods to configure the OkHttpClient.Builder for the Lark Suite OAPI SDK. ### Methods - **certificatePinner(CertificatePinner)**: Sets the certificate pinner that constrains which certificates are trusted. - **connectionPool(ConnectionPool)**: Sets the connection pool used to recycle HTTP and HTTPS connections. - **connectTimeout(Duration)**: Sets the default connect timeout for new connections using Duration. - **connectTimeout(long, TimeUnit)**: Sets the default connect timeout for new connections using long and TimeUnit. - **cookieJar(CookieJar)**: Sets the handler that accepts cookies from responses and provides them to requests. - **dispatcher(Dispatcher)**: Sets the dispatcher used to set policy and execute asynchronous requests. - **dns(Dns)**: Sets the DNS service used to lookup IP addresses for hostnames. - **eventListener(EventListener)**: Configure a single client scoped listener for analytic events. - **eventListenerFactory(EventListener.Factory)**: Configure a factory to provide per-call scoped listeners. ``` -------------------------------- ### GET Request Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/core/token/class-use/AccessTokenType.html Executes a GET request to the specified path. ```APIDOC ## GET [httpPath] ### Description Executes a GET request to the specified path using the provided access token type and request options. ### Method GET ### Parameters #### Path Parameters - **httpPath** (String) - Required - The API endpoint path. - **body** (Object) - Optional - The request body. - **accessTokenType** (AccessTokenType) - Required - The type of access token to use. - **requestOptions** (RequestOptions) - Optional - Additional request configuration. ### Response - **RawResponse** - The raw response object from the API. ``` -------------------------------- ### Meta Constructor Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/drive/v1/DriveService.Meta.html Initializes the Meta service with the provided configuration. ```java public Meta(Config config) ``` -------------------------------- ### Set Start Time Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/approval/v4/model/Instance.Builder.html Sets the timestamp when the approval instance was started. ```Java public Instance.Builder startTime(String startTime) ``` -------------------------------- ### Start Service Ticket API Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/helpdesk/v1/model/package-tree.html This API allows for starting a service ticket. ```APIDOC ## POST /api/helpdesk/v1/service_tickets/start ### Description Starts a new service ticket. ### Method POST ### Endpoint /api/helpdesk/v1/service_tickets/start ### Parameters #### Request Body - **ticket** (StartServiceTicketReqBody) - Required - The request body for starting a service ticket. ### Request Example ```json { "ticket": { "subject": "Login Issue", "description": "Cannot log in to my account.", "requester_id": "7000000000000000000", "priority": 2, "category_id": "7100000000000000000" } } ``` ### Response #### Success Response (200) - **ticket_id** (string) - The ID of the newly created ticket. #### Response Example ```json { "code": 0, "msg": "Success", "data": { "ticket_id": "7300000000000000000" } } ``` ``` -------------------------------- ### OkHttpClient.Builder Configuration Methods Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/okhttp/OkHttpClient.Builder.html Methods to configure security, authentication, and connection behavior for the OkHttpClient. ```APIDOC ## OkHttpClient.Builder Configuration ### Description Methods to customize the behavior of the OkHttpClient instance, including SSL/TLS settings, authentication, and connection pooling. ### Methods - **hostnameVerifier(HostnameVerifier)**: Sets the verifier used to confirm that response certificates apply to requested hostnames. - **certificatePinner(CertificatePinner)**: Sets the certificate pinner that constrains which certificates are trusted. - **authenticator(Authenticator)**: Sets the authenticator used to respond to challenges from origin servers. - **proxyAuthenticator(Authenticator)**: Sets the authenticator used to respond to challenges from proxy servers. - **connectionPool(ConnectionPool)**: Sets the connection pool used to recycle HTTP and HTTPS connections. - **followSslRedirects(boolean)**: Configures the client to follow redirects from HTTPS to HTTP and vice versa. - **followRedirects(boolean)**: Configures the client to follow redirects. ``` -------------------------------- ### Leave Start Time Management Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/approval/v4/model/P1LeaveApprovalV4Data.html Methods for managing the leave start time. ```APIDOC ## GET /api/leaveStartTime ### Description Retrieves the leave start time. ### Method GET ### Endpoint /api/leaveStartTime ### Response #### Success Response (200) - **leaveStartTime** (String) - The leave start time. #### Response Example ```json { "leaveStartTime": "2023-03-15T09:00:00Z" } ``` ## POST /api/leaveStartTime ### Description Sets the leave start time. ### Method POST ### Endpoint /api/leaveStartTime ### Request Body - **leaveStartTime** (String) - The leave start time to set. ### Request Example ```json { "leaveStartTime": "2023-03-15T09:00:00Z" } ``` ### Response #### Success Response (200) - **message** (String) - Confirmation message. #### Response Example ```json { "message": "Leave start time set successfully" } ``` ``` -------------------------------- ### Initialize WebSocket Reader and Writer Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/okhttp/internal/ws/RealWebSocket.html Sets up the reader and writer streams for the WebSocket connection. This method may throw an IOException. ```java public void initReaderAndWriter([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true "java.lang中的类或接口") name, [RealWebSocket.Streams](../../../../../../com/lark/oapi/okhttp/internal/ws/RealWebSocket.Streams.html "com.lark.oapi.okhttp.internal.ws中的类") streams) throws [IOException](https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true "java.io中的类或接口") 抛出: `[IOException](https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true "java.io中的类或接口")` ``` -------------------------------- ### Create a shared OkHttpClient instance with default settings Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/okhttp/OkHttpClient.html Use `new OkHttpClient()` to create a shared instance with default settings. This instance should be reused for all HTTP calls to benefit from connection and thread pooling. ```java public final OkHttpClient client = new OkHttpClient(); ``` -------------------------------- ### Set Start Index Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/sheets/v3/model/Dimension.Builder.html Sets the starting row or column number for the Dimension object. ```java public Dimension.Builder startIndex(Integer startIndex) ``` -------------------------------- ### Start Meeting Recording Request Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/vc/v1/model/StartMeetingRecordingReq.html This model represents the request structure for starting a recording for a meeting. ```APIDOC ## Start Meeting Recording Request ### Description This model is used to define the request parameters for starting a recording for a specific meeting. ### Parameters #### Request Body - **meetingId** (String) - Required - The unique identifier of the meeting. - **body** (StartMeetingRecordingReqBody) - Required - The request body containing specific recording configuration details. ``` -------------------------------- ### Image Constructor Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/okr/v1/OkrService.Image.html Initializes the Image service with the provided configuration. ```java public Image(Config config) ``` -------------------------------- ### Set Start Time Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/vc/v1/model/GetTopUserReportReq.html Sets the start time for the report. Accepts a String representing the time. ```APIDOC ## setStartTime ### Description Sets the start time for the report. ### Method Setter ### Parameters - **startTime** (String) - Description for startTime ``` -------------------------------- ### Setting City Information Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/hire/v1/model/class-use/AppliOfferOnboardProfileCity.html Demonstrates how to set the city for an onboarding profile using the AppliOfferOnboardProfileAdd.Builder. ```APIDOC ## Setting City Information ### Description This method allows you to set the city for an onboarding profile. ### Method Signature `AppliOfferOnboardProfileAdd.Builder.city(AppliOfferOnboardProfileCity city)` ### Parameters * **city** (`AppliOfferOnboardProfileCity`) - The city object to set. ``` -------------------------------- ### build Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/okhttp/OkHttpClient.Builder.html Builds the OkHttpClient instance. ```APIDOC ## build ### Description Constructs and returns the configured OkHttpClient instance. ### Response - **OkHttpClient** - The fully configured client instance. ``` -------------------------------- ### Set ApplicationTalentCareerInfo Start Time Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/hire/v1/model/ApplicationTalentCareerInfo.html Sets the start time for the ApplicationTalentCareerInfo. This method is part of the setter methods for the class. ```java public void setStartTime(String startTime) ``` -------------------------------- ### OfferApplyFormFormulaExtraMapInfo.Builder Methods Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/hire/v1/model/OfferApplyFormFormulaExtraMapInfo.Builder.html Provides documentation for the methods available in the OfferApplyFormFormulaExtraMapInfo.Builder class. ```APIDOC ## OfferApplyFormFormulaExtraMapInfo.Builder ### Description This class serves as a builder for creating `OfferApplyFormFormulaExtraMapInfo` objects. It allows for the programmatic construction of these objects by chaining method calls. ### Methods #### `OfferApplyFormFormulaExtraMapInfo.Builder()` ##### Description Constructor for the `OfferApplyFormFormulaExtraMapInfo.Builder` class. ##### Method `new()` #### `put(String key, String value)` ##### Description Adds or updates a key-value pair in the extra map. ##### Method `put(String key, String value)` ##### Parameters * **key** (String) - Required - The key for the extra information. * **value** (String) - Required - The value for the extra information. #### `build()` ##### Description Builds and returns the `OfferApplyFormFormulaExtraMapInfo` object with the configured extra information. ##### Method `build()` ##### Returns - **OfferApplyFormFormulaExtraMapInfo** - The constructed `OfferApplyFormFormulaExtraMapInfo` object. ``` -------------------------------- ### get Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/helpdesk/v1/HelpdeskService.TicketCustomizedField.html Retrieves the details of a ticket customized field. This API is used to get ticket customized field details. ```APIDOC ## GET /open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id ### Description Retrieves the details of a ticket customized field. This API is used to get ticket customized field details. ### Method GET ### Endpoint /open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id ### Parameters #### Path Parameters - **ticket_customized_field_id** (string) - Required - The ID of the ticket customized field to retrieve. ### Response #### Success Response (200) - **data** (object) - The response data. - **ticket_customized_field** (object) - The ticket customized field object. - **id** (string) - The ID of the ticket customized field. - **name** (string) - The name of the ticket customized field. - **key** (string) - The key of the ticket customized field. - **description** (string) - The description of the ticket customized field. - **type** (string) - The type of the ticket customized field. - **required** (boolean) - Whether the field is required. - **editable** (boolean) - Whether the field is editable. - **searchable** (boolean) - Whether the field is searchable. - **visible_in_list** (boolean) - Whether the field is visible in the list. - **form_visible** (boolean) - Whether the field is visible in the form. - **created_at** (string) - The creation timestamp. - **updated_at** (string) - The update timestamp. ### Request Example (No request example provided in source) ### Response Example (No response example provided in source) ``` -------------------------------- ### OkHttpClient.Builder Configuration Methods Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/okhttp/OkHttpClient.Builder.html Methods for configuring the OkHttpClient instance, including timeouts, connection management, and event listeners. ```APIDOC ## OkHttpClient.Builder Configuration ### Description Methods to configure the OkHttpClient.Builder instance for the Lark Suite OAPI SDK. ### Methods - **callTimeout(long timeout, TimeUnit unit)**: Sets the default timeout for complete calls. - **certificatePinner(CertificatePinner certificatePinner)**: Sets the certificate pinner that constrains which certificates are trusted. - **connectionPool(ConnectionPool connectionPool)**: Sets the connection pool used to recycle HTTP and HTTPS connections. - **connectTimeout(Duration duration)**: Sets the default connect timeout for new connections. - **connectTimeout(long timeout, TimeUnit unit)**: Sets the default connect timeout for new connections. - **cookieJar(CookieJar cookieJar)**: Sets the handler that can accept cookies from incoming HTTP responses and provides cookies to outgoing HTTP requests. - **dispatcher(Dispatcher dispatcher)**: Sets the dispatcher used to set policy and execute asynchronous requests. - **dns(Dns dns)**: Sets the DNS service used to lookup IP addresses for hostnames. - **eventListener(EventListener eventListener)**: Configure a single client scoped listener that will receive all analytic events for this client. ``` -------------------------------- ### Get Agent Schedules Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/helpdesk/v1/HelpdeskService.AgentSchedules.html Retrieves the work schedules for helpdesk agents. This API is used to get agent information. ```APIDOC ## GET /open-apis/helpdesk/v1/agent_schedules ### Description Retrieves the work schedules for helpdesk agents. This API is used to get agent information. ### Method GET ### Endpoint /open-apis/helpdesk/v1/agent_schedules ### Parameters #### Query Parameters - **user_id** (string) - Required - The ID of the user whose schedules are to be retrieved. ### Response #### Success Response (200) - **schedules** (array) - A list of agent schedules. - **start_time** (integer) - The start time of the schedule. - **end_time** (integer) - The end time of the schedule. - **work_day** (integer) - The day of the week (1-7, Sunday is 1). - **agent_id** (string) - The ID of the agent. - **schedule_id** (string) - The ID of the schedule. - **is_work_time** (boolean) - Whether this is a work time. - **timezone** (string) - The timezone of the schedule. - **agent_name** (string) - The name of the agent. - **agent_email** (string) - The email of the agent. ### Request Example ```json { "user_id": "example_user_id" } ``` ### Response Example ```json { "schedules": [ { "start_time": 1678886400, "end_time": 1678972800, "work_day": 2, "agent_id": "example_agent_id", "schedule_id": "example_schedule_id", "is_work_time": true, "timezone": "Asia/Shanghai", "agent_name": "Example Agent", "agent_email": "agent@example.com" } ] } ``` ``` -------------------------------- ### Certificate Pinner Configuration Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/okhttp/CertificatePinner.html This section details how to set up certificate pinning for a given hostname. It includes an example of how to build a CertificatePinner instance and integrate it with an OkHttpClient. ```APIDOC ## Certificate Pinner Configuration ### Description Constrains which certificates are trusted. Pinning certificates defends against attacks on certificate authorities and prevents connections through man-in-the-middle certificate authorities. ### Setting up Certificate Pinning The easiest way to pin a host is to turn on pinning with a broken configuration and read the expected configuration when the connection fails. Be sure to do this on a trusted network, and without man-in-the-middle tools like Charles or Fiddler. For example, to pin `https://publicobject.com`, start with a broken configuration: ```java String hostname = "publicobject.com"; CertificatePinner certificatePinner = new CertificatePinner.Builder() .add(hostname, "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") .build(); OkHttpClient client = OkHttpClient.Builder() .certificatePinner(certificatePinner) .build(); Request request = new Request.Builder() .url("https://" + hostname) .build(); client.newCall(request).execute(); ``` As expected, this fails with a certificate pinning exception. Follow up by pasting the public key hashes from the exception into the certificate pinner's configuration: ```java CertificatePinner certificatePinner = new CertificatePinner.Builder() .add("publicobject.com", "sha256/afwiKY3RxoMmLkuRW1l7QsPZTJPwDS2pdDROQjXw8ig=") .add("publicobject.com", "sha256/klO23nT2ehFDXCfx3eHTDRESMz3asj1muO+4aIdjiuY=") .add("publicobject.com", "sha256/grX4Ta9HpZx6tSHkmCrvpApTQGo67CYDnvprLg5yRME=") .add("publicobject.com", "sha256/lCppFqbkrlJ3EcVFAkeip0+44VaoJUymbnOaEUk7tEU=") .build(); ``` ### Parameters #### Request Body This endpoint does not directly involve a request body for configuration. The configuration is done programmatically via the `CertificatePinner.Builder`. ### Request Example ```json { "example": "See code examples above for programmatic configuration." } ``` ### Response #### Success Response (200) This class does not directly return a response in the typical HTTP sense. Its success is measured by the successful establishment of a TLS connection with pinned certificates. #### Response Example ```json { "example": "Successful TLS connection established." } ``` #### Error Handling - `javax.net.ssl.SSLPeerUnverifiedException`: Thrown when a certificate pinning failure occurs. The exception message provides the details of the peer certificate chain and the expected pinned certificates. ``` -------------------------------- ### GET /helpdesk/v1/agent_email Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/helpdesk/v1/HelpdeskService.Agent.html Retrieves the email address of the agent. This endpoint is used to get the agent's email address. ```APIDOC ## GET /helpdesk/v1/agent_email ### Description Retrieves the email address of the agent. ### Method GET ### Endpoint /helpdesk/v1/agent_email ### Parameters #### Query Parameters - **reqOptions** (RequestOptions) - Optional - Request options for the API call. ### Response #### Success Response (200) - **data** (AgentEmailAgentResp) - The response object containing the agent's email address. ### Request Example ```json { "example": "No request body needed for this GET request, but RequestOptions might be used." } ``` ### Response Example ```json { "example": "AgentEmailAgentResp object" } ``` ### Official API Documentation [https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent/agent_email](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/helpdesk-v1/agent/agent_email) ### Demo Link [https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/AgentEmailAgentSample.java](https://github.com/larksuite/oapi-sdk-java/tree/v2_main/sample/src/main/java/com/lark/oapi/sample/apiall/helpdeskv1/AgentEmailAgentSample.java) ``` -------------------------------- ### Faq.Builder Constructor Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/helpdesk/v1/model/Faq.Builder.html Initializes a new instance of the Faq.Builder class. ```APIDOC ## Builder() ### Description Initializes a new instance of the Faq.Builder class. ### Method ```java public Builder() ``` ``` -------------------------------- ### Set Meeting Start Time Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/vc/v1/model/Meeting.Builder.html Set the scheduled start time for the meeting. The time should be in Unix timestamp format (seconds). ```java public Meeting.Builder startTime(String startTime) ``` -------------------------------- ### get Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/helpdesk/v1/HelpdeskService.Faq.html Retrieves the details of a knowledge base article. This interface is used to get the details of a helpdesk knowledge base article. ```APIDOC ## get ### Description Retrieves the details of a knowledge base article. This interface is used to get the details of a helpdesk knowledge base article. ### Method GET ### Endpoint /open-apis/helpdesk/v1/faqs/{faq_id} ### Parameters #### Path Parameters - **faq_id** (string) - Required - The ID of the FAQ article. #### Query Parameters - **user_id** (string) - Optional - The ID of the user. ### Response #### Success Response (200) - **faq_resp** (GetFaqResp) - The response object containing the FAQ details. ### Exception - Exception ``` -------------------------------- ### build() Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/application/v6/model/ApplicationOwner.Builder.html Builds and returns the ApplicationOwner object with the configured properties. ```APIDOC ## build() ### Description Builds and returns the ApplicationOwner object with the configured properties. ### Method public ApplicationOwner build() ### Parameters None ``` -------------------------------- ### OfferApplyFormObjectInfo.Builder Constructor Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/hire/v1/model/OfferApplyFormObjectInfo.Builder.html Initializes a new instance of the OfferApplyFormObjectInfo.Builder class. ```APIDOC ## OfferApplyFormObjectInfo.Builder() ### Description Initializes a new instance of the OfferApplyFormObjectInfo.Builder class. ### Method public Builder() ### Parameters None ``` -------------------------------- ### GET /open.lark/task/v1/task_comments/:task_id Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/task/v1/TaskService.TaskComment.html Retrieves the details of a specific task comment. This endpoint is used to get detailed information about a comment by its ID. ```APIDOC ## GET /open.lark/task/v1/task_comments/:task_id ### Description Retrieves the details of a specific task comment. This endpoint is used to get detailed information about a comment by its ID. ### Method GET ### Endpoint /open.lark/task/v1/task_comments/:task_id ### Parameters #### Path Parameters - **task_id** (string) - Required - The ID of the task to which the comment belongs. #### Query Parameters - **comment_id** (string) - Required - The ID of the comment to retrieve. ### Request Example ```json { "comment_id": "7100396038142031107" } ``` ### Response #### Success Response (200) - **data** (object) - The comment details. - **comment_id** (string) - The ID of the comment. - **content** (string) - The content of the comment. - **create_time** (string) - The creation timestamp of the comment. - **creator_id** (string) - The ID of the user who created the comment. - **creator_type** (string) - The type of the creator (e.g., user, bot). - **is_hidden** (boolean) - Whether the comment is hidden. - **rich_content** (string) - The rich content of the comment. - **update_time** (string) - The update timestamp of the comment. #### Response Example ```json { "code": 0, "msg": "success", "data": { "comment_id": "7100396038142031107", "content": "This is a test comment.", "create_time": "1678886400", "creator_id": "7094070000000000000", "creator_type": "user", "is_hidden": false, "rich_content": "

This is a test comment.

", "update_time": "1678886400" } } ``` ``` -------------------------------- ### GET /api/contact/v3/users/:user_id Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/contact/v3/ContactService.User.html Retrieves information for a single user. This endpoint is used to get the details of a specific user in the contact list. ```APIDOC ## GET /api/contact/v3/users/:user_id ### Description Retrieves information for a single user. ### Method GET ### Endpoint /api/contact/v3/users/:user_id ### Parameters #### Path Parameters - **user_id** (string) - Required - The ID of the user to retrieve. ### Response #### Success Response (200) - **user** (object) - Contains user details. - **user_id** (string) - The unique identifier for the user. - **name** (string) - The name of the user. - **email** (string) - The email address of the user. #### Response Example ```json { "user": { "user_id": "ou_xxxxxxxxxxxx", "name": "John Doe", "email": "john.doe@example.com" } } ``` ### Error Handling - **404 Not Found**: User not found. - **403 Forbidden**: Insufficient permissions. ``` -------------------------------- ### QueryInstanceReq.Builder Methods Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/approval/v4/model/QueryInstanceReq.Builder.html This section details the methods available on the `QueryInstanceReq.Builder` class for constructing a query request for approval instances. It includes methods for setting the instance search criteria, pagination parameters, and user ID type. ```APIDOC ## QueryInstanceReq.Builder ### Description Provides methods to construct a `QueryInstanceReq` object for querying approval instances. ### Methods #### `instanceSearch(InstanceSearch body)` Sets the instance search criteria. - **body** (InstanceSearch) - Required - The search criteria for instances. #### `pageSize(Integer pageSize)` Sets the page size for the query. - **pageSize** (Integer) - Optional - The number of results to return per page. Example: 10 #### `pageToken(String pageToken)` Sets the pagination token for fetching subsequent pages. - **pageToken** (String) - Optional - The token for the next page of results. Example: "nF1ZXJ5VGhlbkZldGNoCgAAAAAA6PZwFmUzSldvTC1yU" #### `userIdType(QueryInstanceUserIdTypeEnum userIdType)` Sets the user ID type for the query using an enum. - **userIdType** (QueryInstanceUserIdTypeEnum) - Optional - The type of user ID to use. Example: "open_id" #### `userIdType(String userIdType)` Sets the user ID type for the query using a string. - **userIdType** (String) - Optional - The type of user ID to use. Example: "open_id" #### `build()` Builds and returns the `QueryInstanceReq` object. ``` -------------------------------- ### Get all TaskResultCheckOutResultEnum values Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/attendance/v1/enums/TaskResultCheckOutResultEnum.html Use the `values()` method to get an array of all constants in the TaskResultCheckOutResultEnum. This is useful for iterating through all possible checkout results. ```java TaskResultCheckOutResultEnum[] values() ``` ```java for (TaskResultCheckOutResultEnum c : TaskResultCheckOutResultEnum.values()) System.out.println(c); ``` -------------------------------- ### ResumeSource Constructor Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/hire/v1/HireService.ResumeSource.html Initializes a new instance of the ResumeSource class with the provided configuration. Requires a Config object. ```java public ResumeSource(Config config) ``` -------------------------------- ### GET /admin/v1/badge-grants/:badge_grant_id Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/com/lark/oapi/service/admin/v1/AdminService.BadgeGrant.html Retrieves information about a specific badge grant. This endpoint allows you to get details for a particular badge grant. ```APIDOC ## GET /admin/v1/badge-grants/:badge_grant_id ### Description Retrieves information about a specific badge grant. ### Method GET ### Endpoint /admin/v1/badge-grants/:badge_grant_id ### Parameters #### Path Parameters - **badge_grant_id** (string) - Required - The ID of the badge grant to retrieve. ### Response #### Success Response (200) - **data** (object) - The badge grant information. - **badge_grant_id** (string) - The ID of the badge grant. - **user_id** (string) - The ID of the user. - **badge_id** (string) - The ID of the badge. - **grant_time** (string) - The time the badge was granted (ISO 8601 format). - **is_display** (boolean) - Whether the badge is displayed. #### Response Example ```json { "data": { "badge_grant_id": "7109132000000000000", "user_id": "7090000000000000000", "badge_id": "7080000000000000000", "grant_time": "2023-10-26T10:00:00+08:00", "is_display": true } } ``` ``` -------------------------------- ### Core Configuration Methods Source: https://github.com/larksuite/oapi-sdk-java/blob/v2_main/docs/index-all.html Method for setting the HelpDesk token in the core configuration. ```APIDOC ## setHelpDeskToken(String) ### Description Sets the HelpDesk token in the core configuration. ### Method SET ### Endpoint N/A (Configuration method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "helpdesk_token": "string" } ``` ### Response #### Success Response (200) None (This is a setter method) #### Response Example None ```