Hello,
I am using the /rest/api/2/issue API of JIRA. I am successfully able to use Get for below URL
https://futuregroupb.atlassian.net/rest/api/2/issue/LHEL-24
but i get 403 forbidden error on POST with basic authentication which i used in GET method.
The POST method works absolutely fine on curl command.
Please help.
Thanks
Ramneek
If it works with curl, what is different about the call you are making with whatever is failing?
Only the client is different, i fire the Curl command from Linux command line which works fine, but when try to hit the API using the AJAX jquery call (using the same authenticatio), i get 403 forbidden error
attached is my JS File, i have intentionally hidden the password here
I don't know enough about javascript to help you with that, but it must be the call in that trying to do the wrong thing.
Can you please try "data: JSON.stringify(sendInfo)". I am not sure here but you can try.
sorry but it gives me the same error
Also the URL i hitting expects a JSON in the request
What was the solution? I've currently a similar issue in a CORS scenario - so GET's against the API work but a POST to create a new issue throws a 403...
Is anyone having the answers to the questions posted above. I am having the same issue.
I'm sure they discovered that they were not providing the right user details. This is the usual pattern when a discussion about 404's over REST stops with no-one making follow-up comments.
I'm still having this same issue. I don't think user credentials are the issue, as making GET requests, and POST requests via CURL both work fine with the same credentials. Making the call via AJAX for what it's worth. Any ideas?
Has anyone solved this issue? I'm also having the same problem. The curl command works completely fine, however when I try POST method with the same credentials and same datas on my code, it returns 403.
(deleted)
Can you check the scopes object in your atlassian-connect.json file? I ran into this same issue and found out I only had the READ scope by defailt. I added WRITE scope as well and it worked like a champ.
"scopes": [ "READ", "WRITE" ]
Also, be sure to update your script to use the new AP.request method as the one listed above is deprecated. See docs here
Hope that helps!
Thanks, Daniel. I got the same error because of this reason. I added WRITE scope and now It works well.
Hi, I'm also having this issue.
I can make the POST call work in Postman. But when I try to do it as an AJAX call I get a 403 Forbidden error.
Would be great to hear if someone has solved this issue.
Is the payload of your AJAX call identical to the POST?
Yep, I even tried copy & pasting directly out of Postman.
The error just says "403 (Forbidden)". Here's the code below:
var requestBody = {"fields": {"summary": "Kevin Test","description": "Description Test","project": {"id": "13104"},"issuetype": {"id": "7"},"components": [{"id": "20720"}],"customfield_12213": "2019-04-22"}}
var settings = {"async": true,"crossDomain": true,"url": "https://corsBypassURL.com/https://jira.corp.docusign.com/rest/api/2/issue","method": "POST","headers": {"Authorization": "Basic xxxxx=","Content-Type": "application/json","cache-control": "no-cache"},"data": requestBody}$.ajax(settings).done(function (response) {console.log(response);});
Not sure, but you can try passing User-Agent header.
I added
and for me it works well too
Hello @Pavel Naydanov I'm using free cloud server and her is my connect descriptor here. Do you have any suggestion, I'm still getting this error
It looks like you're new here. Sign in or register to get started.