The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

get Alerts or Count alerts returning funny characters, not JSON

Kara Dávid
July 6, 2021

Hi experts,

 

I'm trying to access the alertlist from Microfocus Service Manager. I'm using javascript to do that. Certificates and all the proxy stuff checks out by now but I'm still strugling with the response:

I'm starting with a basic count alerts request:

var url = "https://api.eu.opsgenie.com/v2/alerts/count";

I obviously add the Authentication header and the Content type part...

headers.push( new Header( "Content-Type", "application/json; charset=UTF-8" ) );

printing the response results in something like this:

receiveData:≻慤慴㨢≻潣湵≴㘺㈷㜳ⱽ琢潯≫〺〮㤰∬敲畱獥䥴≤∺づ愶㈴㥢戭晣ⴸ㠴㔴愭昰ⴷ戶攵〷㡡㍢㑥索

Last time I saw something like this the response was compressed (gzip). I don't see anything refering to deflate of gzip in the documentation, everythings like a fairy tail there.

Any help apprichiated!

BR,

Dávid

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Kara Dávid
July 6, 2021

Ok, solved:

For the other fellow SM developers : the doHTTPRequest has an argument (Binary response data) : I don't even know why I've set it to true but that seemed to be the problem. Just set it to false and the response is in clear JSON string format.

0 votes
Kara Dávid
July 6, 2021

20210706 opsgenie01.jpg

Chris Thomas
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 7, 2021

Can I ask what program you are using in this screenshot?

Deleted user
July 22, 2021
öcs
July 24, 2021

That is correct.

TAGS
AUG Leaders

Atlassian Community Events