1
在我的應用程序中使用Zendesk API
與客戶進行交互。高達3個月前,我們的支持團隊收到了郵件(Zendesk
門票)。但現在我們正在升級Zendesk API 2
。 像下面Zendesk郵票失敗,422 | Android中的不可處理實體
https://<domain>.zendesk.com/api/v2/tickets.json
的問題是隻有老客戶的門票不饒人,但新用戶/客戶的票都沒有得到。 我正在連接如響應代碼爲422 - 無法處理的實體
HttpURLConnection connection = client.open(new URL(encoded_url));
connection.setRequestMethod("POST");
if (null != contentType) connection.addRequestProperty("Content-type", "application/json");
// Write the request.
out = connection.getOutputStream();
out.write(data.getBytes("UTF-8"));
out.close();
final int statusCode = connection.getResponseCode();
if (statusCode >= HttpURLConnection.HTTP_BAD_REQUEST) {
onComplete.execute(false, statusCode + "|" + connection.getResponseMessage() + "|" + encoded_url, "Error " + statusCode + " while retrieving data from " + encoded_url + "\nreason phrase: " + connection.getResponseMessage());
return;
}
// Read the response.
in = connection.getInputStream();
byte[] response = readFully(in);
能否請您幫助..
可能重複[在Zendesk中創建票證時發生[422錯誤]](http://stackoverflow.com/questions/22867369/422-error-when-creating-a-ticket-in-zendesk) –