opportify-sdk 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lib/__init__.py +0 -0
- lib/v1/__init__.py +0 -0
- lib/v1/openapi_client/__init__.py +63 -0
- lib/v1/openapi_client/api/__init__.py +6 -0
- lib/v1/openapi_client/api/email_insights_api.py +317 -0
- lib/v1/openapi_client/api/ip_insights_api.py +322 -0
- lib/v1/openapi_client/api_client.py +797 -0
- lib/v1/openapi_client/api_response.py +21 -0
- lib/v1/openapi_client/configuration.py +595 -0
- lib/v1/openapi_client/exceptions.py +199 -0
- lib/v1/openapi_client/models/__init__.py +45 -0
- lib/v1/openapi_client/models/abuse_contact.py +99 -0
- lib/v1/openapi_client/models/admin_contact.py +99 -0
- lib/v1/openapi_client/models/analyze_email200_response.py +113 -0
- lib/v1/openapi_client/models/analyze_email400_response.py +91 -0
- lib/v1/openapi_client/models/analyze_email400_response_error.py +137 -0
- lib/v1/openapi_client/models/analyze_email500_response.py +91 -0
- lib/v1/openapi_client/models/analyze_email500_response_error.py +89 -0
- lib/v1/openapi_client/models/analyze_email_request.py +92 -0
- lib/v1/openapi_client/models/analyze_ip200_response.py +127 -0
- lib/v1/openapi_client/models/analyze_ip400_response.py +91 -0
- lib/v1/openapi_client/models/analyze_ip400_response_error.py +137 -0
- lib/v1/openapi_client/models/analyze_ip404_response.py +91 -0
- lib/v1/openapi_client/models/analyze_ip500_response.py +91 -0
- lib/v1/openapi_client/models/analyze_ip_request.py +89 -0
- lib/v1/openapi_client/models/asn.py +93 -0
- lib/v1/openapi_client/models/block_listed.py +94 -0
- lib/v1/openapi_client/models/email_dns.py +87 -0
- lib/v1/openapi_client/models/geo.py +113 -0
- lib/v1/openapi_client/models/internalerror.py +89 -0
- lib/v1/openapi_client/models/invalidemail.py +89 -0
- lib/v1/openapi_client/models/ipvalidationfailed.py +89 -0
- lib/v1/openapi_client/models/malformedrequest.py +89 -0
- lib/v1/openapi_client/models/malformedrequest1.py +89 -0
- lib/v1/openapi_client/models/notfound.py +89 -0
- lib/v1/openapi_client/models/organization.py +103 -0
- lib/v1/openapi_client/models/risk_report.py +89 -0
- lib/v1/openapi_client/models/tech_contact.py +99 -0
- lib/v1/openapi_client/models/trusted_provider.py +93 -0
- lib/v1/openapi_client/models/whois.py +117 -0
- lib/v1/openapi_client/py.typed +0 -0
- lib/v1/openapi_client/rest.py +257 -0
- opportify_sdk-0.1.0.dist-info/METADATA +16 -0
- opportify_sdk-0.1.0.dist-info/RECORD +49 -0
- opportify_sdk-0.1.0.dist-info/WHEEL +5 -0
- opportify_sdk-0.1.0.dist-info/top_level.txt +2 -0
- src/__init__.py +6 -0
- src/email_insights.py +97 -0
- src/ip_insights.py +93 -0
lib/__init__.py
ADDED
|
File without changes
|
lib/v1/__init__.py
ADDED
|
File without changes
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
Opportify Insights API
|
|
7
|
+
|
|
8
|
+
## Overview The **Opportify Insights API** provides access to a powerful and up-to-date platform. With advanced data warehousing and AI-driven capabilities, this API is designed to empower your business to make informed, data-driven decisions and effectively assess potential risks. ### Base URL Use the following base URL for all API requests: ```plaintext https://api.opportify.ai/insights/v1/<service>/<endpoint> ``` ### Features - [**Email Insights:**](/docs/api-reference/email-insights) - Validate email syntax. - Identify email types (free, disposable, corporate or unknown). - Real time verifications: - Reachable: Confirms if the email domain has valid MX DNS records using DNS lookup. - Deliverable: Simulates an SMTP handshake to check if the email address exists and is deliverable. - Catch-All: Detects if the domain accepts all emails (catch-all configuration). - Intelligent Error Correction: Automatically corrects well-known misspelled email addresses. - Risk Report: Provides an AI-driven normalized score (200-1000) to evaluate email risk, using predefined thresholds. [Access Documentation >>](/docs/api-reference/email-insights) - [**IP Insights:**](/docs/api-reference/ip-insights) - Connection types: Detects connection types such as `wired`, `mobile`, `enterprise`, `satellite`, `VPN`, `cloud-provider`, `open-proxy`, or `Tor`. - Geo location: Delivers detailed insights such as country, city, timezone, language preferences, and additional location-based information to enhance regional understanding. - WHOIS: Provides main details including RIR, ASN, organization, and abuse/admin/technical contacts. - Trusted Provider Recognition: Identifies if the IP is part of a known trusted provider (e.g., ZTNA - Zero Trust Network Access). - Blocklist Reports: Retrieves up-to-date blocklist statuses, active reports, and the latest detections. - Risk Report: Delivers an AI-driven normalized score (200-1000) to evaluate IP risk, supported by predefined thresholds. [Access Documentation >>](/docs/api-reference/ip-insights) ### Authentication & Security - **API Key:** Access to the API requires an API key, which must be included in the request headers. Businesses can generate unlimited API keys directly from their account, offering flexibility and ease of use. - **ACL Rules:** Enhance security with Access Control Lists (ACL), allowing you to restrict API access from specific IP addresses or ranges. This feature provides an additional layer of protection by ensuring only authorized IPs can interact with the API. - **No Query Parameters:** As a precautionary measure, our API avoids the use of query parameters for all operations, including authentication and handling Personally Identifiable Information (PII). This approach minimizes security risks by preventing sensitive data from being exposed in access logs, browser history, cached URLs, debugging tools, or inadvertently shared URLs. All sensitive information is securely transmitted through headers or the request body.
|
|
9
|
+
|
|
10
|
+
The version of the OpenAPI document: 1.0.0
|
|
11
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
12
|
+
|
|
13
|
+
Do not edit the class manually.
|
|
14
|
+
""" # noqa: E501
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
__version__ = "1.0.0"
|
|
18
|
+
|
|
19
|
+
# import apis into sdk package
|
|
20
|
+
from openapi_client.api.email_insights_api import EmailInsightsApi
|
|
21
|
+
from openapi_client.api.ip_insights_api import IPInsightsApi
|
|
22
|
+
|
|
23
|
+
# import ApiClient
|
|
24
|
+
from openapi_client.api_response import ApiResponse
|
|
25
|
+
from openapi_client.api_client import ApiClient
|
|
26
|
+
from openapi_client.configuration import Configuration
|
|
27
|
+
from openapi_client.exceptions import OpenApiException
|
|
28
|
+
from openapi_client.exceptions import ApiTypeError
|
|
29
|
+
from openapi_client.exceptions import ApiValueError
|
|
30
|
+
from openapi_client.exceptions import ApiKeyError
|
|
31
|
+
from openapi_client.exceptions import ApiAttributeError
|
|
32
|
+
from openapi_client.exceptions import ApiException
|
|
33
|
+
|
|
34
|
+
# import models into sdk package
|
|
35
|
+
from openapi_client.models.abuse_contact import AbuseContact
|
|
36
|
+
from openapi_client.models.admin_contact import AdminContact
|
|
37
|
+
from openapi_client.models.analyze_email200_response import AnalyzeEmail200Response
|
|
38
|
+
from openapi_client.models.analyze_email400_response import AnalyzeEmail400Response
|
|
39
|
+
from openapi_client.models.analyze_email400_response_error import AnalyzeEmail400ResponseError
|
|
40
|
+
from openapi_client.models.analyze_email500_response import AnalyzeEmail500Response
|
|
41
|
+
from openapi_client.models.analyze_email500_response_error import AnalyzeEmail500ResponseError
|
|
42
|
+
from openapi_client.models.analyze_email_request import AnalyzeEmailRequest
|
|
43
|
+
from openapi_client.models.analyze_ip200_response import AnalyzeIp200Response
|
|
44
|
+
from openapi_client.models.analyze_ip400_response import AnalyzeIp400Response
|
|
45
|
+
from openapi_client.models.analyze_ip400_response_error import AnalyzeIp400ResponseError
|
|
46
|
+
from openapi_client.models.analyze_ip404_response import AnalyzeIp404Response
|
|
47
|
+
from openapi_client.models.analyze_ip500_response import AnalyzeIp500Response
|
|
48
|
+
from openapi_client.models.analyze_ip_request import AnalyzeIpRequest
|
|
49
|
+
from openapi_client.models.asn import Asn
|
|
50
|
+
from openapi_client.models.block_listed import BlockListed
|
|
51
|
+
from openapi_client.models.email_dns import EmailDNS
|
|
52
|
+
from openapi_client.models.geo import Geo
|
|
53
|
+
from openapi_client.models.internalerror import INTERNALERROR
|
|
54
|
+
from openapi_client.models.invalidemail import INVALIDEMAIL
|
|
55
|
+
from openapi_client.models.ipvalidationfailed import IPVALIDATIONFAILED
|
|
56
|
+
from openapi_client.models.malformedrequest import MALFORMEDREQUEST
|
|
57
|
+
from openapi_client.models.malformedrequest1 import MALFORMEDREQUEST1
|
|
58
|
+
from openapi_client.models.notfound import NOTFOUND
|
|
59
|
+
from openapi_client.models.organization import Organization
|
|
60
|
+
from openapi_client.models.risk_report import RiskReport
|
|
61
|
+
from openapi_client.models.tech_contact import TechContact
|
|
62
|
+
from openapi_client.models.trusted_provider import TrustedProvider
|
|
63
|
+
from openapi_client.models.whois import Whois
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Opportify Insights API
|
|
5
|
+
|
|
6
|
+
## Overview The **Opportify Insights API** provides access to a powerful and up-to-date platform. With advanced data warehousing and AI-driven capabilities, this API is designed to empower your business to make informed, data-driven decisions and effectively assess potential risks. ### Base URL Use the following base URL for all API requests: ```plaintext https://api.opportify.ai/insights/v1/<service>/<endpoint> ``` ### Features - [**Email Insights:**](/docs/api-reference/email-insights) - Validate email syntax. - Identify email types (free, disposable, corporate or unknown). - Real time verifications: - Reachable: Confirms if the email domain has valid MX DNS records using DNS lookup. - Deliverable: Simulates an SMTP handshake to check if the email address exists and is deliverable. - Catch-All: Detects if the domain accepts all emails (catch-all configuration). - Intelligent Error Correction: Automatically corrects well-known misspelled email addresses. - Risk Report: Provides an AI-driven normalized score (200-1000) to evaluate email risk, using predefined thresholds. [Access Documentation >>](/docs/api-reference/email-insights) - [**IP Insights:**](/docs/api-reference/ip-insights) - Connection types: Detects connection types such as `wired`, `mobile`, `enterprise`, `satellite`, `VPN`, `cloud-provider`, `open-proxy`, or `Tor`. - Geo location: Delivers detailed insights such as country, city, timezone, language preferences, and additional location-based information to enhance regional understanding. - WHOIS: Provides main details including RIR, ASN, organization, and abuse/admin/technical contacts. - Trusted Provider Recognition: Identifies if the IP is part of a known trusted provider (e.g., ZTNA - Zero Trust Network Access). - Blocklist Reports: Retrieves up-to-date blocklist statuses, active reports, and the latest detections. - Risk Report: Delivers an AI-driven normalized score (200-1000) to evaluate IP risk, supported by predefined thresholds. [Access Documentation >>](/docs/api-reference/ip-insights) ### Authentication & Security - **API Key:** Access to the API requires an API key, which must be included in the request headers. Businesses can generate unlimited API keys directly from their account, offering flexibility and ease of use. - **ACL Rules:** Enhance security with Access Control Lists (ACL), allowing you to restrict API access from specific IP addresses or ranges. This feature provides an additional layer of protection by ensuring only authorized IPs can interact with the API. - **No Query Parameters:** As a precautionary measure, our API avoids the use of query parameters for all operations, including authentication and handling Personally Identifiable Information (PII). This approach minimizes security risks by preventing sensitive data from being exposed in access logs, browser history, cached URLs, debugging tools, or inadvertently shared URLs. All sensitive information is securely transmitted through headers or the request body.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
import warnings
|
|
15
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
16
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
|
+
from typing_extensions import Annotated
|
|
18
|
+
|
|
19
|
+
from openapi_client.models.analyze_email200_response import AnalyzeEmail200Response
|
|
20
|
+
from openapi_client.models.analyze_email_request import AnalyzeEmailRequest
|
|
21
|
+
|
|
22
|
+
from openapi_client.api_client import ApiClient, RequestSerialized
|
|
23
|
+
from openapi_client.api_response import ApiResponse
|
|
24
|
+
from openapi_client.rest import RESTResponseType
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class EmailInsightsApi:
|
|
28
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
29
|
+
Ref: https://openapi-generator.tech
|
|
30
|
+
|
|
31
|
+
Do not edit the class manually.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
def __init__(self, api_client=None) -> None:
|
|
35
|
+
if api_client is None:
|
|
36
|
+
api_client = ApiClient.get_default()
|
|
37
|
+
self.api_client = api_client
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@validate_call
|
|
41
|
+
def analyze_email(
|
|
42
|
+
self,
|
|
43
|
+
analyze_email_request: AnalyzeEmailRequest,
|
|
44
|
+
_request_timeout: Union[
|
|
45
|
+
None,
|
|
46
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
47
|
+
Tuple[
|
|
48
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
49
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
50
|
+
]
|
|
51
|
+
] = None,
|
|
52
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
53
|
+
_content_type: Optional[StrictStr] = None,
|
|
54
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
55
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
56
|
+
) -> AnalyzeEmail200Response:
|
|
57
|
+
"""Analyze Email
|
|
58
|
+
|
|
59
|
+
The **Analyze Email** endpoint validates an email address and returns its deliverability status, provider details, and potential corrections. This endpoint is ideal for ensuring accurate email data before usage. ### Features: - Validate email syntax. - Identify email types (free, disposable, corporate or unknown). - Real time verifications: - Reachable: Confirms if the email domain has valid MX DNS records using DNS lookup. - Deliverable: Simulates an SMTP handshake to check if the email address exists and is deliverable. - Catch-All: Detects if the domain accepts all emails (catch-all configuration). - Intelligent Error Correction: Automatically corrects well-known misspelled email addresses. - Risk Report: Provides an AI-driven normalized score (200-1000) to evaluate email risk, using predefined thresholds. ### Example Request Body: ```json { \"email\": \"my-email@company.com\", \"enableAI\": true, \"enableAutoCorrection\": true } ``` ### Authentication & Security - **API Key:** Access to the API requires an API key, which must be included in the request headers. Businesses can generate unlimited API keys directly from their account, offering flexibility and ease of use. - **ACL Rules:** Enhance security with Access Control Lists (ACL), allowing you to restrict API access from specific IP addresses or ranges. This feature provides an additional layer of protection by ensuring only authorized IPs can interact with the API. - **No Query Parameters:** As a precautionary measure, our API avoids the use of query parameters for all operations, including authentication and handling Personally Identifiable Information (PII). This approach minimizes security risks by preventing sensitive data from being exposed in access logs, browser history, cached URLs, debugging tools, or inadvertently shared URLs. All sensitive information is securely transmitted through headers or the request body.
|
|
60
|
+
|
|
61
|
+
:param analyze_email_request: (required)
|
|
62
|
+
:type analyze_email_request: AnalyzeEmailRequest
|
|
63
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
64
|
+
number provided, it will be total request
|
|
65
|
+
timeout. It can also be a pair (tuple) of
|
|
66
|
+
(connection, read) timeouts.
|
|
67
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
68
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
69
|
+
request; this effectively ignores the
|
|
70
|
+
authentication in the spec for a single request.
|
|
71
|
+
:type _request_auth: dict, optional
|
|
72
|
+
:param _content_type: force content-type for the request.
|
|
73
|
+
:type _content_type: str, Optional
|
|
74
|
+
:param _headers: set to override the headers for a single
|
|
75
|
+
request; this effectively ignores the headers
|
|
76
|
+
in the spec for a single request.
|
|
77
|
+
:type _headers: dict, optional
|
|
78
|
+
:param _host_index: set to override the host_index for a single
|
|
79
|
+
request; this effectively ignores the host_index
|
|
80
|
+
in the spec for a single request.
|
|
81
|
+
:type _host_index: int, optional
|
|
82
|
+
:return: Returns the result object.
|
|
83
|
+
""" # noqa: E501
|
|
84
|
+
|
|
85
|
+
_param = self._analyze_email_serialize(
|
|
86
|
+
analyze_email_request=analyze_email_request,
|
|
87
|
+
_request_auth=_request_auth,
|
|
88
|
+
_content_type=_content_type,
|
|
89
|
+
_headers=_headers,
|
|
90
|
+
_host_index=_host_index
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
94
|
+
'200': "AnalyzeEmail200Response",
|
|
95
|
+
'400': "AnalyzeEmail400Response",
|
|
96
|
+
'500': "AnalyzeEmail500Response",
|
|
97
|
+
}
|
|
98
|
+
response_data = self.api_client.call_api(
|
|
99
|
+
*_param,
|
|
100
|
+
_request_timeout=_request_timeout
|
|
101
|
+
)
|
|
102
|
+
response_data.read()
|
|
103
|
+
return self.api_client.response_deserialize(
|
|
104
|
+
response_data=response_data,
|
|
105
|
+
response_types_map=_response_types_map,
|
|
106
|
+
).data
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
@validate_call
|
|
110
|
+
def analyze_email_with_http_info(
|
|
111
|
+
self,
|
|
112
|
+
analyze_email_request: AnalyzeEmailRequest,
|
|
113
|
+
_request_timeout: Union[
|
|
114
|
+
None,
|
|
115
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
116
|
+
Tuple[
|
|
117
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
118
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
119
|
+
]
|
|
120
|
+
] = None,
|
|
121
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
122
|
+
_content_type: Optional[StrictStr] = None,
|
|
123
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
124
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
125
|
+
) -> ApiResponse[AnalyzeEmail200Response]:
|
|
126
|
+
"""Analyze Email
|
|
127
|
+
|
|
128
|
+
The **Analyze Email** endpoint validates an email address and returns its deliverability status, provider details, and potential corrections. This endpoint is ideal for ensuring accurate email data before usage. ### Features: - Validate email syntax. - Identify email types (free, disposable, corporate or unknown). - Real time verifications: - Reachable: Confirms if the email domain has valid MX DNS records using DNS lookup. - Deliverable: Simulates an SMTP handshake to check if the email address exists and is deliverable. - Catch-All: Detects if the domain accepts all emails (catch-all configuration). - Intelligent Error Correction: Automatically corrects well-known misspelled email addresses. - Risk Report: Provides an AI-driven normalized score (200-1000) to evaluate email risk, using predefined thresholds. ### Example Request Body: ```json { \"email\": \"my-email@company.com\", \"enableAI\": true, \"enableAutoCorrection\": true } ``` ### Authentication & Security - **API Key:** Access to the API requires an API key, which must be included in the request headers. Businesses can generate unlimited API keys directly from their account, offering flexibility and ease of use. - **ACL Rules:** Enhance security with Access Control Lists (ACL), allowing you to restrict API access from specific IP addresses or ranges. This feature provides an additional layer of protection by ensuring only authorized IPs can interact with the API. - **No Query Parameters:** As a precautionary measure, our API avoids the use of query parameters for all operations, including authentication and handling Personally Identifiable Information (PII). This approach minimizes security risks by preventing sensitive data from being exposed in access logs, browser history, cached URLs, debugging tools, or inadvertently shared URLs. All sensitive information is securely transmitted through headers or the request body.
|
|
129
|
+
|
|
130
|
+
:param analyze_email_request: (required)
|
|
131
|
+
:type analyze_email_request: AnalyzeEmailRequest
|
|
132
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
133
|
+
number provided, it will be total request
|
|
134
|
+
timeout. It can also be a pair (tuple) of
|
|
135
|
+
(connection, read) timeouts.
|
|
136
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
137
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
138
|
+
request; this effectively ignores the
|
|
139
|
+
authentication in the spec for a single request.
|
|
140
|
+
:type _request_auth: dict, optional
|
|
141
|
+
:param _content_type: force content-type for the request.
|
|
142
|
+
:type _content_type: str, Optional
|
|
143
|
+
:param _headers: set to override the headers for a single
|
|
144
|
+
request; this effectively ignores the headers
|
|
145
|
+
in the spec for a single request.
|
|
146
|
+
:type _headers: dict, optional
|
|
147
|
+
:param _host_index: set to override the host_index for a single
|
|
148
|
+
request; this effectively ignores the host_index
|
|
149
|
+
in the spec for a single request.
|
|
150
|
+
:type _host_index: int, optional
|
|
151
|
+
:return: Returns the result object.
|
|
152
|
+
""" # noqa: E501
|
|
153
|
+
|
|
154
|
+
_param = self._analyze_email_serialize(
|
|
155
|
+
analyze_email_request=analyze_email_request,
|
|
156
|
+
_request_auth=_request_auth,
|
|
157
|
+
_content_type=_content_type,
|
|
158
|
+
_headers=_headers,
|
|
159
|
+
_host_index=_host_index
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
163
|
+
'200': "AnalyzeEmail200Response",
|
|
164
|
+
'400': "AnalyzeEmail400Response",
|
|
165
|
+
'500': "AnalyzeEmail500Response",
|
|
166
|
+
}
|
|
167
|
+
response_data = self.api_client.call_api(
|
|
168
|
+
*_param,
|
|
169
|
+
_request_timeout=_request_timeout
|
|
170
|
+
)
|
|
171
|
+
response_data.read()
|
|
172
|
+
return self.api_client.response_deserialize(
|
|
173
|
+
response_data=response_data,
|
|
174
|
+
response_types_map=_response_types_map,
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
@validate_call
|
|
179
|
+
def analyze_email_without_preload_content(
|
|
180
|
+
self,
|
|
181
|
+
analyze_email_request: AnalyzeEmailRequest,
|
|
182
|
+
_request_timeout: Union[
|
|
183
|
+
None,
|
|
184
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
185
|
+
Tuple[
|
|
186
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
187
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
188
|
+
]
|
|
189
|
+
] = None,
|
|
190
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
191
|
+
_content_type: Optional[StrictStr] = None,
|
|
192
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
193
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
194
|
+
) -> RESTResponseType:
|
|
195
|
+
"""Analyze Email
|
|
196
|
+
|
|
197
|
+
The **Analyze Email** endpoint validates an email address and returns its deliverability status, provider details, and potential corrections. This endpoint is ideal for ensuring accurate email data before usage. ### Features: - Validate email syntax. - Identify email types (free, disposable, corporate or unknown). - Real time verifications: - Reachable: Confirms if the email domain has valid MX DNS records using DNS lookup. - Deliverable: Simulates an SMTP handshake to check if the email address exists and is deliverable. - Catch-All: Detects if the domain accepts all emails (catch-all configuration). - Intelligent Error Correction: Automatically corrects well-known misspelled email addresses. - Risk Report: Provides an AI-driven normalized score (200-1000) to evaluate email risk, using predefined thresholds. ### Example Request Body: ```json { \"email\": \"my-email@company.com\", \"enableAI\": true, \"enableAutoCorrection\": true } ``` ### Authentication & Security - **API Key:** Access to the API requires an API key, which must be included in the request headers. Businesses can generate unlimited API keys directly from their account, offering flexibility and ease of use. - **ACL Rules:** Enhance security with Access Control Lists (ACL), allowing you to restrict API access from specific IP addresses or ranges. This feature provides an additional layer of protection by ensuring only authorized IPs can interact with the API. - **No Query Parameters:** As a precautionary measure, our API avoids the use of query parameters for all operations, including authentication and handling Personally Identifiable Information (PII). This approach minimizes security risks by preventing sensitive data from being exposed in access logs, browser history, cached URLs, debugging tools, or inadvertently shared URLs. All sensitive information is securely transmitted through headers or the request body.
|
|
198
|
+
|
|
199
|
+
:param analyze_email_request: (required)
|
|
200
|
+
:type analyze_email_request: AnalyzeEmailRequest
|
|
201
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
202
|
+
number provided, it will be total request
|
|
203
|
+
timeout. It can also be a pair (tuple) of
|
|
204
|
+
(connection, read) timeouts.
|
|
205
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
206
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
207
|
+
request; this effectively ignores the
|
|
208
|
+
authentication in the spec for a single request.
|
|
209
|
+
:type _request_auth: dict, optional
|
|
210
|
+
:param _content_type: force content-type for the request.
|
|
211
|
+
:type _content_type: str, Optional
|
|
212
|
+
:param _headers: set to override the headers for a single
|
|
213
|
+
request; this effectively ignores the headers
|
|
214
|
+
in the spec for a single request.
|
|
215
|
+
:type _headers: dict, optional
|
|
216
|
+
:param _host_index: set to override the host_index for a single
|
|
217
|
+
request; this effectively ignores the host_index
|
|
218
|
+
in the spec for a single request.
|
|
219
|
+
:type _host_index: int, optional
|
|
220
|
+
:return: Returns the result object.
|
|
221
|
+
""" # noqa: E501
|
|
222
|
+
|
|
223
|
+
_param = self._analyze_email_serialize(
|
|
224
|
+
analyze_email_request=analyze_email_request,
|
|
225
|
+
_request_auth=_request_auth,
|
|
226
|
+
_content_type=_content_type,
|
|
227
|
+
_headers=_headers,
|
|
228
|
+
_host_index=_host_index
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
232
|
+
'200': "AnalyzeEmail200Response",
|
|
233
|
+
'400': "AnalyzeEmail400Response",
|
|
234
|
+
'500': "AnalyzeEmail500Response",
|
|
235
|
+
}
|
|
236
|
+
response_data = self.api_client.call_api(
|
|
237
|
+
*_param,
|
|
238
|
+
_request_timeout=_request_timeout
|
|
239
|
+
)
|
|
240
|
+
return response_data.response
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
def _analyze_email_serialize(
|
|
244
|
+
self,
|
|
245
|
+
analyze_email_request,
|
|
246
|
+
_request_auth,
|
|
247
|
+
_content_type,
|
|
248
|
+
_headers,
|
|
249
|
+
_host_index,
|
|
250
|
+
) -> RequestSerialized:
|
|
251
|
+
|
|
252
|
+
_host = None
|
|
253
|
+
|
|
254
|
+
_collection_formats: Dict[str, str] = {
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
_path_params: Dict[str, str] = {}
|
|
258
|
+
_query_params: List[Tuple[str, str]] = []
|
|
259
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
260
|
+
_form_params: List[Tuple[str, str]] = []
|
|
261
|
+
_files: Dict[
|
|
262
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
263
|
+
] = {}
|
|
264
|
+
_body_params: Optional[bytes] = None
|
|
265
|
+
|
|
266
|
+
# process the path parameters
|
|
267
|
+
# process the query parameters
|
|
268
|
+
# process the header parameters
|
|
269
|
+
# process the form parameters
|
|
270
|
+
# process the body parameter
|
|
271
|
+
if analyze_email_request is not None:
|
|
272
|
+
_body_params = analyze_email_request
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
# set the HTTP header `Accept`
|
|
276
|
+
if 'Accept' not in _header_params:
|
|
277
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
278
|
+
[
|
|
279
|
+
'application/json'
|
|
280
|
+
]
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
# set the HTTP header `Content-Type`
|
|
284
|
+
if _content_type:
|
|
285
|
+
_header_params['Content-Type'] = _content_type
|
|
286
|
+
else:
|
|
287
|
+
_default_content_type = (
|
|
288
|
+
self.api_client.select_header_content_type(
|
|
289
|
+
[
|
|
290
|
+
'application/json'
|
|
291
|
+
]
|
|
292
|
+
)
|
|
293
|
+
)
|
|
294
|
+
if _default_content_type is not None:
|
|
295
|
+
_header_params['Content-Type'] = _default_content_type
|
|
296
|
+
|
|
297
|
+
# authentication setting
|
|
298
|
+
_auth_settings: List[str] = [
|
|
299
|
+
'opportifyToken'
|
|
300
|
+
]
|
|
301
|
+
|
|
302
|
+
return self.api_client.param_serialize(
|
|
303
|
+
method='POST',
|
|
304
|
+
resource_path='/email/analyze',
|
|
305
|
+
path_params=_path_params,
|
|
306
|
+
query_params=_query_params,
|
|
307
|
+
header_params=_header_params,
|
|
308
|
+
body=_body_params,
|
|
309
|
+
post_params=_form_params,
|
|
310
|
+
files=_files,
|
|
311
|
+
auth_settings=_auth_settings,
|
|
312
|
+
collection_formats=_collection_formats,
|
|
313
|
+
_host=_host,
|
|
314
|
+
_request_auth=_request_auth
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
|