11# whmcs-api-client
2- Python client for the WHMCS API. WHMCS (Web Host Manager Complete Solution) provides a single API endpoint that handles multiple operations through different 'action' parameters. This specification presents each action as an independent path while routing all requests to the /api.php endpoint.
2+ Python client for the WHMCS API.
33
4- This Python package is automatically generated by the [ Swagger Codegen] ( https://github.com/swagger-api/swagger-codegen ) project:
4+ WHMCS (Web Host Manager Complete Solution) provides a single API endpoint that handles
5+ multiple operations through different 'action' parameters. This specification presents
6+ each action as an independent path while routing all requests to the /api.php endpoint.
7+
8+
9+ This Python package is automatically generated by the [ OpenAPI Generator] ( https://openapi-generator.tech ) project:
510
611- API version: 1.0.0
7- - Package version: 1.0.4
8- - Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
12+ - Package version: 1.0.5
13+ - Generator version: 7.13.0
14+ - Build package: org.openapitools.codegen.languages.PythonClientCodegen
915
1016## Requirements.
1117
12- Python 2.7 and 3.4 +
18+ Python 3.9 +
1319
1420## Installation & Usage
1521### pip install
1622
17- If the python package is hosted on Github , you can install directly from Github
23+ If the python package is hosted on a repository , you can install directly using:
1824
1925``` sh
2026pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
@@ -23,7 +29,7 @@ pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
2329
2430Then import the package:
2531``` python
26- import whmcs_client
32+ import whmcs_client
2733```
2834
2935### Setuptools
@@ -40,46 +46,71 @@ Then import the package:
4046import whmcs_client
4147```
4248
49+ ### Tests
50+
51+ Execute ` pytest ` to run the tests.
52+
4353## Getting Started
4454
4555Please follow the [ installation procedure] ( #installation--usage ) and then run the following:
4656
4757``` python
48- from __future__ import print_function
49- import time
58+
5059import whmcs_client
5160from whmcs_client.rest import ApiException
5261from pprint import pprint
5362
54- # create an instance of the API class
55- api_instance = whmcs_client.DefaultApi(whmcs_client.ApiClient(configuration))
56-
57- try :
58- # Add a new client
59- api_response = api_instance.add_client()
60- pprint(api_response)
61- except ApiException as e:
62- print (" Exception when calling DefaultApi->add_client: %s \n " % e)
63-
64- # create an instance of the API class
65- api_instance = whmcs_client.DefaultApi(whmcs_client.ApiClient(configuration))
66-
67- try :
68- # Create a new order
69- api_response = api_instance.add_order()
70- pprint(api_response)
71- except ApiException as e:
72- print (" Exception when calling DefaultApi->add_order: %s \n " % e)
73-
74- # create an instance of the API class
75- api_instance = whmcs_client.DefaultApi(whmcs_client.ApiClient(configuration))
76-
77- try :
78- # Update client details
79- api_response = api_instance.update_client()
80- pprint(api_response)
81- except ApiException as e:
82- print (" Exception when calling DefaultApi->update_client: %s \n " % e)
63+ # Defining the host is optional and defaults to https://your-whmcs-instance.com/includes
64+ # See configuration.py for a list of all supported configuration parameters.
65+ configuration = whmcs_client.Configuration(
66+ host = " https://your-whmcs-instance.com/includes"
67+ )
68+
69+
70+
71+ # Enter a context with an instance of the API client
72+ with whmcs_client.ApiClient(configuration) as api_client:
73+ # Create an instance of the API class
74+ api_instance = whmcs_client.DefaultApi(api_client)
75+ username = ' username_example' # str | Admin username/API identifier
76+ password = ' password_example' # str | Admin password/API secret
77+ action = AddClient # str | Must be 'AddClient' (default to AddClient)
78+ firstname = ' firstname_example' # str | First name of the client
79+ lastname = ' lastname_example' # str | Last name of the client
80+ email = ' email_example' # str | Email address of the client
81+ address1 = ' address1_example' # str | Address line 1
82+ city = ' city_example' # str | City
83+ state = ' state_example' # str | State
84+ postcode = ' postcode_example' # str | Postal code
85+ country = ' country_example' # str | 2 character ISO country code
86+ phonenumber = ' phonenumber_example' # str | Phone number
87+ accesskey = ' accesskey_example' # str | Optional API access key (optional)
88+ responsetype = json # str | Response format (optional) (default to json)
89+ owner_user_id = 56 # int | The ID of the user that should own the client (optional)
90+ companyname = ' companyname_example' # str | Company name (optional)
91+ address2 = ' address2_example' # str | Address line 2 (optional)
92+ tax_id = ' tax_id_example' # str | Client's tax ID (optional)
93+ password2 = ' password2_example' # str | Password for the new user account (optional)
94+ securityqid = 56 # int | Security question ID (optional)
95+ securityqans = ' securityqans_example' # str | Security question answer (optional)
96+ currency = 56 # int | Currency ID (optional)
97+ groupid = 56 # int | Client group ID (optional)
98+ customfields = ' customfields_example' # str | Base64 encoded serialized array of custom field values (optional)
99+ language = ' language_example' # str | Default language setting (optional)
100+ clientip = ' clientip_example' # str | Originating IP address (optional)
101+ notes = ' notes_example' # str | Admin only notes (optional)
102+ marketingoptin = True # bool | Opt-in to marketing emails (optional)
103+ noemail = True # bool | Set to true to suppress the Order Confirmation email being sent (optional)
104+ skipvalidation = True # bool | Ignore required field validation (optional)
105+
106+ try :
107+ # Add a new client
108+ api_response = api_instance.add_client(username, password, action, firstname, lastname, email, address1, city, state, postcode, country, phonenumber, accesskey = accesskey, responsetype = responsetype, owner_user_id = owner_user_id, companyname = companyname, address2 = address2, tax_id = tax_id, password2 = password2, securityqid = securityqid, securityqans = securityqans, currency = currency, groupid = groupid, customfields = customfields, language = language, clientip = clientip, notes = notes, marketingoptin = marketingoptin, noemail = noemail, skipvalidation = skipvalidation)
109+ print (" The response of DefaultApi->add_client:\n " )
110+ pprint(api_response)
111+ except ApiException as e:
112+ print (" Exception when calling DefaultApi->add_client: %s \n " % e)
113+
83114```
84115
85116## Documentation for API Endpoints
@@ -92,27 +123,25 @@ Class | Method | HTTP request | Description
92123* DefaultApi* | [ ** add_order** ] ( docs/DefaultApi.md#add_order ) | ** POST** /AddOrder | Create a new order
93124* DefaultApi* | [ ** update_client** ] ( docs/DefaultApi.md#update_client ) | ** POST** /UpdateClient | Update client details
94125
126+
95127## Documentation For Models
96128
97- - [ AddClientBody] ( docs/AddClientBody.md )
98- - [ AddClientRequest] ( docs/AddClientRequest.md )
99129 - [ AddClientResponse] ( docs/AddClientResponse.md )
100- - [ AddOrderBody] ( docs/AddOrderBody.md )
101- - [ AddOrderRequest] ( docs/AddOrderRequest.md )
102130 - [ AddOrderResponse] ( docs/AddOrderResponse.md )
103- - [ UpdateClientBody] ( docs/UpdateClientBody.md )
104- - [ UpdateClientRequest] ( docs/UpdateClientRequest.md )
105131 - [ UpdateClientResponse] ( docs/UpdateClientResponse.md )
106- - [ WHMCSBaseRequest] ( docs/WHMCSBaseRequest.md )
107132 - [ WHMCSBaseResponse] ( docs/WHMCSBaseResponse.md )
108133 - [ WHMCSErrorResponse] ( docs/WHMCSErrorResponse.md )
109134 - [ WHMCSSuccessResponse] ( docs/WHMCSSuccessResponse.md )
110135
136+
137+ <a id =" documentation-for-authorization " ></a >
111138## Documentation For Authorization
112139
113- All endpoints do not require authorization.
140+ Endpoints do not require authorization.
114141
115142
116143## Author
117144
118145
146+
147+
0 commit comments