Lookup Credential Token
const url = 'https://example.com/iam/v1/users:lookupCredentialToken';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"credential_token":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/iam/v1/users:lookupCredentialToken \ --header 'Content-Type: application/json' \ --data '{ "credential_token": "example" }'Resolves a live single-use credential token to the identity behind it and says which KIND of token it is, so a client holding a bare token can show the right page — an activation link and a recovery link are indistinguishable as strings.
Anonymous and read-only: it never consumes the token. POST rather than GET so the token travels in the body and never lands in an access log, a proxy’s request line, or a browser history entry.
Request Body required
Section titled “Request Body required ”LookupCredentialTokenRequest
Request message for LookupCredentialToken.
object
The one-time credential token to resolve, of either kind. Not consumed by this call.
Example generated
{ "credential_token": "example"}Responses
Section titled “ Responses ”OK
LookupCredentialTokenResponse
The identity behind a live credential token, and which kind of token it is.
Full identity is deliberate: whoever holds the token IS the person, so masking their own email would protect nothing while making the confirmation screen useless. Every dead token answers NOT_FOUND uniformly, so the response is never an oracle for which tokens once existed.
object
The person’s email address.
The person’s given name.
The person’s family name.
When the token stops being usable.
Which kind of token this is, and therefore which redemption call accepts it: ACTIVATION for :activate, PASSWORD_RESET for :completePasswordReset.
Example
{ "type": "CREDENTIAL_TOKEN_TYPE_UNSPECIFIED"}default
Section titled “default ”Default error response
The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the API Design Guide.
object
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
A list of messages that carry the error details. There is a common set of message types for APIs to use.
Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.
object
The type of the serialized message.
Example generated
{ "code": 1, "message": "example", "details": [ { "@type": "example" } ]}