Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,551,979
Community Members
 
Community Events
184
Community Groups

[NEVER MIND] Java SDK: "Key format is not valid"

Edited

I was getting an invalid value for the key. My bad! Please ignore this!

 

I'm trying to create an alert using the Java SDK.  I've followed the guide for setting the API key, trying all sorts of permutations:

OpsGenieClient client = new OpsGenieClient();

...

client.setApiKey(myKey);

or

client.setApiKey(base64Encode(myKey));

or

client.setApiKey(base64UrlEncode(myKey));

or using

alertApi = client.alertV2();

...

alertApi.getApiClient().setApiKey(myKey);

or the same variations as above passing the base 64 encoded or base 64 URL encoded key to alertApi.getApiClient().setApiKey(...);

 

No matter what I try, I always get the same result:

com.ifountain.opsgenie.client.swagger.ApiException: 
{
"message": "Key format is not valid!",
"took": 0.001,
"requestId": "7ef9d057-8b49-4264-ad70-e79a14a3e1cb"
}

 What am I doing wrong??

1 answer

0 votes
Samir
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Nov 11, 2021

Hi @Sam Peretz ,

 

Are you still having issues with this? This section details the 2 different ways you can set-up the apiKey. You will want to get an api Key from an API integration in Opsgenie.

 

Let us know if you're still running into issues!

 

Thanks,

Samir

Thanks @Samir, I'm all set. As mentioned in my update to the question (at the topic), I was just doing something dumb -- I was getting the API key from AWS SSM Parameter Store and wasn't setting the decryption option correctly, so I was using the encrypted value I was getting back from that call, which of course was not a valid API key! :O  It's working great now.

Like Steffen Opel _Utoolity_ likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events