Unable to call AWS API Gateway resources/methods through .Net Core using C#

Viewed 225

I keep on getting the exception:

"Invalid API identifier specified".

I have double checked the keys on my AWS console and even generated a new API just to be sure for testing purposes but I keep on getting this. Below is my code.

I am able to get the account details correctly, but that's about it.

For any other call like GetModelAsync, GetResourceAsync, GetRestAPIAsync etc. , I keep on getting this exception even after entering the correct keys and ids.

Would love some guidance if someone has faced a similar issue before, documentation seems limited. AWS has dedicated Gateway API SDKs for Java, JS etc. but support seems to be limited for dot net as of now.

https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-generate-sdk.html

I am using dot net core 3.1.0. Below is my code:

// making the credentials object using the proper access and secret key.
var awsCredentials = new BasicAWSCredentials(accessKey, secretKey);

// getting a client object using the credentials
var apiClient = new AmazonAPIGatewayClient(awsCredentials);

var accountRequest = new Amazon.APIGateway.Model.GetAccountRequest();
var account = await apiClient.GetAccountAsync(accountRequest);
0 Answers
Related