JIRA Service Desk REST Api Android Client when try to add comment or attachment


I try to create Android app for Jira Service Desk and having problems with create attachment or comment - returned status : BasicNetwork.performRequest: Unexpected response code 403 for

. There are no problems with login or get list of issues, projects ect. 

After few days I have no idea where is the problem. 

I'm using Volley library to comunicating with jira rest. First step of creating attachment - create temprorary attachment returns status 201 - ok, and Json response with temp attachment id. 

It's my code here for creating attachment, can anyone help?:

public void makeAttachmentVisible(final VolleyCallback volleyCallback, final JSONObject jsonObject){
queryObject= new JSONObject();
JSONArray queryArray = new JSONArray();

try {
JSONArray jsonArray = jsonObject.getJSONArray("temporaryAttachments");
for(int i =0; i<jsonArray.length(); i++){
String id = (String) jsonArray.getJSONObject(i).get("temporaryAttachmentId");
} catch (JSONException e) {
try {
JSONObject jsonObject1 = new JSONObject();

} catch (JSONException e) {

JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST, MAKE_FILE_VISIBLE, queryObject, new Response.Listener<JSONObject>() {
public void onResponse(JSONObject response) {

}, new Response.ErrorListener() {
public void onErrorResponse(VolleyError error) {
VolleyError volleyError = (VolleyError) error;
// NetworkResponse response = error.networkResponse;

public Map<String, String> getHeaders() throws AuthFailureError {
Map<String,String> headers = new HashMap<>();
headers.put("X-ExperimentalApi", "true");
headers.put("X-Atlassian-Token", "nocheck");
// headers.put("X-AUSERNAME","test");
return headers;



0 answers

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

415 views 1 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot