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,160 points
85 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,280 points

Related Questions In AWS

+1 vote
1 answer
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,160 points
2,326 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,090 points
46 views
0 votes
1 answer

How to Use hypen as key name in dynamo db mapper

It seems you cannot have a column ...READ MORE

answered Aug 22, 2018 in AWS by Priyaj
• 56,900 points
151 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,280 points
377 views