Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

api request error status:404, statusText:Not Found

Mai Nakagome August 12, 2022
Hi.
I am using forge api to get infomation about creen schemes in Forge custom UI development.
With the code below, I get error code 404, status text says 'Not Found'.
let paramStr = '';
if (screenSchemeIds.length < 2) {
    paramStr = screenSchemeIds[0];
} else {
    paramStr = screenSchemeIds.join('&id=');
}
// paramStr should be like '10004&id=10005'

// getting new screen schemes based on the parameters defined above
const screenResponse = await api.asApp().requestJira(route`/rest/api/3/screenscheme?id=${paramStr}`, {
    headers: {
        'Accept': 'application/json'
    }
});

return screenResponse.status + screenResponse.statusText;
When I just hard-code like the code below, I receive an expected result.
const screenResponse = await api.asApp().requestJira(route`/rest/api/3/screenscheme?id=10004&id=10005`, {
    headers: {
        'Accept': 'application/json'
    }
});

return screenResponse.status + screenResponse.statusText;
Could anyone tell me how to fix the first code?

0 answers

Suggest an answer

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

Atlassian Community Events