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: 

Invalid request payload. Refer to the REST API

rbt teresa
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!
September 13, 2022

Error invalid request payload refer to the REST API when creating a issue

const bodyData =
    `"fields": {
       "project":
       {
          "key": "PRB"
       },
       "summary": "REST ye merry gentlemen.",
       "description": "Creating of an issue using project keys and issue type names using the REST API",
       "issuetype": {
          "name": "Bug"
       }
   }`;

    method: 'POST',
    headers: {
        'Authorization': `Basic ${Buffer.from(
            'email@gmail.com:token'
        ).toString('base64')}`,
        'Accept': 'application/json',
        'Content-Type': 'application/json'
    },
    body: bodyData
}).then(response => {
        console.log(
            `Response: ${response.status} ${response.statusText}`
        );
        return response.text();
    }).then(text => console.log(text)).catch(err => console.error(err));


2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
lasse.jokinen
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!
January 13, 2023

Bodydata is not valid JSON, it is missing { at start

0 votes
Israel Lemes
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!
October 12, 2022

Hi, did you solve this issue?

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events