AWS API Gateway получает ключ API - PullRequest
0 голосов
/ 31 мая 2018

Я пытаюсь получить фактический ключ из API-ключа в «API-ключах» API-шлюза.

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());

Надеялся, что getValue () предоставит фактический ключ, но это ноль ..

1 Ответ

0 голосов
/ 31 мая 2018

Убедитесь, что вы устанавливаете includeValues ​​ в true:

req.setIncludeValues(true);
...