Attach temporary file status 400 "No attachments found"

Jefferson Fabrin Puntim
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!
March 9, 2021

Hello guys! 

I'm trying to attach a temporary file on a request by using SD API but I keeping getting this error: STATUS 400 "No attachments found".

I'm testing with Insomnia, here is my code:

var axios = require("axios").default;

var options = {
method: 'POST',
url: 'https://test.atlassian.net/rest/servicedeskapi/servicedesk/1/attachTemporaryFile',
headers: {
Accept: 'application/json',
'X-Atlassian-Token': 'no-check',
'Content-Type': 'multipart/form-data; boundary=--------------------------335922374049255354550076',
Authorization: 'Basic'
},
data: 'Y29uc3QgYXhpb3MgP..........................................
};

axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});

 

Note: if i remove the code 'boundary =....'  I getting the error: "Status 500 no multipart boundary was found"

1 answer

0 votes
Italo Qualisoni [e-Core]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2021

Suggest an answer

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

Atlassian Community Events