Skip to content

Latest commit

 

History

History
58 lines (38 loc) · 4.83 KB

File metadata and controls

58 lines (38 loc) · 4.83 KB

Entities

Overview

Available Operations

getPersonPhoto

Returns the profile photo bytes for a person whose photo is stored in Glean (crawled from an identity source or user-uploaded via admin console). Photos hosted externally (e.g. Slack CDN) are not served by this endpoint; callers should follow the photoUrl from /people or /listentities directly. Responses include a Cache-Control header (max-age=3600) to reduce redundant fetches.

Example Usage

package hello.world;

import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.operations.GetPersonPhotoResponse;
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();

        GetPersonPhotoResponse res = sdk.entities().getPersonPhoto()
                .personId("<id>")
                .call();

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

Parameters

Parameter Type Required Description
personId String ✔️ The obfuscated ID of the person whose photo to retrieve.
ds Optional<String> Optional datasource override for crawled photos (e.g. AZURE, GDRIVE, OKTA). When omitted, the datasource is derived from the person's stored photo URL or the deployment's primary person datasource.

Response

GetPersonPhotoResponse

Errors

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