Package: darbird
darbird-pythonThe SDK provides convenient access to the Darbird APIs to python apps.DocumentationTake a look at theAPI docs here.Install$pipinstalldarbird# python 2.7.xOR

$python-mpipinstalldarbird# python 2.7.xOR

$pip3installdarbird# python 3.6.xOR

$python3-mpipinstalldarbird# python 3.6.xUsageThe package needs to be configured with your app username and API key, which you can get from thedashboard.Your receipent number must be in an International Number example (+234xxxxxxxxxx)# import packageimportdarbird# Initialize SDKusername="YOUR_USERNAME"# use 'sandbox' for development in the test environmentapi_key="YOUR_API_KEY"# use your sandbox app API key for development in the test environmentdarbird.initialize(username,api_key)# Initialize a service e.g. SMSsms=darbird.SMS# Use the service synchronouslyresponse=sms.send("Hello Message!",["+2547xxxxxx"])print(response)# Or use it asynchronouslydefon_finish(error,response):iferrorisnotNone:raiseerrorprint(response)sms.send("Hello Message!",["+2547xxxxxx"],callback=on_finish)Seeexamplefor more usage examples.InitializationInitialize the SDK by callingdarbird.initialize(username, api_key). After initialization, you can get instances of offered services as follows:SMS:darbird.SMSVoice:darbird.VoiceMMS:darbird.MMSAuthy:darbird.AuthySmssend(message: str, recipients: str, sender_id: str = None, enqueue: bool = False): Send a message.message: SMS content.REQUIREDrecipients: Phone numbers.REQUIREDsender_id: Shortcode or alphanumeric ID that is registered with your Darbird account.enqueue: Set totrueif you would like to deliver as many messages to the API without waiting for an acknowledgement from telcos.sendschedule(message: str, recipients: str, schedule: str, sender_id: str = None, enqueue: bool = False)): Send a premium SMSmessage: SMS content.REQUIREDrecipients: An array of phone numbers.REQUIREDschedule: Date like this format: m/d/Y h:i A.REQUIREDsender_id: Shortcode or alphanumeric ID that is registered with your Darbird account.enqueue: Set totrueif you would like to deliver as many messages to the API without waiting for an acknowledgementVoicesend(message: str, recipients: str, sender_id: str = None, enqueue: bool = False): Send a message.message: SMS content.REQUIREDrecipients: Phone numbers.REQUIREDsender_id: Shortcode or alphanumeric ID that is registered with your Darbird account.enqueue: Set totrueif you would like to deliver as many messages to the API without waiting for an acknowledgement from telcos.MMSsend(message: str, recipients: str, media_url:str, sender_id: str = None, enqueue: bool = False): Send a message.message: SMS content.REQUIREDrecipients: Phone numbers.REQUIREDsender_id: Shortcode or alphanumeric ID that is registered with your Darbird account.media_url: A link of your mms media.enqueue: Set totrueif you would like to deliver as many messages to the API without waiting for an acknowledgement from telcos.Authysend(message: str, recipients: str, media_url:str, sender_id: str = None, enqueue: bool = False): Send a message.to_number: Phone numbers.REQUIREDtoken_lenght: Token Lenght.REQUIREDsender_id: Shortcode or alphanumeric ID that is registered with your Darbird account.msg_type: Authenication type eg. voice or sms.authverify(self, recipients, code, sender_id=None, unicodes=False, callback=None): Verify Token.to_number: Phone numbers.REQUIREDauth_code: Receieved Authenication code.REQUIREDsender_id: Shortcode or alphanumeric ID that is registered with your Darbird account.Development$gitclonehttps://github.com/darbird/darbird-python.git
$cddarbird-python
$touch.envMake sure your.envfile has the following content then runpython -m unittest discover -v# AT APIUSERNAME=sandboxAPI_KEY=some_keyIssuesIf you find a bug, please file an issue onour issue tracker on GitHub.