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,300,916
Community Members
 
Community Events
165
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 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
Community showcase
Published in Jira Service Management

Improving the Create Issue Experience in Jira Service Management Cloud

Hello everyone!  We are very excited to announce some much needed changes to the issue create experience in JSM (the blue "create" button) at the top of the screen.  We have just starte...

225 views 10 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you