From 8da282db9866c19705325ec466291f7610f87a29 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Thu, 12 May 2016 23:13:20 +0200 Subject: [PATCH] drop useless createGetSmsIdListWithStateRequest call & api v2 things * rename OC_GET_PHONELIST to OC_V2_GET_PHONELIST * declare OC_V2_GET_MESSAGES * declare OC_V2_GET_MESSAGES_PHONE --- .../owncloud_sms/engine/OCSMSOwnCloudClient.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/fr/unix_experience/owncloud_sms/engine/OCSMSOwnCloudClient.java b/src/main/java/fr/unix_experience/owncloud_sms/engine/OCSMSOwnCloudClient.java index 1c8e12e..1470c97 100644 --- a/src/main/java/fr/unix_experience/owncloud_sms/engine/OCSMSOwnCloudClient.java +++ b/src/main/java/fr/unix_experience/owncloud_sms/engine/OCSMSOwnCloudClient.java @@ -200,17 +200,13 @@ public class OCSMSOwnCloudClient { } public GetMethod createGetPhoneListRequest() { - return createGetRequest(OCSMSOwnCloudClient.OC_GET_PHONELIST); + return createGetRequest(OCSMSOwnCloudClient.OC_V2_GET_PHONELIST); } public GetMethod createGetSmsIdListRequest() { return createGetRequest(OCSMSOwnCloudClient.OC_GET_ALL_SMS_IDS); } - public GetMethod createGetSmsIdListWithStateRequest() { - return createGetRequest(OCSMSOwnCloudClient.OC_GET_ALL_SMS_IDS_WITH_STATUS); - } - public GetMethod createGetLastSmsTimestampRequest() { return createGetRequest(OCSMSOwnCloudClient.OC_GET_LAST_MSG_TIMESTAMP); } @@ -356,7 +352,7 @@ public class OCSMSOwnCloudClient { throw new OCSyncException(R.string.err_sync_http_request_parse_resp, OCSyncErrorType.PARSE); } } - return; + return; } } else if (status == HttpStatus.SC_FORBIDDEN) { @@ -391,12 +387,16 @@ public class OCSMSOwnCloudClient { private Integer _serverAPIVersion; private JSONObject _jsonQueryBuffer; + // API v1 calls private static final String OC_GET_VERSION = "/index.php/apps/ocsms/get/apiversion?format=json"; private static final String OC_GET_ALL_SMS_IDS = "/index.php/apps/ocsms/get/smsidlist?format=json"; - private static final String OC_GET_ALL_SMS_IDS_WITH_STATUS = "/index.php/apps/ocsms/get/smsidstate?format=json"; private static final String OC_GET_LAST_MSG_TIMESTAMP = "/index.php/apps/ocsms/get/lastmsgtime?format=json"; private static final String OC_PUSH_ROUTE = "/index.php/apps/ocsms/push?format=json"; - private static final String OC_GET_PHONELIST = "/index.php/apps/ocsms/get/phones/numberlist?format=json"; + + // API v2 calls + private static final String OC_V2_GET_PHONELIST = "/index.php/apps/ocsms/api/v2/phones/list?format=json"; + private static final String OC_V2_GET_MESSAGES ="/index.php/apps/ocsms/api/v2/messages/[START]/[LIMIT]?format=json"; + private static final String OC_V2_GET_MESSAGES_PHONE ="/index.php/apps/ocsms/api/v2/messages/[PHONENUMBER]/[START]/[LIMIT]?format=json"; private static final String TAG = OCSMSOwnCloudClient.class.getSimpleName();