Skip to content

Commit 4a9532f

Browse files
authored
Add api python client (#1)
Add api python client
1 parent 7bb2552 commit 4a9532f

File tree

189 files changed

+34312
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+34312
-0
lines changed

README.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# The Official PandaDoc Python client SDK
2+
PandaDoc SDK spans a broad range of functionality to help you build incredible documents automation experiences inside your product.
3+
4+
## Docs
5+
- [Official public API documentation](https://developers.pandadoc.com/reference/about)
6+
7+
## Requirements
8+
python >= 3.6
9+
10+
## Installation
11+
#### pip install
12+
If the python package is hosted on a repository, you can install directly using:
13+
```sh
14+
pip install git+https://github.com/PandaDoc/pandadoc-api-python-client.git
15+
```
16+
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/PandaDoc/pandadoc-api-python-client.git`)
17+
18+
Then import the package:
19+
```python
20+
import pandadoc_client
21+
```
22+
23+
## Getting Started
24+
25+
```python
26+
from pprint import pprint
27+
28+
import openapi_client
29+
from openapi_client.api import templates_api
30+
31+
# Configure API key authorization: apiKey
32+
api_key = "YOUR_API_KEY"
33+
34+
# Defining the host is optional and defaults to https://api.pandadoc.com
35+
# See configuration.py for a list of all supported configuration parameters.
36+
cfg = openapi_client.Configuration(
37+
host = "https://api.pandadoc.com",
38+
api_key={"apiKey": f"API-Key {api_key}"},
39+
)
40+
41+
# Enter a context with an instance of the API client
42+
with openapi_client.ApiClient(cfg) as api_client:
43+
# Create an instance of the API class
44+
api_instance = templates_api.TemplatesApi(api_client)
45+
46+
try:
47+
resp = api_instance.list_templates(tag="doe-inc-proposals")
48+
pprint(resp)
49+
except openapi_client.ApiException as e:
50+
pprint("Exception when calling TemplatesApi->list_templates: %s\n" % e)
51+
```
52+
53+
## Authorization
54+
### apiKey
55+
- **Type**: API key
56+
- **API key parameter name**: Authorization
57+
- **Location**: HTTP header
58+
59+
### oauth2
60+
- **Type**: OAuth
61+
- **Flow**: accessCode
62+
- **Authorization URL**: https://app.pandadoc.com/oauth2/authorize
63+
- **Scopes**:
64+
- **read+write**: default
65+
66+
## Examples
67+
68+
- [Create and send document from a template](examples/create_from_template_and_send.py)
69+
- [Create and send document from the pdf url](examples/create_from_pdf_by_url_and_send.py)
70+
71+
## Docs
72+
### Official PandaDoc public API docs
73+
https://developers.pandadoc.com/reference/about
74+
75+
### Documentation for API Endpoints
76+
77+
All URIs are relative to *https://api.pandadoc.com*
78+
79+
Class | Method | HTTP request | Description
80+
------------ | ------------- | ------------- | -------------
81+
*APILogsApi* | [**details_api_log**](docs/APILogsApi.md#details_api_log) | **GET** /public/v1/logs/{id} | Details API Log
82+
*APILogsApi* | [**list_api_logs**](docs/APILogsApi.md#list_api_logs) | **GET** /public/v1/logs | List API Log
83+
*ContentLibraryItemsApi* | [**details_content_library_item**](docs/ContentLibraryItemsApi.md#details_content_library_item) | **GET** /public/v1/content-library-items/{id}/details | Details Content Library Item
84+
*ContentLibraryItemsApi* | [**list_content_library_items**](docs/ContentLibraryItemsApi.md#list_content_library_items) | **GET** /public/v1/content-library-items | List Content Library Item
85+
*DocumentsApi* | [**delete_document**](docs/DocumentsApi.md#delete_document) | **DELETE** /public/v1/documents/{id} | Delete document by id
86+
*DocumentsApi* | [**document_create**](docs/DocumentsApi.md#document_create) | **POST** /public/v1/documents | Create document
87+
*DocumentsApi* | [**document_create_link**](docs/DocumentsApi.md#document_create_link) | **POST** /public/v1/documents/{id}/session | Create a Document Link
88+
*DocumentsApi* | [**document_details**](docs/DocumentsApi.md#document_details) | **GET** /public/v1/documents/{id}/details | Document details
89+
*DocumentsApi* | [**document_list**](docs/DocumentsApi.md#document_list) | **GET** /public/v1/documents | List documents
90+
*DocumentsApi* | [**document_status**](docs/DocumentsApi.md#document_status) | **GET** /public/v1/documents/{id} | Document status
91+
*DocumentsApi* | [**download_document**](docs/DocumentsApi.md#download_document) | **GET** /public/v1/documents/{id}/download | Document download
92+
*DocumentsApi* | [**download_protected_document**](docs/DocumentsApi.md#download_protected_document) | **GET** /public/v1/documents/{id}/download-protected | Download document protected
93+
*DocumentsApi* | [**linked_object_delete**](docs/DocumentsApi.md#linked_object_delete) | **DELETE** /public/v1/documents/{id}/linked-objects/{linked_object_id} | Delete Linked Object
94+
*DocumentsApi* | [**linked_object_list**](docs/DocumentsApi.md#linked_object_list) | **GET** /public/v1/documents/{id}/linked-objects | List Linked Objects
95+
*DocumentsApi* | [**linked_objects_create**](docs/DocumentsApi.md#linked_objects_create) | **POST** /public/v1/documents/{id}/linked-objects | Create Linked Object
96+
*DocumentsApi* | [**send_document**](docs/DocumentsApi.md#send_document) | **POST** /public/v1/documents/{id}/send | Send Document
97+
*FoldersAPIApi* | [**create_document_folder**](docs/FoldersAPIApi.md#create_document_folder) | **POST** /public/v1/documents/folders | Create Documents Folder
98+
*FoldersAPIApi* | [**create_template_folder**](docs/FoldersAPIApi.md#create_template_folder) | **POST** /public/v1/templates/folders | Create Templates Folder
99+
*FoldersAPIApi* | [**list_document_folders**](docs/FoldersAPIApi.md#list_document_folders) | **GET** /public/v1/documents/folders | List Documents Folders
100+
*FoldersAPIApi* | [**list_template_folders**](docs/FoldersAPIApi.md#list_template_folders) | **GET** /public/v1/templates/folders | List Templates Folders
101+
*FoldersAPIApi* | [**rename_document_folder**](docs/FoldersAPIApi.md#rename_document_folder) | **PUT** /public/v1/documents/folders/{id} | Rename Documents Folder
102+
*FoldersAPIApi* | [**rename_template_folder**](docs/FoldersAPIApi.md#rename_template_folder) | **PUT** /public/v1/templates/folders/{id} | Rename Templates Folder
103+
*FormsApi* | [**list_form**](docs/FormsApi.md#list_form) | **GET** /public/v1/forms | Forms
104+
*OAuth20AuthenticationApi* | [**access_token**](docs/OAuth20AuthenticationApi.md#access_token) | **POST** /oauth2/access_token | Create/Refresh Access Token
105+
*TemplatesApi* | [**delete_template**](docs/TemplatesApi.md#delete_template) | **DELETE** /public/v1/templates/{id} | Delete Template
106+
*TemplatesApi* | [**details_temaplate**](docs/TemplatesApi.md#details_temaplate) | **GET** /public/v1/templates/{id}/details | Details Template
107+
*TemplatesApi* | [**list_templates**](docs/TemplatesApi.md#list_templates) | **GET** /public/v1/templates | List Templates
108+
109+
## License
110+
SDK is licensed under the following [License](LICENSE).

docs/APILogDetailsResponse.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# APILogDetailsResponse
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**id** | **str** | | [optional]
8+
**url** | **str** | | [optional]
9+
**method** | **str** | | [optional]
10+
**status** | **int** | | [optional]
11+
**request_time** | **str** | | [optional]
12+
**response_time** | **str** | | [optional]
13+
**response_body** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional]
14+
**query_params_string** | **str** | | [optional]
15+
**query_params_object** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional]
16+
**request_body** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional]
17+
**token_type** | **str** | | [optional]
18+
**application** | **str, none_type** | | [optional]
19+
**key** | **str** | | [optional]
20+
**request_id** | **str** | | [optional]
21+
**user_email** | **str** | | [optional]
22+
**user_id** | **str** | | [optional]
23+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
24+
25+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
26+
27+

docs/APILogListResponse.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# APILogListResponse
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**results** | [**[APILogListResponseResults]**](APILogListResponseResults.md) | | [optional]
8+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+

docs/APILogListResponseResults.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# APILogListResponseResults
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**id** | **str** | | [optional]
8+
**url** | **str** | | [optional]
9+
**status** | **int** | | [optional]
10+
**request_time** | **str** | | [optional]
11+
**response_time** | **str** | | [optional]
12+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
13+
14+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
15+
16+

docs/APILogsApi.md

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
# pandadoc_client.APILogsApi
2+
3+
All URIs are relative to *https://api.pandadoc.com*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**details_api_log**](APILogsApi.md#details_api_log) | **GET** /public/v1/logs/{id} | Details API Log
8+
[**list_api_logs**](APILogsApi.md#list_api_logs) | **GET** /public/v1/logs | List API Log
9+
10+
11+
# **details_api_log**
12+
> APILogDetailsResponse details_api_log(id)
13+
14+
Details API Log
15+
16+
Returns details of the specific API log event.
17+
18+
### Example
19+
20+
* Api Key Authentication (apiKey):
21+
* OAuth Authentication (oauth2):
22+
23+
```python
24+
import time
25+
import pandadoc_client
26+
from pandadoc_client.api import api_logs_api
27+
from pandadoc_client.model.api_log_details_response import APILogDetailsResponse
28+
from pprint import pprint
29+
# Defining the host is optional and defaults to https://api.pandadoc.com
30+
# See configuration.py for a list of all supported configuration parameters.
31+
configuration = pandadoc_client.Configuration(
32+
host = "https://api.pandadoc.com"
33+
)
34+
35+
# The client must configure the authentication and authorization parameters
36+
# in accordance with the API server security policy.
37+
# Examples for each auth method are provided below, use the example that
38+
# satisfies your auth use case.
39+
40+
# Configure API key authorization: apiKey
41+
configuration.api_key['apiKey'] = 'YOUR_API_KEY'
42+
43+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
44+
# configuration.api_key_prefix['apiKey'] = 'Bearer'
45+
46+
# Configure OAuth2 access token for authorization: oauth2
47+
configuration = pandadoc_client.Configuration(
48+
host = "https://api.pandadoc.com"
49+
)
50+
configuration.access_token = 'YOUR_ACCESS_TOKEN'
51+
52+
# Enter a context with an instance of the API client
53+
with pandadoc_client.ApiClient(configuration) as api_client:
54+
# Create an instance of the API class
55+
api_instance = api_logs_api.APILogsApi(api_client)
56+
id = "id_example" # str | Log event id.
57+
58+
# example passing only required values which don't have defaults set
59+
try:
60+
# Details API Log
61+
api_response = api_instance.details_api_log(id)
62+
pprint(api_response)
63+
except pandadoc_client.ApiException as e:
64+
print("Exception when calling APILogsApi->details_api_log: %s\n" % e)
65+
```
66+
67+
68+
### Parameters
69+
70+
Name | Type | Description | Notes
71+
------------- | ------------- | ------------- | -------------
72+
**id** | **str**| Log event id. |
73+
74+
### Return type
75+
76+
[**APILogDetailsResponse**](APILogDetailsResponse.md)
77+
78+
### Authorization
79+
80+
[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2)
81+
82+
### HTTP request headers
83+
84+
- **Content-Type**: Not defined
85+
- **Accept**: application/json
86+
87+
88+
### HTTP response details
89+
90+
| Status code | Description | Response headers |
91+
|-------------|-------------|------------------|
92+
**200** | OK | - |
93+
**401** | Authentication error | - |
94+
**404** | Not found | - |
95+
**429** | Too Many Requests | - |
96+
97+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
98+
99+
# **list_api_logs**
100+
> APILogListResponse list_api_logs()
101+
102+
List API Log
103+
104+
Get the list of all logs within the selected workspace. Optionally filter by date, page, and `#` of items per page.
105+
106+
### Example
107+
108+
* Api Key Authentication (apiKey):
109+
* OAuth Authentication (oauth2):
110+
111+
```python
112+
import time
113+
import pandadoc_client
114+
from pandadoc_client.api import api_logs_api
115+
from pandadoc_client.model.api_log_list_response import APILogListResponse
116+
from pprint import pprint
117+
# Defining the host is optional and defaults to https://api.pandadoc.com
118+
# See configuration.py for a list of all supported configuration parameters.
119+
configuration = pandadoc_client.Configuration(
120+
host = "https://api.pandadoc.com"
121+
)
122+
123+
# The client must configure the authentication and authorization parameters
124+
# in accordance with the API server security policy.
125+
# Examples for each auth method are provided below, use the example that
126+
# satisfies your auth use case.
127+
128+
# Configure API key authorization: apiKey
129+
configuration.api_key['apiKey'] = 'YOUR_API_KEY'
130+
131+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
132+
# configuration.api_key_prefix['apiKey'] = 'Bearer'
133+
134+
# Configure OAuth2 access token for authorization: oauth2
135+
configuration = pandadoc_client.Configuration(
136+
host = "https://api.pandadoc.com"
137+
)
138+
configuration.access_token = 'YOUR_ACCESS_TOKEN'
139+
140+
# Enter a context with an instance of the API client
141+
with pandadoc_client.ApiClient(configuration) as api_client:
142+
# Create an instance of the API class
143+
api_instance = api_logs_api.APILogsApi(api_client)
144+
since = "since_example" # str | Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-90d\" (for past 90 days). (optional)
145+
to = "to_example" # str | Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-10d\" (for past 10 days) or a special \"now\" value. (optional)
146+
count = 1 # int | The amount of items on each page. (optional)
147+
page = 1 # int | Page number of the results returned. (optional)
148+
statuses = [
149+
100,
150+
] # [int] | Returns only the predefined status codes. Allows 1xx, 2xx, 3xx, 4xx, and 5xx. (optional)
151+
methods = [
152+
"GET",
153+
] # [str] | Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. (optional)
154+
search = "search_example" # str | Returns the results containing a string. (optional)
155+
environment_type = "PRODUCTION" # str | Returns logs for production/sandbox. (optional)
156+
157+
# example passing only required values which don't have defaults set
158+
# and optional values
159+
try:
160+
# List API Log
161+
api_response = api_instance.list_api_logs(since=since, to=to, count=count, page=page, statuses=statuses, methods=methods, search=search, environment_type=environment_type)
162+
pprint(api_response)
163+
except pandadoc_client.ApiException as e:
164+
print("Exception when calling APILogsApi->list_api_logs: %s\n" % e)
165+
```
166+
167+
168+
### Parameters
169+
170+
Name | Type | Description | Notes
171+
------------- | ------------- | ------------- | -------------
172+
**since** | **str**| Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-90d\" (for past 90 days). | [optional]
173+
**to** | **str**| Determines a point in time from which logs should be fetched. Either a specific ISO 8601 datetime or a relative identifier such as \"-10d\" (for past 10 days) or a special \"now\" value. | [optional]
174+
**count** | **int**| The amount of items on each page. | [optional]
175+
**page** | **int**| Page number of the results returned. | [optional]
176+
**statuses** | **[int]**| Returns only the predefined status codes. Allows 1xx, 2xx, 3xx, 4xx, and 5xx. | [optional]
177+
**methods** | **[str]**| Returns only the predefined HTTP methods. Allows GET, POST, PUT, PATCH, and DELETE. | [optional]
178+
**search** | **str**| Returns the results containing a string. | [optional]
179+
**environment_type** | **str**| Returns logs for production/sandbox. | [optional]
180+
181+
### Return type
182+
183+
[**APILogListResponse**](APILogListResponse.md)
184+
185+
### Authorization
186+
187+
[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2)
188+
189+
### HTTP request headers
190+
191+
- **Content-Type**: Not defined
192+
- **Accept**: application/json
193+
194+
195+
### HTTP response details
196+
197+
| Status code | Description | Response headers |
198+
|-------------|-------------|------------------|
199+
**200** | OK | - |
200+
**400** | Bad Request | - |
201+
**401** | Authentication error | - |
202+
**429** | Too Many Requests | - |
203+
204+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
205+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# ContentLibraryItemListResponse
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**results** | [**[ContentLibraryItemListResponseResults]**](ContentLibraryItemListResponseResults.md) | | [optional]
8+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+

0 commit comments

Comments
 (0)