Package: apimaticSendAPI
Getting Started with ClickSend APIGetting StartedInstall the PackageThe package is compatible with Python versions2 >=2.7.9and3 >=3.4.
Install the package from PyPi using the following pip command:pipinstallapimaticSendAPI==1.0.0You can also view the package at:https://pypi.python.org/pypi/apimaticSendAPIInitialize the API ClientThe following parameters are configurable for the API Client:ParameterTypeDescriptionusernamestringUsernameDefault:'maryam.adnan@apimatic.io'passwordstringPasswordDefault:'0DD7D153-09B4-05CC-A443-F0BF5B1C5DCD'timeoutfloatThe value to use for connection timeout.Default: 60max_retriesintThe number of times to retry an endpoint call if it fails.Default: 3backoff_factorfloatA backoff factor to apply between attempts after the second try.Default: 0The API client can be initialized as follows:fromclicksendapi.clicksendapi_clientimportClicksendapiClientfromclicksendapi.configurationimportEnvironmentclient=ClicksendapiClient(username='maryam.adnan@apimatic.io',password='0DD7D153-09B4-05CC-A443-F0BF5B1C5DCD',environment=,)AuthorizationThis API usesBasic Authentication.Client Class DocumentationClickSend API ClientThe gateway for the SDK. This class acts as a factory for the Controllers and also holds the configuration of the SDK.ControllersNameDescriptionaccountGets AccountControllercontactGets ContactControllerAPI ReferenceList of APIsAccountContactAccountOverviewGet instanceAn instance of theAccountControllerclass can be accessed from the API Client.account_controller = client.accountCreate Account:information_source:NoteThis endpoint does not require authentication.defcreate_account(self,account_info)ParametersParameterTypeTagsDescriptionaccount_infoAccountInfoBody, Requiredaccount information propertiesResponse TypemixedExample Usageaccount_info=AccountInfo()account_info.username='username4'account_info.password='password8'account_info.user_phone='user_phone2'account_info.user_email='user_email8'account_info.user_first_name='user_first_name0'account_info.user_last_name='user_last_name6'account_info.account_name='account_name2'account_info.country='country8'result=account_controller.create_account(account_info)View Account Detailsdefview_account_details(self)Response TypemixedExample Usageresult=account_controller.view_account_details()View Account Usagedefview_account_usage(self,year,month)ParametersParameterTypeTagsDescriptionyearstringTemplate, Requiredaccount usage yearmonthstringTemplate, Requiredaccount usage monthResponse TypemixedExample Usageyear='year8'month='month0'result=account_controller.view_account_usage(year,month)Send Account Verificationdefsend_account_verification(self,account_verification_info)ParametersParameterTypeTagsDescriptionaccount_verification_infoAccountVerificationInfoBody, Required-Response TypemixedExample Usageaccount_verification_info=AccountVerificationInfo()account_verification_info.country='country4'account_verification_info.user_phone='user_phone8'account_verification_info.mtype='type0'result=account_controller.send_account_verification(account_verification_info)ContactOverviewGet instanceAn instance of theContactControllerclass can be accessed from the API Client.contact_controller = client.contactView Contact Listdefview_contact_list(self,list_id,page=None,limit=None,updated_after=None)ParametersParameterTypeTagsDescriptionlist_idstringTemplate, RequiredContact list IDpageintQuery, Optionalpage numberlimitstringQuery, OptionalNumber of records per pageupdated_afterintQuery, OptionalGet all contacts updated after a given timestampResponse TypemixedExample Usagelist_id='list_id2'result=contact_controller.view_contact_list(list_id)Create New Contactdefcreate_new_contact(self,list_id,contact_info,page=None,limit=None)ParametersParameterTypeTagsDescriptionlist_idstringTemplate, RequiredList idcontact_infoNewContactInfoBody, Requiredinfo to create new contactpageintQuery, Optionalpage numberlimitintQuery, OptionalNumber of records per pageResponse TypemixedExample Usagelist_id='list_id2'contact_info=NewContactInfo()contact_info.phone_number='phone_number4'contact_info.email='email8'contact_info.fax_number='fax_number6'contact_info.first_name='first_name8'contact_info.address_line_1='address_line_12'contact_info.address_line_2='address_line_28'contact_info.address_city='address_city8'contact_info.address_state='address_state0'contact_info.address_postal_code='address_postal_code2'contact_info.address_country='address_country0'contact_info.organization_name='organization_name0'contact_info.custom_1='custom_16'contact_info.custom_2='custom_28'contact_info.custom_3='custom_36'contact_info.custom_4='custom_46'contact_info.last_name='last_name6'result=contact_controller.create_new_contact(list_id,contact_info)Delete Contactdefdelete_contact(self,list_id,contact_id)ParametersParameterTypeTagsDescriptionlist_idintTemplate, RequiredList IDcontact_idintTemplate, RequiredContact IDResponse TypevoidExample Usagelist_id=102contact_id=38result=contact_controller.delete_contact(list_id,contact_id)Remove Opted Out Contactsdefremove_opted_out_contacts(self,list_id,opt_out_list_id)ParametersParameterTypeTagsDescriptionlist_idintTemplate, RequiredYour list idopt_out_list_idintTemplate, RequiredYour opt out list idResponse TypemixedExample Usagelist_id=102opt_out_list_id=84result=contact_controller.remove_opted_out_contacts(list_id,opt_out_list_id)Model ReferenceStructuresAccount InfoAccount Verification InfoNew Contact InfoAccount Infoinfo related to account creationClass NameAccountInfoFieldsNameTypeTagsDescriptionusernamestringRequiredYour usernamepasswordstringRequiredYour passworduser_phonestringRequiredYour phone number in E.164 format.user_emailstringRequiredYour emailuser_first_namestringRequiredYour first nameuser_last_namestringRequiredYour last nameaccount_namestringRequiredYour delivery to value.countrystringRequiredYour countryExample (as JSON){"username":"username0","password":"password4","user_phone":"user_phone2","user_email":"user_email6","user_first_name":"user_first_name6","user_last_name":"user_last_name2","account_name":"account_name2","country":"country4"}Account Verification InfoClass NameAccountVerificationInfoFieldsNameTypeTagsDescriptioncountrystringRequiredTwo-letter country code (ISO3166)user_phonestringRequiredUser's phone numbermtypestringRequiredType of verificationExample (as JSON){"country":"country4","user_phone":"user_phone2","type":"type0"}New Contact Infoinfo to create new contactClass NameNewContactInfoFieldsNameTypeTagsDescriptionphone_numberstringRequiredYour phone number in E.164 format. Must be provided if no fax number or email.emailstringRequiredYour email. Must be provided if no phone number or fax number.fax_numberstringRequiredYour fax number. Must be provided if no phone number or email.first_namestringRequiredYour first name.address_line_1stringRequiredYour street addressaddress_line_2stringRequirednoneaddress_citystringRequiredYour nearest cityaddress_statestringRequiredYour current stateaddress_postal_codestringRequiredYour current postcodeaddress_countrystringRequiredYour current countryorganization_namestringRequiredYour organisation namecustom_1stringRequirednonecustom_2stringRequirednonecustom_3stringRequirednonecustom_4stringRequirednonelast_namestringRequiredYour last nameExample (as JSON){"phone_number":"phone_number2","email":"email6","fax_number":"fax_number4","first_name":"first_name0","address_line_1":"address_line_10","address_line_2":"address_line_20","address_city":"address_city0","address_state":"address_state2","address_postal_code":"address_postal_code0","address_country":"address_country8","organization_name":"organization_name2","custom_1":"custom_14","custom_2":"custom_20","custom_3":"custom_34","custom_4":"custom_48","last_name":"last_name8"}Utility Classes DocumentationApiHelperA utility class for processing API Calls. Also contains classes for supporting standard datetime formats.MethodsNameDescriptionjson_deserializeDeserializes a JSON string to a Python dictionary.ClassesNameDescriptionHttpDateTimeA wrapper for datetime to support HTTP date format.UnixDateTimeA wrapper for datetime to support Unix date format.RFC3339DateTimeA wrapper for datetime to support RFC3339 format.Common Code DocumentationHttpResponseHttp response received.ParametersNameTypeDescriptionstatus_codeintThe status code returned by the server.reason_phrasestrThe reason phrase returned by the server.headersdictResponse headers.textstrResponse body.requestHttpRequestThe request that resulted in this response.HttpRequestRepresents a single Http Request.ParametersNameTypeTagDescriptionhttp_methodHttpMethodEnumThe HTTP method of the request.query_urlstrThe endpoint URL for the API request.headersdictoptionalRequest headers.query_parametersdictoptionalQuery parameters to add in the URL.parametersdict | stroptionalRequest body, either as a serialized string or else a list of parameters to form encode.filesdictoptionalFiles to be sent with the request.