简体   繁体   中英

AWS API Gateway get Api key

I'm trying to get the actual key from an API Key in "API Keys" of API Gateway.

AmazonApiGateway client = AmazonApiGatewayClientBuilder.standard().withRegion("my region").build();

GetApiKeysRequest req = new GetApiKeysRequest();        
GetApiKeysResult keys = client.getApiKeys(req);

ApiKey key = keys.getItems().get(0); // just get the first one.. 

System.out.println(key.getId());
System.out.println(key.getName());
System.out.println(key.getValue());

Was hoping getValue() would provide the actual key, but it's null..

确保将includeValues设置为true

req.setIncludeValues(true);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM