1
0
mirror of https://github.com/nextcloud/ocsms.git synced 2026-08-21 21:32:59 +00:00

APIv2 improvements

* prepare a table for messaging sending queue
* drop retrieveAllIdsWithStatus and related API call (unused and dropped from Android app devel version)
* reorganise api controller
This commit is contained in:
Loic Blot
2016-05-12 23:18:25 +02:00
parent d6818be568
commit 1b2a171b89
4 changed files with 91 additions and 80 deletions
+32
View File
@@ -104,6 +104,38 @@
</field>
</declaration>
</table>
<table>
<name>*dbprefix*ocsms_sendmessage_queue</name>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<autoincrement>1</autoincrement>
<length>10</length>
<primary>true</primary>
</field>
<field>
<name>user_id</name>
<type>text</type>
<notnull>true</notnull>
<length>64</length>
</field>
<field>
<name>sms_address</name>
<type>text</type>
<notnull>true</notnull>
<length>64</length>
</field>
<field>
<name>sms_msg</name>
<type>text</type>
<notnull>true</notnull>
<length>2048</length>
</field>
</declaration>
</table>
<table>
<name>*dbprefix*ocsms_config</name>
<declaration>
+2 -2
View File
@@ -31,11 +31,11 @@ $application->registerRoutes($this, array('routes' => array(
array('name' => 'api#push', 'url' => '/push', 'verb' => 'POST'), // Android API
array('name' => 'api#replace', 'url' => '/replace', 'verb' => 'POST'), // Android API
array('name' => 'api#retrieve_all_ids', 'url' => '/get/smsidlist', 'verb' => 'GET'), // Android APIv1
array('name' => 'api#retrieve_all_ids_with_status', 'url' => '/get/smsidstate', 'verb' => 'GET'), // Android APIv1
array('name' => 'api#retrieve_last_timestamp', 'url' => '/get/lastmsgtime', 'verb' => 'GET'), // Android APIv1
// API v2
array('name' => 'api#get_all_stored_phone_numbers', 'url' => '/api/v2/get/phones/numberlist', 'verb' => 'GET'), // Android APIv2
array('name' => 'api#get_all_stored_phone_numbers', 'url' => '/api/v2/phones/list', 'verb' => 'GET'), // Android APIv2
array('name' => 'api#fetch_messages', 'url' => '/api/v2/messages/{start}/{limit}', 'verb' => 'GET'), // Android APIv2
array('name' => 'api#fetch_messages_for_number', 'url' => '/api/v2/messages/{phonenumber}/{start}/{limit}', 'verb' => 'GET'), // Android APIv2
array('name' => 'api#fetch_messages_to_send', 'url' => '/api/v2/messages/sendqueue', 'verb' => 'GET'), // Android APIv2
)));