Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 4.66 KB

File metadata and controls

62 lines (43 loc) · 4.66 KB

Client.Messages

Overview

Available Operations

retrieve

Retrieves list of messages from messaging/chat datasources (e.g. Slack, Teams).

Example Usage

package hello.world;

import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.*;
import com.glean.api_client.glean_api_client.models.operations.MessagesResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        MessagesResponse res = sdk.client().messages().retrieve()
                .messagesRequest(MessagesRequest.builder()
                    .idType(IdType.CONVERSATION_ID)
                    .id("<id>")
                    .datasource(Datasource.GCHAT)
                    .build())
                .call();

        if (res.messagesResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
locale Optional<String> The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
messagesRequest MessagesRequest ✔️ Includes request params such as the id for channel/message and direction.

Response

MessagesResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*