[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-26 UTC."],[[["\u003cp\u003eThis document describes how to retrieve the encrypted and signed value of an API key using a GET request to the specified URL, which uses gRPC Transcoding syntax.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires a \u003ccode\u003ename\u003c/code\u003e path parameter that identifies the API key resource, and the request body must be empty.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful requests will return a response containing a \u003ccode\u003ekeyString\u003c/code\u003e field, which holds the encrypted and signed value of the API key.\u003c/p\u003e\n"],["\u003cp\u003eTo perform this action, you need the \u003ccode\u003eapikeys.keys.getKeyString\u003c/code\u003e IAM permission on the specified resource \u003ccode\u003ename\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization for this action requires one of two OAuth scopes: \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform.read-only\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.keys.getKeyString\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.GetKeyStringResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [IAM Permissions](#body.aspect_1)\n- [Try it!](#try-it)\n\nGet the key string for an API key.\n\nNOTE: Key is a global resource; hence the only supported value for location is `global`.\n\n### HTTP request\n\n`GET https://apikeys.googleapis.com/v2/{name=projects/*/locations/*/keys/*}/keyString`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nResponse message for `keys.getKeyString` method.\n\nIf successful, the response body contains data with the following structure:\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-platform.read-only`\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp).\n\n### IAM Permissions\n\nRequires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:\n\n- `apikeys.keys.getKeyString`\n\nFor more information, see the [IAM documentation](https://cloud.google.com/iam/docs)."]]