Trying to use GetApiKeys in Amazon SDK

0 votes

Trying to get the total count of api keys in my API gateway through SDK. Also, I am unsure of the proper implementation of the parameters that the GetApiKeysRequest takes in. 

My main objective is to get the count of all API keys that are already existing for my account.

The code goes this way:

class Program
{
    public static void Main(string[] args)
    {
        var awsUserAccessKey = "xxxxx";

        var awsUserSecretKey = "yyyyyyyyyyy";

        var regionEndpoint = "us-west-2";

        var keysInRepository = new GetApiKeysRequest
        {
            CustomerId = "",
            IncludeValues = true||false,
            Limit=0,
            NameQuery = "",
            Position = ""
        };


        var client = new AmazonAPIGatewayClient(awsUserAccessKey, awsUserSecretKey, regionEndpoint);

        var apiKeys =client.GetApiKeys(keysInRepository);

        Console.Read();
    }
}

This same code gives an error. The security token in this request is invalid (Amazon.APIGateway exception).

I am not sure about how to set the parameters for this request.

Jun 12, 2018 in AWS by Flying geek
• 3,280 points
916 views

1 answer to this question.

0 votes

Try using this one: 

var client = new AmazonAPIGatewayClient(awsUserAccessKey, awsUserSecretKey, RegionEndpoint.USWest2);


Because AmazoneGatewat takes three string arguments and your last argument is awsSessionToken I think you're using wrong arguments here 
answered Jun 12, 2018 by Cloud gunner
• 4,670 points

Related Questions In AWS

+2 votes
1 answer
+1 vote
0 answers
0 votes
1 answer

Trying to Determine Amazon EC2 instance creation date/time

You can't find as such attribute called ...READ MORE

answered May 29, 2018 in AWS by Flying geek
• 3,280 points
9,338 views
0 votes
1 answer

How to upload a lib for Tomcat in Amazon EC2?

You need to set the proper privileges ...READ MORE

answered Aug 20, 2018 in AWS by Archana
• 4,170 points
714 views
0 votes
1 answer
0 votes
1 answer
+2 votes
3 answers
+1 vote
1 answer
0 votes
1 answer

Trying to upload data stream in Amazon S3

Try adding the ContentType & ACL in ...READ MORE

answered Jun 28, 2018 in AWS by Cloud gunner
• 4,670 points
2,350 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP