from__future__importprint_functionimporttimeimportbraangoimportbraango.modelsimportbraango.apisfrombraango.restimportApiExceptionfrompprintimportpprint''' @author braango Sample code showing how to use addClient api to add new client to a sub-dealer The api is very flexible with lots of options Please refer to api docs to see how to use all options Intent here is to show the relevant api and call needed'''#TEST auth token. Please contact#sales@braango.com to have one#created for youbraango.configuration.api_key['auth_token']='ISNWF0P30WM0CMK'# create an instance of the API classapi_instance=braango.ConnectsApi()# str | id of _sub_dealer_subdealerid='subdealers2004'api_Key="ISNMdzuNiKG7jhl9d9v"#Set the account type to partner for#virtual dealer and partner hosted#accountsaccount_type="partner"#This id for your tracking, will be reflected back in response.#Doesn't get used by Braango#If not speficied, braango will return session-id in its responseid_client="add-client-04"# { "api_key": "ISNGvAzwuy4X7vAqrtV", "id": "any value",# "account_type": "partner" }requestHeader=braango.models.RequestHeader(api_Key,id_client,account_type)client_number="6692459240"connect_enable=Falsebraango_number="555-555-5555"message=["Line 1"]send_message=Truesend_message_only=False# { client_number, connect_enable, connect_id, braango_number, message, media_urls, send_message, send_message_only}addClient=braango.models.AddClient(client_number,connect_enable,None,braango_number,message,None,send_message,send_message_only)addClientRequestInput=braango.AddClientRequestInput(requestHeader,addClient)# AddClientRequestInput | (optional)try:# Add Client All Personnelapi_instance.add_client_all_personnel(subdealerid,body=addClientRequestInput)exceptApiExceptionase:print("Exception when calling ConnectsApi->add_client_all_personnel: %s\n"%e)
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.