Can't associate AppKey with API Products using Java Apigee SDK

I’m trying to associate AppKey with ApiProduct using the Apigee API Client Library for Java (v1-rev20240617-2.0.0)

To do that I’m trying to use either this or this method.

Unfortunately, each time I try to execute this request I get

"message": "Request contains an invalid argument.",
  "status": "INVALID_ARGUMENT"

Without any additional information about which argument is invalid

If I use the “Try this method” feature from the documentation and perform the same request I get 200 and no error.

I tried to analyze Logs Explorer logs, and invalid and correct requests had the same request body and path.

Steps to reproduce for generateKeyPairOrUpdateDeveloperAppStatus() (using the SDK):
  1. Create a Developer

  2. Create an App

  3. Request generateKeyPairOrUpdateDeveloperAppStatus() and put List of API Products in the request body

Steps to reproduce for updateDeveloperAppKey() (using the SDK):
  1. Create a Developer

  2. Create an App

  3. Create key

  4. Request updateDeveloperAppKey() with list of API products in the request

1 Like

Hello, I am facing this same issue. Have you managed to solve this issue ? Thanks!

Not really, eventually for this case I just called the API directly bypassing SDK and it worked

Please take a look at what I posted here.

https://www.googlecloudcommunity.com/gc/Apigee/Unable-to-associate-DeveloperAppKey-with-API-Products-using/m-p/802502#M80429

1 Like