Got an error while try to add comment using REST API

Hai all,
When i try to add comment to the issue using Rest API in forge custom UI app, I got 400 error.

var bodyData = {
                    "visibility": {
                        "type": "role",
                        "value": "Administrator"
                    },
                    "body": {
                        "version": 1,
                        "type": "doc",
                        "content": [
                          {
                            "type": "paragraph",
                            "content": [
                              {
                                "type": "text",
                                "text": "Sample test comment"
                              }
                            ]
                          }
                        ]
                    }
                };
                const response1 = await api.asApp().requestJira('/rest/api/3/issue/issue_id/comment', {
                    method: 'POST',
                    headers: {
                        'Accept': 'application/json',
                        'Content-Type': 'application/json'
                    },
                    body: bodyData
                });
                console.log(`Response: ${response1.status} ${response1.statusText}`);
                console.log(await response1.json());

And i got

{
errorMessages: [
‘Can not deserialize instance of com.atlassian.jira.issue.fields.rest.json.beans.CommentJsonBean out of START_ARRAY token\n’ +
’ at [Source: org.apache.catalina.connector.CoyoteInputStream@5b860783; line: 1, column: 1]’
]
}

What’s wrong in my code? Kindly share your answers.

Thanks in Advance…

Hi,
you should stringify bodyData in the same way as with Fetch API:

const response1 = await api.asApp().requestJira('/rest/api/3/issue/issue_id/comment', {
                    method: 'POST',
                    headers: {
                        'Accept': 'application/json',
                        'Content-Type': 'application/json'
                    },
                    body: JSON.stringify(bodyData)
                });