Package: vonage
Vonage Server SDK for PythonThis is the Python server SDK for Vonage's API. To use it you'll
need a Vonage account. Sign upfor free at vonage.com.InstallationUsageSMS APIMessages APIVoice APINCCO BuilderVerify V2 APIVerify V1 APIVideo APIMeetings APINumber Insight APIProactive Connect APIAccount APISubaccounts APINumber Management APIPricing APIManaging SecretsApplication APIUsers APIValidating Webhook SignaturesJWT ParametersOverriding API AttributesFrequently Asked QuestionsContributingLicenseInstallationTo install the Python client library using pip:pip install vonageTo upgrade your installed client library using pip:pip install vonage --upgradeAlternatively, you can clone the repository via the command line:git clone git@github.com:Vonage/vonage-python-sdk.gitor by opening it on GitHub desktop.UsageBegin by importing thevonagemodule:importvonageThen construct a client object with your key and secret:client=vonage.Client(key=api_key,secret=api_secret)For production, you can specify theVONAGE_API_KEYandVONAGE_API_SECRETenvironment variables instead of specifying the key and secret explicitly.For newer endpoints that support JWT authentication such as the Voice API,
you can also specify theapplication_idandprivate_keyarguments:client=vonage.Client(application_id=application_id,private_key=private_key)To check signatures for incoming webhook requests, you'll also need
to specify thesignature_secretargument (or theVONAGE_SIGNATURE_SECRETenvironment variable).To use the SDK to call Vonage APIs, pass in dicts with the required options to methods likeSms.send_message(). Examples of this are given below.Simplified structure for calling API MethodsThe client now instantiates a class object for each API when it is created, e.g.vonage.Client(key="mykey", secret="mysecret")instantiates instances ofAccount,Sms,NumberInsightetc. These instances can now be called directly fromClient, e.g.client=vonage.Client(key="mykey",secret="mysecret")print(f"Account balance is:{client.account.get_balance()}")print("Sending an SMS")client.sms.send_message({"from":"Vonage","to":"SOME_PHONE_NUMBER","text":"Hello from Vonage's SMS API"})This means you don't have to create a separate instance of each class to use its API methods. Instead, you can access class methods from the client instance withclient.CLASS_NAME.CLASS_METHODSMS APIAlthough the Messages API adds more messaging channels, the SMS API is still supported.Send an SMS# New wayclient=vonage.Client(key=VONAGE_API_KEY,secret=VONAGE_API_SECRET)client.sms.send_message({"from":VONAGE_BRAND_NAME,"to":TO_NUMBER,"text":"A text message sent using the Vonage SMS API",})# Old wayfromvonageimportSmssms=Sms(key=VONAGE_API_KEY,secret=VONAGE_API_SECRET)sms.send_message({"from":VONAGE_BRAND_NAME,"to":TO_NUMBER,"text":"A text message sent using the Vonage SMS API",})Send SMS with unicodeclient=vonage.Client(key=VONAGE_API_KEY,secret=VONAGE_API_SECRET)client.sms.send_message({'from':VONAGE_BRAND_NAME,'to':TO_NUMBER,'text':'こんにちは世界','type':'unicode',})Submit SMS Conversionclient=vonage.Client(key=VONAGE_API_KEY,secret=VONAGE_SECRET)response=client.sms.send_message({'from':VONAGE_BRAND_NAME,'to':TO_NUMBER,'text':'Hi from Vonage'})client.sms.submit_sms_conversion(response['message-id'])Update the default SMS webhook URLs for callbacks/delivery recieptsclient.sms.update_default_sms_webhook({'moCallBackUrl':'new.url.vonage.com',# Default inbound sms webhook url'drCallBackUrl':'different.url.vonage.com'# Delivery receipt url}})The delivery receipt URL can be unset by sending an empty string.Messages APIThe Messages API is an API that allows you to send messages via SMS, MMS, WhatsApp, Messenger and Viber. Call the API from your Python code by
passing a dict of parameters into theclient.messages.send_message()method.It accepts JWT or API key/secret authentication.Some basic samples are below. For more detailed information and code snippets, please visit theVonage Developer Documentation.Send an SMSresponseData=client.messages.send_message({'channel':'sms','message_type':'text','to':'447123456789','from':'Vonage','text':'Hello from Vonage'})Send an MMSNote: only available in the US. You will need a 10DLC number to send an MMS message.client.messages.send_message({'channel':'mms','message_type':'image','to':'11112223333','from':'1223345567','image':{'url':'https://example.com/image.jpg','caption':'Test Image'}})Send an audio file via WhatsAppYou will need a WhatsApp Business Account to use WhatsApp messaging. WhatsApp restrictions mean that you
must send a template message to a user if they have not previously messaged you, but you can send any message
type to a user if they have messaged your business number in the last 24 hours.client.messages.send_message({'channel':'whatsapp','message_type':'audio','to':'447123456789','from':'440123456789','audio':{'url':'https://example.com/audio.mp3'}})Send a video file via Facebook MessengerYou will need to link your Facebook business page to your Vonage account in the Vonage developer dashboard. (Click on the sidebar
"External Accounts" option to do this.)client.messages.send_message({'channel':'messenger','message_type':'video','to':'594123123123123','from':'1012312312312','video':{'url':'https://example.com/video.mp4'}})Send a text message with Viberclient.messages.send_message({'channel':'viber_service','message_type':'text','to':'447123456789','from':'440123456789','text':'Hello from Vonage!'})Voice APIMake a callclient=vonage.Client(application_id=APPLICATION_ID,private_key=PRIVATE_KEY)client.voice.create_call({'to':[{'type':'phone','number':'14843331234'}],'from':{'type':'phone','number':'14843335555'},'answer_url':['https://example.com/answer']})Retrieve a list of callsclient=vonage.Client(application_id=APPLICATION_ID,private_key=PRIVATE_KEY)client.voice.get_calls()Retrieve a single callclient=vonage.Client(application_id=APPLICATION_ID,private_key=PRIVATE_KEY)client.voice.get_call(uuid)Update a callclient=vonage.Client(application_id=APPLICATION_ID,private_key=PRIVATE_KEY)response=client.voice.create_call({'to':[{'type':'phone','number':'14843331234'}],'from':{'type':'phone','number':'14843335555'},'answer_url':['https://example.com/answer']})client.voice.update_call(response['uuid'],action='hangup')Stream audio to a callclient=vonage.Client(application_id=APPLICATION_ID,private_key=PRIVATE_KEY)stream_url='https://nexmo-community.github.io/ncco-examples/assets/voice_api_audio_streaming.mp3'response=client.voice.create_call({'to':[{'type':'phone','number':'14843331234'}],'from':{'type':'phone','number':'14843335555'},'answer_url':['https://example.com/answer']})client.voice.send_audio(response['uuid'],stream_url=[stream_url])Stop streaming audio to a callclient=vonage.Client(application_id='0d4884d1-eae8-4f18-a46a-6fb14d5fdaa6',private_key='./private.key')stream_url='https://nexmo-community.github.io/ncco-examples/assets/voice_api_audio_streaming.mp3'response=client.voice.create_call({'to':[{'type':'phone','number':'14843331234'}],'from':{'type':'phone','number':'14843335555'},'answer_url':['https://example.com/answer']})client.voice.send_audio(response['uuid'],stream_url=[stream_url])client.voice.stop_audio(response['uuid'])Send a synthesized speech message to a callclient=vonage.Client(application_id=APPLICATION_ID,private_key=PRIVATE_KEY)response=client.voice.create_call({'to':[{'type':'phone','number':'14843331234'}],'from':{'type':'phone','number':'14843335555'},'answer_url':['https://example.com/answer']})client.voice.send_speech(response['uuid'],text='Hello from vonage')Stop sending a synthesized speech message to a callclient=vonage.Client(application_id=APPLICATION_ID,private_key=APPLICATION_ID)response=client.voice.create_call({'to':[{'type':'phone','number':'14843331234'}],'from':{'type':'phone','number':'14843335555'},'answer_url':['https://example.com/answer']})client.voice.send_speech(response['uuid'],text='Hello from vonage')client.voice.stop_speech(response['uuid'])Send DTMF tones to a callclient=vonage.Client(application_id=APPLICATION_ID,private_key=PRIVATE_KEY)response=client.voice.create_call({'to':[{'type':'phone','number':'14843331234'}],'from':{'type':'phone','number':'14843335555'},'answer_url':['https://example.com/answer']})client.voice.send_dtmf(response['uuid'],digits='1234')Get recordingresponse=client.get_recording(RECORDING_URL)Verify the Signature of a Webhook Sent by VonageIf signed webhooks are enabled (the default), Vonage will sign webhooks with the signature secret found in theAPI Settingssection of the Vonage Developer Dashboard.ifclient.voice.verify_signature('JWT_RECEIVED_FROM_VONAGE','MY_VONAGE_SIGNATURE_SECRET'):print('Signature is valid!')else:print('Signature is invalid!')NCCO BuilderThe SDK contains a builder to help you create Call Control Objects (NCCOs) for use with the Vonage Voice API.For more information,check the full NCCO reference documentation on the Vonage website.An NCCO is a list of "Actions": steps to be followed when a call is initiated or received.Use the builder to construct valid NCCO actions, which are modelled in the SDK asPydanticmodels, and build them into an NCCO. The NCCO actions supported by the builder are:RecordConversationConnectTalkStreamInputNotifyConstruct actionsrecord=Ncco.Record(eventUrl=['https://example.com'])talk=Ncco.Talk(text='Hello from Vonage!',bargeIn=True,loop=5,premium=True)The Connect action has each valid endpoint type (phone, application, WebSocket, SIP and VBC) specified as a Pydantic model so these can be validated, though it is also possible to pass in a dict with the endpoint properties directly into theNcco.Connectobject.This example shows a Connect action created with an endpoint object.phone=ConnectEndpoints.PhoneEndpoint(number='447000000000',dtmfAnswer='1p2p3p#**903#',)connect=Ncco.Connect(endpoint=phone,eventUrl=['https://example.com/events'],from_='447000000000')This example shows a different Connect action, created with a dictionary.connect=Ncco.Connect(endpoint={'type':'phone','number':'447000000000','dtmfAnswer':'2p02p'},randomFromNumber=True)Build into an NCCOCreate an NCCO from the actions with theNcco.build_nccomethod. This will be returned as a list of dicts representing each action and can be used in calls to the Voice API.ncco=Ncco.build_ncco(record,connect,talk)response=client.voice.create_call({'to':[{'type':'phone','number':TO_NUMBER}],'from':{'type':'phone','number':VONAGE_NUMBER},'ncco':ncco})pprint(response)Note on from_ parameter in connect actionWhen using theconnectaction, use the parameterfrom_to specify the recipient (asfromis a reserved keyword in Python!)Verify V2 APIV2 of the Vonage Verify API lets you send verification codes via SMS, WhatsApp, Voice and Email.You can also verify a user by WhatsApp Interactive Message or by Silent Authentication on their mobile device.Send a verification codeparams={'brand':'ACME, Inc','workflow':[{'channel':'sms','to':'447700900000'}]}verify_request=verify2.new_request(params)Use silent authentication, with email as a fallbackparams={'brand':'ACME, Inc','workflow':[{'channel':'silent_auth','to':'447700900000'},{'channel':'email','to':'customer@example.com','from':'business@example.com'}]}verify_request=verify2.new_request(params)check_url=verify_request['check_url']# URL to continue with the silent auth workflowSend a verification code with custom options, including a custom codeparams={'locale':'en-gb','channel_timeout':120,'client_ref':'my client reference','code':'asdf1234','brand':'ACME, Inc','workflow':[{'channel':'sms','to':'447700900000','app_hash':'asdfghjklqw'}],}verify_request=verify2.new_request(params)Send a verification request to a blocked networkThis feature is only enabled if you have requested for it to be added to your account.params={'brand':'ACME, Inc','fraud_check':False,'workflow':[{'channel':'sms','to':'447700900000'}]}verify_request=verify2.new_request(params)Check a verification codeverify2.check_code(REQUEST_ID,CODE)Cancel an ongoing verificationverify2.cancel_verification(REQUEST_ID)Verify V1 APISearch for a Verification requestclient=vonage.Client(key='API_KEY',secret='API_SECRET')response=client.verify.search('69e2626cbc23451fbbc02f627a959677')ifresponseisnotNone:print(response['status'])Send verification codeclient=vonage.Client(key='API_KEY',secret='API_SECRET')response=client.verify.start_verification(number=RECIPIENT_NUMBER,brand='AcmeInc')ifresponse["status"]=="0":print("Started verification request_id is%s"%(response["request_id"]))else:print("Error:%s"%response["error_text"])Send verification code with workflowclient=vonage.Client(key='API_KEY',secret='API_SECRET')response=client.verify.start_verification(number=RECIPIENT_NUMBER,brand='AcmeInc',workflow_id=1)ifresponse["status"]=="0":print("Started verification request_id is%s"%(response["request_id"]))else:print("Error:%s"%response["error_text"])Check verification codeclient=vonage.Client(key='API_KEY',secret='API_SECRET')response=client.verify.check(REQUEST_ID,code=CODE)ifresponse["status"]=="0":print("Verification successful, event_id is%s"%(response["event_id"]))else:print("Error:%s"%response["error_text"])Cancel Verification Requestclient=vonage.Client(key='API_KEY',secret='API_SECRET')response=client.verify.cancel(REQUEST_ID)ifresponse["status"]=="0":print("Cancellation successful")else:print("Error:%s"%response["error_text"])Trigger next verification proccessclient=vonage.Client(key='API_KEY',secret='API_SECRET')response=client.verify.trigger_next_event(REQUEST_ID)ifresponse["status"]=="0":print("Next verification stage triggered")else:print("Error:%s"%response["error_text"])Send payment authentication codeclient=vonage.Client(key='API_KEY',secret='API_SECRET')response=client.verify.psd2(number=RECIPIENT_NUMBER,payee=PAYEE,amount=AMOUNT)ifresponse["status"]=="0":print("Started PSD2 verification request_id is%s"%(response["request_id"]))else:print("Error:%s"%response["error_text"])Send payment authentication code with workflowclient=vonage.Client(key='API_KEY',secret='API_SECRET')client.verify.psd2(number=RECIPIENT_NUMBER,payee=PAYEE,amount=AMOUNT,workflow_id:WORKFLOW_ID)ifresponse["status"]=="0":print("Started PSD2 verification request_id is%s"%(response["request_id"]))else:print("Error:%s"%response["error_text"])Video APIYou can make calls to the Vonage Video API from this SDK. See theVonage Video API documentationfor detailed information and instructions on how to use the Vonage Python SDK with the Vonage Video API. Have a look at the SDK'sOpenTok to Vonage migration guideif you've previously used OpenTok.Meetings APIFull docs for theMeetings API are available here.Create a meeting room# Instant roomparams={'display_name':'my_test_room'}meeting=client.meetings.create_room(params)# Long term roomparams={'display_name':'test_long_term_room','type':'long_term','expires_at':'2023-01-30T00:47:04+0000'}meeting=client.meetings.create_room(params)Get all meeting roomsclient.meetings.list_rooms()Get a room by idclient.meetings.get_room('MY_ROOM_ID')Update a long term roomparams={'update_details':{"available_features":{"is_recording_available":False,"is_chat_available":False,}}}meeting=client.meetings.update_room('MY_ROOM_ID',params)Get all recordings for a sessionsession=client.meetings.get_session_recordings('MY_SESSION_ID')Get a recording by idrecording=client.meetings.get_recording('MY_RECORDING_ID')Delete a recordingclient.meetings.delete_recording('MY_RECORDING_ID')List dial-in numbersnumbers=client.meetings.list_dial_in_numbers()Create a themeparams={'theme_name':'my_theme','main_color':'#12f64e','brand_text':'My Company','short_company_url':'my-company',}theme=client.meetings.create_theme(params)Add a theme to a roommeetings.add_theme_to_room('MY_ROOM_ID','MY_THEME_ID')List themesthemes=client.meetings.list_themes()Get theme informationtheme=client.meetings.get_theme('MY_THEME_ID')Delete a themeclient.meetings.delete_theme('MY_THEME_ID')Update a themeparams={'update_details':{'theme_name':'updated_theme','main_color':'#FF0000','brand_text':'My Updated Company Name','short_company_url':'updated_company_url',}}theme=client.meetings.update_theme('MY_THEME_ID',params)List all rooms using a specified themerooms=client.meetings.list_rooms_with_theme_id('MY_THEME_ID')Update the default theme for your applicationresponse=client.meetings.update_application_theme('MY_THEME_ID')Upload a logo to a themeresponse=client.meetings.upload_logo_to_theme(theme_id='MY_THEME_ID',path_to_image='path/to/my/image.png',logo_type='white',# 'white', 'colored' or 'favicon')Number Insight APIBasic Number Insightclient.number_insight.get_basic_number_insight(number='447700900000')Docs:https://developer.nexmo.com/api/number-insight#getNumberInsightBasicStandard Number Insightclient.number_insight.get_standard_number_insight(number='447700900000')Docs:https://developer.nexmo.com/api/number-insight#getNumberInsightStandardAdvanced Number Insightclient.number_insight.get_advanced_number_insight(number='447700900000')Docs:https://developer.nexmo.com/api/number-insight#getNumberInsightAdvancedProactive Connect APIFull documentation for theProactive Connect APIis available here.These methods help you manage lists of contacts when using the API:Find all listsclient.proactive_connect.list_all_lists()Create a listLists can be created manually or imported from Salesforce.params={'name':'my list','description':'my description','tags':['vip']}client.proactive_connect.create_list(params)Get a listclient.proactive_connect.get_list(LIST_ID)Update a listparams={'name':'my list','tags':['sport','football']}client.proactive_connect.update_list(LIST_ID,params)Delete a listclient.proactive_connect.delete_list(LIST_ID)Sync a list from an external datasourceparams={'name':'my list','tags':['sport','football']}client.proactive_connect.sync_list_from_datasource(LIST_ID)These methods help you work with individual items in a list:Find all items in a listclient.proactive_connect.list_all_items(LIST_ID)Create a new list itemdata={'firstName':'John','lastName':'Doe','phone':'123456789101'}client.proactive_connect.create_item(LIST_ID,data)Get a list itemclient.proactive_connect.get_item(LIST_ID,ITEM_ID)Update a list itemdata={'firstName':'John','lastName':'Doe','phone':'447007000000'}client.proactive_connect.update_item(LIST_ID,ITEM_ID,data)Delete a list itemclient.proactive_connect.delete_item(LIST_ID,ITEM_ID)Download all items in a list as a .csv fileFILE_PATH='path/to/the/downloaded/file/location'client.proactive_connect.download_list_items(LIST_ID,FILE_PATH)Upload items from a .csv file into a listFILE_PATH='path/to/the/file/to/upload/location'client.proactive_connect.upload_list_items(LIST_ID,FILE_PATH)This method helps you work with events emitted by the Proactive Connect API when in use:List all eventsclient.proactive_connect.list_events()Account APIGet your account balanceclient.account.get_balance()Top up your accountThis feature is only enabled when you enable auto-reload for your account in the dashboard.# trx is the reference from when auto-reload was enabled and money was addedclient.account.topup(trx=transaction_reference)Subaccounts APIThis API is used to create and configure subaccounts related to your primary account and transfer credit, balances and bought numbers between accounts.The subaccounts API is disabled by default. If you want to use subaccounts,contact supportto have the API enabled on your account.Get a list of all subaccountsclient.subaccounts.list_subaccounts()Create a subaccountclient.subaccounts.create_subaccount(name='my subaccount')# With optionsclient.subaccounts.create_subaccount(name='my subaccount',secret='Password123',use_primary_account_balance=False,)Get information about a subaccountclient.subaccounts.get_subaccount(SUBACCOUNT_API_KEY)Modify a subaccountclient.subaccounts.modify_subaccount(SUBACCOUNT_KEY,suspended=True,use_primary_account_balance=False,name='my modified subaccount',)List credit transfers between accountsAll fields are optional. Ifstart_dateorend_dateare used, the dates must be specified in UTC ISO 8601 format, e.g.1970-01-01T00:00:00Z. Don't use milliseconds.client.subaccounts.list_credit_transfers(start_date='2022-03-29T14:16:56Z',end_date='2023-06-12T17:20:01Z',subaccount=SUBACCOUNT_API_KEY,# Use to show only the results that contain this key)Transfer credit between accountsTransferring credit is only possible for postpaid accounts, i.e. accounts that can have a negative balance. For prepaid and self-serve customers, account balances can be transferred between accounts (see below).client.subaccounts.transfer_credit(from_=FROM_ACCOUNT,to=TO_ACCOUNT,amount=0.50,reference='test credit transfer',)List balance transfers between accountsAll fields are optional. Ifstart_dateorend_dateare used, the dates must be specified in UTC ISO 8601 format, e.g.1970-01-01T00:00:00Z. Don't use milliseconds.client.subaccounts.list_balance_transfers(start_date='2022-03-29T14:16:56Z',end_date='2023-06-12T17:20:01Z',subaccount=SUBACCOUNT_API_KEY,# Use to show only the results that contain this key)Transfer account balances between accountsclient.subaccounts.transfer_balance(from_=FROM_ACCOUNT,to=TO_ACCOUNT,amount=0.50,reference='test balance transfer',)Transfer bought phone numbers between accountsclient.subaccounts.transfer_balance(from_=FROM_ACCOUNT,to=TO_ACCOUNT,number=NUMBER_TO_TRANSFER,country='US',)Number Management APIGet numbers associated with your accountclient.numbers.get_account_numbers(size=25)Get numbers that are available to buyclient.numbers.get_available_numbers('CA',size=25)Buy an available numberparams={'country':'US','msisdn':'number_to_buy'}client.numbers.buy_number(params)# To buy a number for a subaccountparams={'country':'US','msisdn':'number_to_buy','target_api_key':SUBACCOUNT_API_KEY}client.numbers.buy_number(params)Cancel your subscription for a specific numberparams={'country':'US','msisdn':'number_to_cancel'}client.numbers.cancel_number(params)# To cancel a number assigned to a subaccountparams={'country':'US','msisdn':'number_to_buy','target_api_key':SUBACCOUNT_API_KEY}client.numbers.cancel_number(params)Update the behaviour of a number that you ownparams={"country":"US","msisdn":"number_to_update","moHttpUrl":"callback_url"}client.numbers.update_number(params)Pricing APIGet pricing for a single countryclient.account.get_country_pricing(country_code='GB',type='sms')# Default type is smsGet pricing for all countriesclient.account.get_all_countries_pricing(type='sms')# Default type is sms, can be voiceGet pricing for a specific dialling prefixclient.account.get_prefix_pricing(prefix='44',type='sms')Managing SecretsAn API is provided to allow you to rotate your API secrets. You can create a new secret (up to a maximum of two secrets) and delete the existing one once all applications have been updated.List Secretssecrets=client.account.list_secrets(API_KEY)Get information about a specific secretsecrets=client.account.get_secret(API_KEY,secret_id)Create A New SecretCreate a new secret (the created dates will help you know which is which):client.account.create_secret(API_KEY,'awes0meNewSekret!!;');Delete A SecretDelete the old secret (any application still using these credentials will stop working):client.account.revoke_secret(API_KEY,'my-secret-id')Application APICreate an applicationresponse=client.application.create_application({name='Example App',type='voice'})Docs:https://developer.nexmo.com/api/application.v2#createApplicationRetrieve a list of applicationsresponse=client.application.list_applications()Docs:https://developer.nexmo.com/api/application.v2#listApplicationRetrieve a single applicationresponse=client.application.get_application(uuid)Docs:https://developer.nexmo.com/api/application.v2#getApplicationUpdate an applicationresponse=client.application.update_application(uuid,answer_method='POST')Docs:https://developer.nexmo.com/api/application.v2#updateApplicationDelete an applicationresponse=client.application.delete_application(uuid)Docs:https://developer.nexmo.com/api/application.v2#deleteApplicationUsers APIThese API methods are part of theApplication (v2) APIbut are a in separate module in the SDK.See the API reference for more details.List all Usersclient.users.list_users()Create a new userclient.users.create_user()# Default values generatedclient.users.create_user(params={...})# Specify custom valuesGet detailed information about a userclient.users.get_user('USER_ID')Update user detailsclient.users.update_user('USER_ID',params={...})Delete a userclient.users.delete_user('USER_ID')Validate webhook signaturesclient=vonage.Client(signature_secret='secret')ifclient.check_signature(request.query):# valid signatureelse:# invalid signatureDocs:https://developer.nexmo.com/concepts/guides/signing-messagesNote: you'll need to contactsupport@nexmo.comto enable message signing on
your account before you can validate webhook signatures.JWT parametersBy default, the library generates tokens for JWT authentication that have an expiry time of 15 minutes. You should set the expiry time (exp) to an appropriate value for your organisation's own policies and/or your use case.Use theauthmethod of the client class to specify custom parameters:client.auth(nbf=nbf,exp=exp,jti=jti)# ORclient.auth({'nbf':nbf,'exp':exp,'jti':jti})Overriding API AttributesIn order to rewrite/get the value of variables used across all the Vonage classes Python usesCall by Object Referencethat allows you to create a single client to use with all API classes.An example using setters/getters withObject references:fromvonageimportClient# Define the clientclient=Client(key='YOUR_API_KEY',secret='YOUR_API_SECRET')print(client.host())# using getter for host -- value returned: rest.nexmo.com# Change the value in clientclient.host('mio.nexmo.com')# Change host to mio.nexmo.com - this change will be available for smsclient.sms.send_message(params)# Sends an SMS to the host aboveOverriding API Host / Host AttributesThese attributes are private in the client class and the only way to access them is using the getters/setters we provide.fromvonageimportClientclient=Client(key='YOUR_API_KEY',secret='YOUR_API_SECRET')print(client.host())# return rest.nexmo.comclient.host('newhost.vonage.com')# rewrites the host value to newhost.vonage.comprint(client.api_host())# returns api.vonage.comclient.api_host('myapi.vonage.com')# rewrite the value of api_host to myapi.vonage.comFrequently Asked QuestionsSupported APIsThe following is a list of Vonage APIs and whether the Python SDK provides support for them:APIAPI Release StatusSupported?Account APIGeneral Availability✅Alerts APIGeneral Availability✅Application APIGeneral Availability✅Audit APIBeta❌Conversation APIBeta❌Dispatch APIBeta❌External Accounts APIBeta❌Media APIBeta❌Meetings APIGeneral Availability✅Messages APIGeneral Availability✅Number Insight APIGeneral Availability✅Number Management APIGeneral Availability✅Pricing APIGeneral Availability✅Proactive Connect APIGeneral Availability✅  (partially supported)Redact APIDeveloper Preview❌Reports APIBeta❌SMS APIGeneral Availability✅Subaccounts APIGeneral Availability✅Verify API v2General Availability✅Verify API v1 (Legacy)General Availability✅Voice APIGeneral Availability✅asyncio Supportasynciois a library to writeconcurrentcode using theasync/awaitsyntax.We don't currently support asyncio in the Python SDK but we are planning to do so in upcoming releases.ContributingWe :heart: contributions! But if you plan to work on something big or controversial, please contact us by raising an issue first!We recommend working onvonage-python-sdkwith avirtualenv. The following command will install all the Python dependencies you need to run the tests:makeinstallThe tests are all written with pytest. You run them with:maketestWe useBlackfor code formatting, with our config in thepyproject.tomlfile. To ensure a PR follows the right format, you can set up and use our pre-commit settings withpre-commitinstallThen when you commit code, if it's not in the right format, it will be automatically fixed for you. After that, just commit again and everything should work as expected!LicenseThis library is released under theApache License.