Bbox Voicemail API
Experimental Java/Android client library for unofficial Bbox VoiceMail API
Most of these API are using web scraping. Page content may change in the future so it can be deprecated at any time. Create an issue if you notice something broken.
API List
description | api |
---|---|
get welcome message | getWelcomeMessage(int id, String fileDest) |
upload welcome message | uploadWelcomeMessage(String filePath, int messageId, int selectedId) |
set dual call state | setDualCallState(DualCallState state) |
set incognito mode | setIncognitoMode(IncognitoState state) |
set SMS notification | setVoiceMailSMS(NotifState voiceMail, NotifState missedCall, String number) |
set voiceMail state | setVoiceMailState(VoiceMailState state, int ringNumber) |
set welcome message state | setWelcomeMessageState(WelcomeMessageState state) |
Note: If you need to list voicemail, read voicemail, get voicemail URL, forward call, use official Bbox Router API with Java/Android client for Bbox Router API
All APIs need authentication via :
VoiceMailApi api = new VoiceMailApi();
api.login("[email protected]", "password");
This will only work with your @bbox
account (no such service for mobile)
Include into your project
- with Gradle, from JCenter or MavenCentral :
compile 'fr.bmartel:bboxapi-voicemail:1.0.0'
Usage
Get welcome message
This will store the welcome message to a local file. The following will store the welcome message with id 1 under /home/user/message.wav
:
api.getWelcomeMessage(1, "/home/user/message.wav");
Upload welcome message
The following will upload /home/user/message2.mp3
as the welcome message with id 2 and select the welcome message with id 2 :
api.uploadWelcomeMessage("/home/user/message2.mp3", 2, 2);
Set dual call state
api.setDualCallState(DualCallState.ENABLE);
Set incognito mode
api.setIncognitoMode(IncognitoState.DISABLE);
Set SMS notification
enable SMS notification to specified phone number on new voicemail and on missed call :
api.setVoiceMailSMS(NotificationState.ENABLE, NotificationState.ENABLE, "0123456789");
Set voicemail state
enable/disable voicemail and set the ring number (default 5)
api.setVoiceMailState(VoiceMailState.ENABLE, 5);
Set welcome message state
enable/disable welcome message :
api.setWelcomeMessageState(WelcomeMessageState.ENABLE);
Other APIs
For reference, the following API are implemented :
description | api |
---|---|
get voicemail list | getVoiceMailList() |
delete voicemail | deleteVoiceMail(int id) |
get user info | getCustomerInfo() |
forward call | setCallForwarding(CallForwardType type, String phoneNumber) |
Don't use these API above, use official Bbox Router API instead with Java/Android client for Bbox Router API
Get voicemail list
VoiceMailResponse voiceMailResponse = api.getVoiceMailList();
if (voiceMailResponse.getStatus() == HttpStatus.OK) {
List<VoiceMail> voiceMailList = voiceMailResponse.getVoiceMailList();
}
Delete voicemail
api.deleteVoiceMail("1234567");
Get user info
api.getCustomerInfo();
Forward call
disable forward call
api.setCallForwarding(CallForwardType.DISABLE, "");
forward all call to voicemail :
api.setCallForwarding(CallForwardType.ALL_TO_VOICEMAIL, "");
forward all call to phone number :
api.setCallForwarding(CallForwardType.ALL_TO_NUMBER, "0123456789");
forward unanswered call to phone number :
api.setCallForwarding(CallForwardType.UNANSWERED_CALL_TO_NUMBER, "0123456789");
forward call to phone number when line is occupied :
api.setCallForwarding(CallForwardType.LINE_OCCUPIED_TO_NUMBER, "0123456789");
forward call to pĥone number when line is unavailable :
api.setCallForwarding(CallForwardType.LINE_UNAVAILABLE_TO_NUMBER, "0123456789");
Android integration
- add
bboxapi-voicemail
&httpcomponents
lib depedency tobuild.gradle
:
compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
compile 'fr.bmartel:bboxapi-voicemail:1.0.0'
- add Internet permission to manifest :
<uses-permission android:name="android.permission.INTERNET" />
- proguard config (keep model & response packages) :
-keep class fr.bmartel.bboxapi.voicemail.model.** { *; }
-keep class fr.bmartel.bboxapi.voicemail.response.** { *; }
External Library
License
The MIT License (MIT) Copyright (c) 2017 Bertrand Martel