Forums

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

Malformed JSON when using question REST API

Julian Petrich
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 25, 2019

Hi together,

I want to create a question via a web application.

Therefore I wrote a php script with a JSON and send it to the server with the curl function.

For each string in the JSON the failure HTTP 400 - Syntax Error, malformed JSON. Integers work without any problems.

I use this URL as my Mount Point to post the question: /rest/questions/1.0/question

So in my opinion the JSON is completed.

That is my JSON:

//JSON topics array
$jsonTopics = array (
"id"=> 8192017,
"name" => 1234,
"description" => "",
"featured" => false
);

//The JSON data

$jsonData = array(
"title" => "abc",
"body" => "def",
"topics" => $jsonTopics,
"dateAsked" => "2019-06-06",
"spaceKey" => "LMLMLM"
);

 

Thanks to evrybody for any suggestions!!

Please let me know if you need further information or my whole code.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events