HttpResponse<JsonNode> response = Unirest.get("/rest/api/3/applicationrole") .basicAuth("email@example.com", "<api_token>") .header("Accept", "application/json") .asJson(); System.out.println(response.getBody());
<!-- https://mvnrepository.com/artifact/com.mashape.unirest/unirest-java --><dependency><groupId>com.mashape.unirest</groupId><artifactId>unirest-java</artifactId><version>1.4.9</version></dependency>
Hello @Manjeet_Chaudhary ,
Welcome to the Atlassian Community!
If I understand correctly you are trying to use Unirest-Java (http://kong.github.io/unirest-java/) to send REST API requests to Jira Core Cloud, but something is not working. Is this correct?
If this is correct, could you let us know what is not working exactly?
I am asking this since, looking at the provided code, it seems you are just using the sample data from the REST API documentation for /rest/api/3/applicationrole endpoint:
HttpResponse<JsonNode> response = Unirest.get("/rest/api/3/applicationrole") .basicAuth("email@example.com", "<api_token>")
However, please notice that is just an example and therefore in your code you should replace the sample values with the real one.
Specifically:
HttpResponse<JsonNode> response = Unirest.get("https://<YOUR_SITE_NAME>.atlassian.net/rest/api/3/applicationrole")
.basicAuth("maxxxxxxxxx88@gmail.com", "loxxxxxxxxxxxxxxxxxxD5")
For details on how to generate an Api Token for your user, please see:
Cheers,Dario
It looks like you're new here. Sign in or register to get started.