/// <summary> /// This function makes API call to get message /// </summary> public MessageObj.Message getMessage(string messageId) { APIRequest apiRequest = new APIRequest("messages/" + messageId); apiRequest.accept = "application/json"; if (apiService.get(apiRequest)) { var message = new MessageObj(); return(message.deserializeMessageObj(apiService.apiResponse.getResponseData())); } throw new Exception(apiService.errorResponse); }
/// <summary> /// This function makes API call to get message list /// </summary> public MessageObj.MessageList getMessageList(string limit, string offset) { if (String.IsNullOrEmpty(limit)) { limit = "500"; } if (String.IsNullOrEmpty(offset)) { offset = "50"; } APIRequest apiRequest = new APIRequest("messages?limit=" + limit + "&offset=" + offset); apiRequest.accept = "application/json"; if (apiService.get(apiRequest)) { var message = new MessageObj(); return(message.deserializeMessageListObj(apiService.apiResponse.getResponseData())); } throw new Exception(apiService.errorResponse); }