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

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?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events