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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

"Bad request" 400 error on attempt to send a message using Stride API

Hello!

I am trying to send a message to a Stride conversation through API. Here is the request payload I send:

{
"version" : 1,
"type" : "doc",
"content" : [ {
"type" : "paragraph",
"content" : [ {
"type" : "text",
"text" : "Admin Adminovich created "
}, {
"type" : "text",
"text" : "TST-20",
"marks" : [ {
"type" : "code"
}, {
"type" : "link",
"attrs" : {
"href" : "http://localhost:2990/jira/browse/TST-20"
}
} ]
} ]
}, {
"type" : "applicationCard",
"attrs" : {
"text" : "TST-20: asdfasdf",
"title" : {
"text" : "TST-20: asdfasdf"
},
"content" : {
"text" : "TST",
"icon" : {
"label" : "TST",
"url" : "default.svg"
}
},
"link" : {
"url" : "http://localhost:2990/jira/browse/TST-20"
}
}
} ]
}

Here is the response I get:

{
"statusCode": 400,
"message": "Document field doc JSON doesn't comply with Atlassian Document Format",
"meta": {
"errors": [
{
"column": 7,
"error": "Property content is not expected to be here",
"line": 30
}
]
}

I cannot understand why it wines about "content" element? I formed my message according to the Atlassian Document Structure described here: https://developer.atlassian.com/cloud/stride/apis/document/nodes/applicationCard/ 

2 answers

0 votes
lauren Atlassian Team Jan 08, 2018

Hi Michael!

Would you mind posting this question in the developer community? 

I can't help much with questions like these. 

The developer community is located here.

Oh, I finally found a typo in my JSON... There should be a "context" instead of "content". My bad =) With "context" everything if working as expected.

lauren Atlassian Team Jan 09, 2018

haha oh cool, glad to hear it :) 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Stride

Stride and Hipchat Cloud have reached End of Life (updated)

All good things come to an end - thanks to all our customers and partners who have been along the Hipchat and Stride journey with us.  As of Feb 15th 2019, Hipchat Cloud and Stride have reached ...

2,421,878 views 26 26
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