Python Client SDK Generated by Speakeasy
Project description
Vessel API Python SDK
The Vessel API Python SDK is a PyPi library for accessing the Vessel API, a Unified CRM API that provides standardized endpoints for performing operations on common CRM Objects.
SDK Installation
pip install vesselapi
SDK Example Usage
Example
import vesselapi
from vesselapi.models import operations
s = vesselapi.VesselAPI()
req = operations.DeleteConnectionRequestBody(
connection_id='string',
)
res = s.connections.delete(req, operations.DeleteConnectionSecurity(
vessel_api_token="<YOUR_API_KEY_HERE>",
))
if res.status_code == 200:
# handle response
pass
Authentication
To authenticate the Vessel Node SDK you will need to provide a Vessel API Token, along with an Access Token for each request. For more details please see the Vessel API Documentation.
Available Resources and Operations
connections
integrations
- list - Get CRM Integrations
webhooks
accounts
- batch - Get Batch Accounts
- create - Create Account
- details - Get Account Details
- find - Get Account
- list - Get All Accounts
- search - Search Accounts
- update - Update Account
calls
- batch - Batch Calls
- create - Create Call
- details - Get Call Details
- find - Get Call
- list - Get All Calls
- search - Search Calls
- update - Update Call
contacts
- batch - Get Batch Contacts
- create - Create Contact
- details - Get Contact Details
- find - Get Contact
- list - Get All Contacts
- search - Search Contacts
- update - Update Contact
deals
- batch - Get Batch Deals
- create - Create Deal
- details - Get Deal Details
- find - Get Deal
- list - Get All Deals
- search - Search Deals
- update - Update Deal
emails
- batch - Get Batch Emails
- create - Create Email
- details - Get Email Details
- find - Get Email
- list - Get All Emails
- search - Search Emails
- update - Update Email
events
- batch - Get Batch Events
- create - Create Event
- details - Get Event Details
- find - Get Event
- list - Get All Events
- search - Search Events
- update - Update Event
attendees
- batch - Get Batch Event Attendees
- create - Create Event Attendee
- details - Get Event Attendee Details
- find - Get Event Attendee
- list - Get All Event Attendees
- search - Search Event Attendees
- update - Update Event Attendee
leads
- batch - Get Batch Leads
- create - Create Lead
- details - Get Lead Details
- find - Get Lead
- list - Get All Leads
- search - Search Leads
- update - Update Lead
notes
- batch - Get Batch Notes
- create - Create Note
- details - Get Note Details
- find - Get Note
- list - Get All Notes
- search - Search Notes
- update - Update Note
passthrough
- create - Passthrough Request
tasks
- batch - Get Batch Tasks
- create - Create Task
- details - Get Task Details
- find - Get Task
- list - Get All Tasks
- search - Search Tasks
- update - Update Task
users
- batch - Get Batch Users
- details - Get User Details
- find - Get User
- list - Get All Users
- search - Search Users
links
- create - Exchange Public Token for Access Token
tokens
- create - Create Link Token
Error Handling
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 400-600 | / |
Example
import vesselapi
from vesselapi.models import operations
s = vesselapi.VesselAPI()
req = operations.DeleteConnectionRequestBody(
connection_id='string',
)
res = None
try:
res = s.connections.delete(req, operations.DeleteConnectionSecurity(
vessel_api_token="<YOUR_API_KEY_HERE>",
))
except errors.SDKError as e:
print(e) # handle exception
raise(e)
if res.status_code == 200:
# handle response
pass
Server Selection
Select Server by Index
You can override the default server globally by passing a server index to the server_idx: int optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
| # | Server | Variables |
|---|---|---|
| 0 | https://api.vessel.land |
None |
Example
import vesselapi
from vesselapi.models import operations
s = vesselapi.VesselAPI(
server_idx=0,
)
req = operations.DeleteConnectionRequestBody(
connection_id='string',
)
res = s.connections.delete(req, operations.DeleteConnectionSecurity(
vessel_api_token="<YOUR_API_KEY_HERE>",
))
if res.status_code == 200:
# handle response
pass
Override Server URL Per-Client
The default server can also be overridden globally by passing a URL to the server_url: str optional parameter when initializing the SDK client instance. For example:
import vesselapi
from vesselapi.models import operations
s = vesselapi.VesselAPI(
server_url="https://api.vessel.land",
)
req = operations.DeleteConnectionRequestBody(
connection_id='string',
)
res = s.connections.delete(req, operations.DeleteConnectionSecurity(
vessel_api_token="<YOUR_API_KEY_HERE>",
))
if res.status_code == 200:
# handle response
pass
Custom HTTP Client
The Python SDK makes API calls using the (requests)[https://pypi.org/project/requests/] HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom requests.Session object.
For example, you could specify a header for every request that this sdk makes as follows:
import vesselapi
import requests
http_client = requests.Session()
http_client.headers.update({'x-custom-header': 'someValue'})
s = vesselapi.VesselAPI(client: http_client)
Authentication
Per-Client Security Schemes
This SDK supports the following security scheme globally:
| Name | Type | Scheme |
|---|---|---|
vessel_api_token |
apiKey | API key |
You can set the security parameters through the security optional parameter when initializing the SDK client instance. For example:
import vesselapi
from vesselapi.models import operations, shared
s = vesselapi.VesselAPI(
security=shared.Security(
vessel_api_token="<YOUR_API_KEY_HERE>",
),
)
req = operations.GetOneConnectionRequest(
connection_id='string',
)
res = s.connections.find(req)
if res.response_body is not None:
# handle response
pass
Per-Operation Security Schemes
Some operations in this SDK require the security scheme to be specified at the request level. For example:
import vesselapi
from vesselapi.models import operations
s = vesselapi.VesselAPI()
req = operations.DeleteConnectionRequestBody(
connection_id='string',
)
res = s.connections.delete(req, operations.DeleteConnectionSecurity(
vessel_api_token="<YOUR_API_KEY_HERE>",
))
if res.status_code == 200:
# handle response
pass
SDK Generated by Speakeasy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vesselapi-5.2.1.tar.gz.
File metadata
- Download URL: vesselapi-5.2.1.tar.gz
- Upload date:
- Size: 47.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c57cf1853e6bc43dadf53bf4b0ddc85aea3d1263d01cafdaf4f51dd2caab0e63
|
|
| MD5 |
1ab5fd51b0446ec9e48c9d984e4fcd1b
|
|
| BLAKE2b-256 |
a5505100a6e0b77d2035119a8791db624bf70911bc1db972fc213524f95cd3a1
|
File details
Details for the file vesselapi-5.2.1-py3-none-any.whl.
File metadata
- Download URL: vesselapi-5.2.1-py3-none-any.whl
- Upload date:
- Size: 154.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60c3664851731525c31cd71c5559bad4b8731c9085f6cc08d9c11bcf69a37444
|
|
| MD5 |
efedab611c634840156436a5254bb562
|
|
| BLAKE2b-256 |
bb90314bcae6d1e9ee6699f1bac57d17f22f6428382f25681682b6e1a4e6fde5
|