Update API to change media description

This commit is contained in:
stom79 2017-10-27 10:54:28 +02:00
parent d320d54416
commit e2347ac1d5
1 changed files with 36 additions and 0 deletions

View File

@ -1299,6 +1299,42 @@ public class API {
}
/**
* Changes media description
* @param mediaId String
* @param description String
* @return Attachment
*/
public Attachment updateDescription(String mediaId, String description){
RequestParams params = new RequestParams();
params.put("description", description);
post(String.format("/media/%s", mediaId), 240000, params, new JsonHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
attachment = parseAttachmentResponse(response);
}
@Override
public void onSuccess(int statusCode, Header[] headers, JSONArray response) {
try {
attachment = parseAttachmentResponse(response.getJSONObject(0));
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public void onFailure(int statusCode, Header[] headers, Throwable error, JSONObject response){
setError(statusCode, error);
}
@Override
public void onFailure(int statusCode, Header[] headers, String message, Throwable error){
setError(statusCode, error);
}
});
return attachment;
}
/**
* Retrieves Accounts and feeds when searching *synchronously*
*