1

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..

1 Answer 1

3

Make sure you're setting includeValues to true:

req.setIncludeValues(true);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.