I want to integrate third party application into jira using OAuth 2.0(3LO).And I have retrieved Access token and cloud id.With the above values I tried to retrieve list of projects, but I am getting 403 Forbidden error and my code is
URL url = new URL("https://api.atlassian.com/ex/jira/{cloud-id}/rest/api/3/project");
HttpURLConnection http1 = (HttpURLConnection) url.openConnection();
http1.setRequestProperty("Authorization","Bearer <access_token>");
http1.setRequestProperty("Content-Type", "application/json");
http1.setRequestProperty("Accept", "application/json");
And I also I want to know,I have to use the same access token which was created by using this second point(Exchange authorization code for access token) of this link: https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/
Could anyone help me to solve this?