Skip to main content

KeyGet

Returns the API key information for a specified user.

:::caution Established API The SOAP API is in maintenance mode. For new integrations use the REST equivalent. :::

Method Signature

KeyIDInfo KeyGet(string SessionID, int UserID)

Parameters

ParameterTypeRequiredDescription
SessionIDstringYesActive session token from Login()
UserIDintYesID of the user whose API key to retrieve

Response Object — KeyIDInfo

FieldTypeDescription
KeyIDintUnique identifier for this API key record
UserIDintID of the user that owns this key
KeystringThe API key string value
VisibilityKeyVisibilityScope of visibility for this key
CreateddatetimeDate and time the key was created
<!-- Example response XML -->
<KeyIDInfo>
<KeyID>1042</KeyID>
<UserID>5001</UserID>
<Key>abc123def456ghi789jkl012mno345pq</Key>
<Visibility>Private</Visibility>
<Created>2025-01-15T08:30:00</Created>
</KeyIDInfo>

ENUMs

KeyVisibility

ValueDescription
PrivateKey is accessible only to the owning user
SharedKey is shared within the mailbox or network
PublicKey is publicly visible
SessionKey is valid only for the current session

Code Examples

// .NET 10 — dotnet-svcutil generated proxy
// Retrieve the API key record for a specific user
var keyInfo = await client.KeyGetAsync(sessionID, userId);

Console.WriteLine($"Key ID: {keyInfo.KeyID}");
Console.WriteLine($"Key: {keyInfo.Key}");
Console.WriteLine($"Visibility: {keyInfo.Visibility}");
Console.WriteLine($"Created: {keyInfo.Created:yyyy-MM-dd}");

REST Equivalent

See Get KeyPOST /v2/keys/get-key.