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
1,185 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

How to Use Amazon AWS Credentials to Access/Query Tables in AWS RDS Instance through Mobile App

You should make your backend functions to ...READ MORE

answered Aug 28, 2018 in AWS by Priyaj
• 58,020 points
1,341 views
+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,795 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
948 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,574 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