Package: python-fullcontact
FullContact ClientThe official python client library for FullContact V3 API. This client provides an interface to interact with Enrich,
Resolve, Tags, Audience, Verify and Permission APIs. FullContact API Documentation is available
at:https://platform.fullcontact.com/docsTable of contentsRequirementsAdding To Your ProjectInstallationMigrating from FullContact Client V1.0.0UsageImporting the clientBasic UsageClient ConfigurationPerson APIenrich()enrich_async()Company APIenrich()enrich_asyncResolve APImap()map_async()resolve()resolve_async()mapResolve()mapResolve_async()delete()delete_async()Tags APIget()get_async()create()create_async()delete()delete_async()Audiencecreate()create_async()download()download_async()Permissioncreatedeletefindcurrentverifypermission-asyncVerifymatchmatch_asyncsignalssignals_asyncactivityactivity_asyncRequirementsThis library requires Python 3.5 or above.Adding To Your ProjectTo add FullContact Python Client library to your project, add the below line to yourrequirements.txtfile, or as a
requirement in thesetup.pyfile.python-fullcontact==4.0.0InstallationIt is recommended to install the FullContact python client library fromPyPiusing the below
command.pip install python-fullcontactIf you'd like to install the development version (withpytest), run instead:pipinstall'python-fullcontact[develop]'It is also possible to install the package from this repo, by running the below commands.pip install git+https://github.com/fullcontact/fullcontact-python-client.gitMigrating from FullContact Client V1.0.0This version of FullContact Client (V2.0.0) has significant changes in terms of design and features. Hence, it is not
backward compatible with V1.0.0 library. However, migrating from the V1.0.0 client is very easy. In V1.0.0, there used
to be different clients for different APIs (PersonClient, CompanyClient). However with V2.0.0, we have only 1 client,
with different methods.V1.0.0fromfullcontactimportPersonClient,CompanyClientperson_client=PersonClient("<your_api_key>")company_client=CompanyClient("<your_api_key>")person_client.enrich(**query)company_client.enrich(**query)This would be changed as below in V2.0.0V2.0.0fromfullcontactimportFullContactClientfullcontact_client=FullContactClient("<your_api_key>")fullcontact_client.person.enrich(**query)fullcontact_client.company.enrich(**query)UsageImporting the clientThe client is available straight out of the packagefullcontact.fromfullcontactimportFullContactClientBasic UsageTo use the client library, you need to initialize the client using the API KEY that you have generated
fromFullContact Platform. Once initialized, the client provides
theEnrichandResolvecapabilities of the V3 FullContact API.fromfullcontactimportFullContactClientfullcontact_client=FullContactClient("<your_api_key>")# Person Enrichperson_enrich_result=fullcontact_client.person.enrich(email="marquitaross006@gmail.com")# Company Enrichcompany_enrich_result=fullcontact_client.company.enrich(domain="fullcontact.com")# Identity Mapidentity_map_result=fullcontact_client.identity.map(email="marquitaross006@gmail.com",recordId="customer123")# Identity Resolveidentity_resolve_result=fullcontact_client.identity.resolve(recordId="customer123")# Identity Map Resolveidentity_mapResolve_result=fullcontact_client.identity.mapResolve(email="marquitaross006@gmail.com",recordId="customer123",generatePid=True)# Identity Deleteidentity_delete_result=fullcontact_client.identity.delete(recordId="customer123")# Tags Gettags_get_result=fullcontact_client.tags.get(recordId="customer123")# Tags Createtags_create_result=fullcontact_client.tags.create(recordId="customer123",tags={"tag1":"value1","tag2":["value2","value3"]})# Tags Deletetags_delete_result=fullcontact_client.tags.create(recordId="customer123",tags={"tag2":"value2"})# Audience Createaudience_create_result=fullcontact_client.audience.create(webhookUrl="http://your_webhook_url/",tags={"tag1":"value1","tag2":"value2"})# Audience Downloadaudience_download_result=fullcontact_client.audience.download(requestId="<your_requestId>")audience_download_result.write_to_file("<output_file_path>")# Permission Createpermission_create_result=fullcontact_client.permission.create(query={"email":"marquitaross006@gmail.com"},consentPurposes=[{"purposeId":2,"channel":["web","phone","mobile","offline","email"],"ttl":1095,"enabled":True}],locale="US",language="en",collectionMethod="cookie",collectionLocation="US",policyUrl="https://www.fullcontact-test.com/services-privacy-policy/",termsService="https://www.fullcontact-test.com/content-policy/")# Permission Deletepermission_delete_result=fullcontact_client.permission.delete({"email":"marquitaross006@gmail.com"})# Permission Findpermission_find_result=fullcontact_client.permission.find(email="marquitaross006@gmail.com")# Permission Currentpermission_current_result=fullcontact_client.permission.current(email="marquitaross006@gmail.com")# Permission Verifypermission_verify_result=fullcontact_client.permission.verify(query={"email":"marquitaross006@gmail.com"},purposeId=6,channel="web")# Verify Matchverify_match_result=fullcontact_client.verify.match(email="marquitaross006@gmail.com")# Verify Signalsverify_signals_result=fullcontact_client.verify.signals(email="marquitaross006@gmail.com")# Verify Activityverify_activity_result=fullcontact_client.verify.activity(email="marquitaross006@gmail.com")Client ConfigurationThe FullContact Client allows the configuration of additional headers and retry related values, through init parameters.API KeyAPI Key is required to Authorize with FullContact API and hence, is a required parameter. This is set using
theapi_keyinit parameter forFullContactClient.fullcontact_client=FullContactClient("<your_api_key>")HeadersThe headersAuthorization,Content-TypeandUser-Agentare added automatically and cannot be overridden. Hence,
headers needs to be added only if any additional header needs to be passed to the API. One useful situation for this is
when you need to pass yourReporting-Key. The headers can be added by setting theheadersinit parameter
forFullContactClient.additional_headers={"Reporting-Key":"clientXYZ"}fullcontact_client=FullContactClient(api_key="<your_api_key>",headers=additional_headers)RetryBy default, the client retries a request if it receives a429or503status code. The default retry count is 1 and
the backoff factor (base delay) for exponential backoff is 1 second. Retry can by configured by setting
themax_retry_count,retry_status_codesandbase_delayinit parameters forFullContactClient. If the value provided formax_retry_countis greater than 5, it will be set to 5.fullcontact_client=FullContactClient(api_key="<your_api_key>",max_retry_count=3,retry_status_codes=(429,503,413),base_delay=2.5)MultiFieldRequestAbility to match on one or many input fields. The more contact data inputs you can provide, the better.
By providing more contact inputs, the more accurate and precise we can get with our identity resolution capabilities.email:stremails:List[str]phone:strphones:List[str]placekey:strlocation:dictaddressLine1:straddressLine2:strcity:strregion:strregionCode:strpostalCode:strname:dictfull:strgiven:strfamily:strprofiles:List[dict]service:strusername:struserid:strurl:strmaids:List[str]recordId:strpersonId:strli_nonid:strpartnerId:strpanoramaId:strFullContactClientclass:fullcontact.FullContactClientInit parameters:api_key:str- (required)headers:dict- [optional]max_retry_count:int[default=5]- [optional]retry_status_codes:List[int][default=(429, 503)]- [optional]base_delay:float[default=1.0]- [optional]Person APIThe client library provides methods to interact with V3 Person Enrich API throughFullContactClient.personobject. The
V3 Person Enrich API can be called synchronously usingenrich()and asynchronously
usingenrich_async(). Additional headers can be set on a per-request basis by
setting the parameterheaderswhile callingenrich()orenrich_async(). Being a request level parameter, this can be used to override
any header that has been set on the client level.Person Enrichment API Documentation:https://platform.fullcontact.com/docs/apis/enrich/multi-field-request# Synchronous executionenrich_response=fullcontact_client.person.enrich(email="marquitaross006@gmail.com")print(enrich_response.get_name())# Output: {'given': 'Marquita', 'family': 'Ross', 'full': 'Marquita H Ross'}# Asynchronous executionenrich_async_response=fullcontact_client.person.enrich_async(email="marquitaross006@gmail.com")enrich_result=enrich_async_response.result()print(enrich_result.get_name())# Output: {'given': 'Marquita', 'family': 'Ross', 'full': 'Marquita H Ross'}# Asynchronous execution using callbackdefprint_name_from_result(result:concurrent.Futures.Future):enrich_result=result.result()print(enrich_result.get_name())fullcontact_client.person.enrich_async(email="marquitaross006@gmail.com").add_done_callback(print_name_from_result)# Output: {'given': 'Marquita', 'family': 'Ross', 'full': 'Marquita H Ross'}FullContactClient.person.enrich()class:fullcontact.api.person_api.PersonApiParameters:**query:kwargs- (required)headers:dict- [optional]querytakes inMultiFieldReq. Other supported fields for query:webhookUrl:strconfidence:strdataFilter:List[str]infer:boolmaxMaids:intReturns:PersonEnrichResponseclass:fullcontact.response.person_response.PersonEnrichResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headersget_summary():dict- Summary from Person Enrich Responseget_details():dict- Details from Person Enrich Responseget_name():dict- Name from Person Enrich Responseget_age():dict- Age from Person Enrich Responseget_gender():str- Gender from Person Enrich Responseget_demographics():dict- Demographics from Person Enrich Responseget_emails():List[str]- Emails from Person Enrich Responseget_phones():List[str]- Phones from Person Enrich Responseget_profiles():List[dict]- Profiles from Person Enrich Responseget_locations():List[dict]- Locations from Person Enrich Responseget_employment():List[dict]- Employments from Person Enrich Responseget_photos():List[dict]- Photos from Person Enrich Responseget_education():List[dict]- Educationget_urls():List[dict]- URLs from Person Enrich Responseget_interests():List[dict]- Interests from Person Enrich Responseget_household():dict- Household details from Person Enrich Responseget_finance():dict- Finance details from Person Enrich Responseget_census():dict- Census details from Person Enrich Responseget_identifiers():dict- Identifiers from Person Enrich Responseget_extended():dict- All Extended dataFullContactClient.person.enrich_async()class:fullcontact.api.person_api.PersonApiSame as that ofFullContactClient.person.enrich()Returns:Future[PersonEnrichResponse]class:concurrent.Futures.FutureMore onconcurrent.Futures.Future:https://docs.python.org/3/library/concurrent.futures.html#future-objectsUseful Methods:result():PersonEnrichResponse-PersonEnrichResponseobject received once execution is
completedadd_done_callback(fn):None- Add a callback function to be executed on successful execution.Company APIThe client library provides methods to interact with V3 Company Enrich API
throughFullContactClient.companyobject. The V3 Company Enrich API can be called synchronously
usingenrich()and asynchronously
usingenrich_async().
Additional headers can be set on a per-request basis by
setting the parameterheaderswhile callingenrich())Being a request level parameter, this can be used to override any header that has been set on the client level.Company Enrichment API Documentation:https://platform.fullcontact.com/docs/apis/enrich/company-enrichment# Synchronous enrich executionenrich_response=fullcontact_client.company.enrich(domain="fullcontact.com")print(enrich_response.get_summary())""" Output: {'name': 'FullContact Inc','location': '1755 Blake Street Suite 450 Denver CO, 80202 USA','twitter': 'https://twitter.com/fullcontact','linkedin': 'https://www.linkedin.com/company/fullcontact-inc-','facebook': None,'bio': "Solving the world's contact information problem!",'logo': 'https://img.fullcontact.com/static/7329d91237b7970b984d56c2497c80c0_7abd96cd75e5587b39b9f15dce07d7ebe8dc31accecf1b0f2a617ada34498633','website': 'https://www.fullcontact.com','founded': 2010,'employees': 300,'locale': 'en','category': 'Other','updated': '2020-05-31'} """# Asynchronous enrich executionenrich_async_response=fullcontact_client.company.enrich_async(domain="fullcontact.com")enrich_result=enrich_async_response.result()print(enrich_result.get_summary())FullContactClient.company.enrich()class:fullcontact.api.company_api.CompanyApiParameters:**query:kwargs- (required)headers:dict- [optional]Supported fields for query:domain:strwebhookUrl:strReturns:CompanyEnrichResponseclass:fullcontact.response.company_response.CompanyEnrichResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headersget_summary():dict- Summary from Company Enrich Responseget_details():dict- Details from Company Enrich ResponseFullContactClient.company.enrich_async()class:fullcontact.api.company_api.CompanyClientParameters:Same as that ofFullContactClient.company.enrich()Returns:Future[CompanyEnrichResponse]class:concurrent.Futures.FutureMore onconcurrent.Futures.Future:https://docs.python.org/3/library/concurrent.futures.html#future-objectsUseful Methods:result():CompanyEnrichResponse-CompanyEnrichResponseobject received once execution
is completedadd_done_callback(fn):None- Add a callback function to be executed on successful execution.Resolve APIThe client library provides methods to interact with V3 Resolve API (identity.map,identity.resolve,identity.mapResolve,
andidentity.deleteendpoints) throughFullContactClient.identityobject. The V3 Resolve API can be accessed using
the methodsmap(),resolve(),mapResolve(),
anddelete(), respectively. These APIs can be accessed using the async version these
functions,map_async(),resolve_async(),mapResolve_async(),
anddelete_async(). Additional headers can be set on a per-request basis by
setting the parameterheaderswhile calling these methods.Being a request level parameter, this can be used to override any header that has been set on the client level.Resolve API Documentation:https://platform.fullcontact.com/docs/apis/resolve/multi-field-request# Synchronous map executionmap_response=fullcontact_client.identity.map(email="marquitaross006@gmail.com",recordId="customer123")print(map_response.get_recordIds())# Output: ['customer123']# Synchronous resolve executionresolve_response=fullcontact_client.identity.resolve(email="marquitaross006@gmail.com")print(resolve_response.get_recordIds())# Output: ['customer123']# Synchronous mapResolve executionmapResolve_response=fullcontact_client.identity.mapResolve(email="marquitaross006@gmail.com",recordId="customer123")print(mapResolve_response.get_recordIds())print(mapResolve_response.get_personIds())# Output:# ['customer123']# ['OdcKOTonyt5diGjjf-CXHrn84Zr_PcPGmqj1NYSiCR_U-J7v']# Synchronous delete executiondelete_response=fullcontact_client.identity.delete(recordId="customer123")print(delete_response.is_successful)# Output: True# Asynchronous map executionmap_async_response=fullcontact_client.identity.map_async(email="marquitaross006@gmail.com",recordId="customer123")map_response=map_async_response.result()print(map_response.get_recordIds())# Output: ['customer123']# Asynchronous resolve executionresolve_async_response=fullcontact_client.identity.resolve_async(email="marquitaross006@gmail.com")resolve_response=resolve_async_response.result()print(resolve_response.get_recordIds())# Output: ['customer123']# Asynchronous mapResolve executionmapResolve_async_response=fullcontact_client.identity.mapResolve_async(email="marquitaross006@gmail.com",recordId="customer123")mapResolve_response=mapResolve_async_response.result()print(mapResolve_response.get_recordIds())# Output: ['customer123']# Asynchronous delete executiondelete_async_response=fullcontact_client.identity.delete_async(recordId="customer123")delete_response=delete_async_response.result()print(delete_response.is_successful)# Output: TrueFullContactClient.identity.map()class:fullcontact.api.resolve_api.ResolveClientParameters:**fields:kwargs- (required)headers:dict- [optional]fieldstakes inMultiFieldReq. Other supported fields for mapping:tags:List[str]generatePid: boolReturns:IdentityMapResponseclass:fullcontact.response.resolve_response.IdentityMapResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headersget_recordIds():List[str]- List of recordIds from Map responseFullContactClient.identity.map_async()class:fullcontact.api.resolve_api.ResolveClientParameters:Same as that ofFullContactClient.identity.map()Returns:Future[IdentityMapResponse]class:concurrent.Futures.FutureMore onconcurrent.Futures.Future:https://docs.python.org/3/library/concurrent.futures.html#future-objectsUseful Methods:result():IdentityMapResponse-IdentityMapResponseobject received once execution is
completedadd_done_callback(fn):None- Add a callback function to be executed on successful execution.FullContactClient.identity.resolve()class:fullcontact.api.resolve_api.ResolveApiParameters:**fields:kwargs- (required)include_tags: `bool- [optional]Ifinclude_tagsis set to True, the response will include tags in the response.headers:dict- [optional]Supported fields for mapping:
Same as that ofFullContactClient.identity.map(), but with one more extra fieldpersonId:strNote: recordId and personId cannot be used together to resolve. Only one of these fields can be used in a request.Returns:IdentityResolveResponseclass:fullcontact.response.resolve_response.IdentityResolveResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headersget_recordIds():List[str]- List of recordIds from Resolve responseget_personIds():List[str]- List of personIds from Resolve responseget_partnerIds():List[str]- List of partnerIds from Resolve responseget_tags():Dict- A dict of tags, ifinclude_tagswas set to True in the requestFullContactClient.identity.resolve_async()class:fullcontact.api.resolve_api.ResolveApiParameters:Same as that ofFullContactClient.identity.resolve()Returns:Future[IdentityResolveResponse]class:concurrent.Futures.FutureMore onconcurrent.Futures.Future:https://docs.python.org/3/library/concurrent.futures.html#future-objectsUseful Methods:result():IdentityResolveResponse-IdentityResolveResponseobject received once
execution is completedadd_done_callback(fn):None- Add a callback function to be executed on successful execution.FullContactClient.identity.mapResolve()class:fullcontact.api.resolve_api.ResolveClientParameters:**fields:kwargs- (required)headers:dict- [optional]fieldstakes inMultiFieldReq. Other supported fields for mapping:tags:List[str]generatePid: boolReturns:IdentityResolveResponseclass:fullcontact.response.resolve_response.IdentityResolveResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headersget_recordIds():List[str]- List of recordIds from Map responseFullContactClient.identity.mapResolve_async()class:fullcontact.api.resolve_api.ResolveClientParameters:Same as that ofFullContactClient.identity.mapResolve()Returns:Future[IdentityResolveResponse]class:concurrent.Futures.FutureMore onconcurrent.Futures.Future:https://docs.python.org/3/library/concurrent.futures.html#future-objectsUseful Methods:result():IdentityResolveResponse-IdentityResolveResponseobject received once execution is
completedadd_done_callback(fn):None- Add a callback function to be executed on successful execution.FullContactClient.identity.delete()class:fullcontact.api.resolve_api.ResolveApiParameters:recordId:str- (required)headers:dict- [optional]Returns:IdentityDeleteResponseclass:fullcontact.response.resolve_response.IdentityDeleteResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dict. Empty dict will be returned on successful delete.get_message():str- Response message or HTTP status messageget_headers():dict- Response headersFullContactClient.identity.delete_async()class:fullcontact.api.resolve_api.ResolveApiParameters:Same as that ofFullContactClient.identity.delete()Returns:Future[IdentityDeleteResponse]class:concurrent.Futures.FutureMore onconcurrent.Futures.Future:https://docs.python.org/3/library/concurrent.futures.html#future-objectsUseful Methods:result():IdentityDeleteResponse-IdentityDeleteResponseobject received once
execution is completedadd_done_callback(fn):None- Add a callback function to be executed on successful execution.Tags APIThe client library provides methods to interact with Customer Tags API (tags.get,tags.createandtags.deleteendpoints) throughFullContactClient.tagsobject. The Tags API can be accessed using the
methodsget(),create()anddelete(), respectively. These APIs can be accessed using the async version these
functions,get_async(),create_async()anddelete_async(). Additional headers can be set on a per-request basis by
setting the parameterheaderswhile calling these methods.Being a request level parameter, this can be used to override any header that has been set on the client level.Tags API Documentation:https://platform.fullcontact.com/docs/apis/resolve/customer-tags# Synchronous create executioncreate_response=fullcontact_client.tags.create(recordId="customer123",tags={"segment":"highspender"})print(create_response.json())# Output: {'recordId': 'customer123', 'tags': [{'key': 'segment', 'value': 'highspender'}]}# Synchronous get executionget_response=fullcontact_client.tags.get(recordId="customer123")print(get_response.get_tags())# Output: {'segment': ['highspender']}# Synchronous delete executiondelete_response=fullcontact_client.tags.delete(recordId="customer123",tags={"segment":"highspender"})print(delete_response.get_status_code())# Output: 204# Asynchronous create executioncreate_async_response=fullcontact_client.tags.create_async(recordId="customer123",tags={"segment":"highspender"})create_response=create_async_response.result()print(create_response.json())# Output: {'recordId': 'customer123', 'tags': [{'key': 'segment', 'value': 'highspender'}]}# Asynchronous get executionget_async_response=fullcontact_client.tags.get_async(recordId="customer123")get_response=get_async_response.result()print(get_response.get_tags())# Output: {'segment': ['highspender']}# Asynchronous delete executiondelete_async_response=fullcontact_client.tags.delete_async(recordId="customer123",tags={"segment":"highspender"})delete_response=delete_async_response.result()print(delete_response.get_status_code())# Output: 204FullContactClient.tags.create()class:fullcontact.api.tags_api.TagsApiParameters:recordId:str- (required)tags:dict- (required)Tags dict has to be in the format {tag1_key: tag1_value, tag2_key: [tag2_value1, tag2_value2], ...}. Tag value can be a string or a list of strings to support multiple values.headers:dict- [optional]Returns:TagsCreateResponseclass:fullcontact.response.tags_response.TagsCreateResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headersFullContactClient.tags.create_async()class:fullcontact.api.tags_api.TagsApiParameters:Same as that ofFullContactClient.tags.create()Returns:Future[TagsCreateResponse]class:concurrent.Futures.FutureMore onconcurrent.Futures.Future:https://docs.python.org/3/library/concurrent.futures.html#future-objectsUseful Methods:result():TagsCreateResponse-TagsCreateResponseobject received once execution is
completedadd_done_callback(fn):None- Add a callback function to be executed on successful execution.FullContactClient.tags.get()class:fullcontact.api.tags_api.TagsApiParameters:**identifiers:kwargs- (required)headers:dict- [optional]Supportedidentifiersto get tags:recordId:strpartnerId:strReturns:TagsGetResponseclass:fullcontact.response.tags_response.TagsGetResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headersget_tags():dict- Tags from the response in format{tag1_key: tag1_value, tag2_key, tag2_value, ...}get_recordId():str-recordIdfrom the responseget_partnerId():str-partnerIdfrom the responseFullContactClient.tags.get_async()class:fullcontact.api.tags_api.TagsApiParameters:Same as that ofFullContactClient.tags.get()Returns:Future[TagsGetResponse]class:concurrent.Futures.FutureMore onconcurrent.Futures.Future:https://docs.python.org/3/library/concurrent.futures.html#future-objectsUseful Methods:result():TagsGetResponse-TagsGetResponseobject received once execution is completedadd_done_callback(fn):None- Add a callback function to be executed on successful execution.FullContactClient.tags.delete()class:fullcontact.api.tags_api.TagsApiParameters:recordId:str- (required)tags:dict- (required)Tags dict has to be in the format {tag1_key: tag1_value, tag2_key: tag2_value, ...}headers:dict- [optional]Returns:TagsDeleteResponseclass:fullcontact.response.tags_response.TagsDeleteResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dict. Empty dict will be returned on successful delete.get_message():str- Response message or HTTP status messageget_headers():dict- Response headersFullContactClient.tags.delete_async()class:fullcontact.api.tags_api.TagsApiParameters:Same as that ofFullContactClient.tags.delete()Returns:Future[TagsDeleteResponse]class:concurrent.Futures.FutureMore onconcurrent.Futures.Future:https://docs.python.org/3/library/concurrent.futures.html#future-objectsUseful Methods:result():TagsDeleteResponse-TagsDeleteResponseobject received once execution is
completedadd_done_callback(fn):None- Add a callback function to be executed on successful execution.Audience APIThe client library provides methods to interact with Audience Tags API (audience.createandaudience.downloadendpoints) throughFullContactClient.audienceobject. The Audience API can be accessed using the
methodscreate()anddownload(), respectively.
These APIs can be accessed using the async version these
functions,create_async()anddownload_async(). Additional headers can be set on a per-request basis
by setting the parameterheaderswhile calling these methods.Being a request level parameter, this can be used to override any header that has been set on the client level.Tags API Documentation:https://platform.fullcontact.com/docs/apis/resolve/customer-tags# Synchronous create executioncreate_response=fullcontact_client.audience.create(webhookUrl="http://your_webhookUrl/",tags={"segment":"highspender"})print(create_response.json())# Output: {'requestId': 'c7273de7-e717-4cab-9fe0-213ab3796636'}# Synchronous download executiondownload_response=fullcontact_client.audience.download(requestId="c7273de7-e717-4cab-9fe0-213ab3796636")download_response.write_to_file("/path/to/output_file.json.gz")print(download_response.get_status_code())# Output: 200# Asynchronous create executioncreate_async_response=fullcontact_client.audience.create(webhookUrl="http://your_webhookUrl/",tags={"segment":"highspender"})create_response=create_async_response.result()print(create_response.json())# Output: {'requestId': 'c7273de7-e717-4cab-9fe0-213ab3796636'}# Asynchronous download executiondownload_async_response=fullcontact_client.audience.download_async(requestId="c7273de7-e717-4cab-9fe0-213ab3796636")download_response=download_async_response.result()download_response.write_to_file("/path/to/output_file.json.gz")print(download_response.get_status_code())# Output: 200FullContactClient.audience.create()class:fullcontact.api.tags_api.AudienceApiParameters:webhookUrl:str- (required)tags:dict- (required)Tags dict has to be in the format {tag1_key: tag1_value, tag2_key: tag2_value, ...}headers:dict- [optional]Returns:AudienceCreateResponseclass:fullcontact.response.audience_response.AudienceCreateResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headersget_requestId():str-requestIdcreated for the requestFullContactClient.audience.create_async()class:fullcontact.api.audience_api.AudienceApiParameters:Same as that ofFullContactClient.audience.create()Returns:Future[AudienceCreateResponse]class:concurrent.Futures.FutureMore onconcurrent.Futures.Future:https://docs.python.org/3/library/concurrent.futures.html#future-objectsUseful Methods:result():AudienceCreateResponse-AudienceCreateResponseobject received once
execution is completedadd_done_callback(fn):None- Add a callback function to be executed on successful execution.FullContactClient.audience.download()class:fullcontact.api.audience_api.AudienceApiParameters:requestId:str- (required)headers:dict- [optional]Returns:AudienceDownloadResponseclass:fullcontact.response.audience_response.AudienceDownloadResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headerswrite_to_file(file):bool- Writes the downloaded file contents to the input file/fileObjParamfile:str/FileObject- It can the path to a file as string or a bytes writable file object. The file
will be of format.json.gzif the download was successful. This can be confirmed using theis_successfulflag.An easy way to create a bytes writable file object is by using io.BytesIOFullContactClient.audience.download_async()class:fullcontact.api.audience_api.AudienceApiParameters:Same as that ofFullContactClient.audience.download()Returns:Future[AudienceDownloadResponse]class:concurrent.Futures.FutureMore onconcurrent.Futures.Future:https://docs.python.org/3/library/concurrent.futures.html#future-objectsUseful Methods:result():AudienceDownloadResponse-AudienceDownloadResponseobject received once
execution is completedadd_done_callback(fn):None- Add a callback function to be executed on successful execution.Permission APIThe client library provides methods to interact with Permission
throughFullContactClient.permissionobject. Additional headers can be set on a per-request basis
by setting the parameterheaderswhile calling these methods.Being a request level parameter, this can be used to override any header that has been set on the client level.Permission APIs Documentation:https://platform.fullcontact.com/docs/apis/permission/introductionclass:fullcontact.api.permission_api.PermissionApi# Synchronous create executionpermission_create_response=fullcontact_client.permission.create(query={"email":"cutomer1@fullcontact.com"},consentPurposes=[{"purposeId":2,"channel":["web","phone","mobile","offline","email"],"ttl":1095,"enabled":True},{"purposeId":5,"channel":["web","phone","mobile","offline","email"],"ttl":1095,"enabled":True}],locale="US",language="en",collectionMethod="cookie",collectionLocation="US",policyUrl="https://www.fullcontact-test.com/services-privacy-policy/",termsService="https://www.fullcontact-test.com/content-policy/")print(permission_create_response.get_status_code())# Output: 202# Synchronous delete executionpermission_delete_response=fullcontact_client.permission.delete(query={"email":"cutomer1@fullcontact.com"})print(permission_delete_response.get_status_code())# Output: 202# Synchronous find executionpermission_find_response=fullcontact_client.permission.find(query={"email":"cutomer1@fullcontact.com"})print(permission_find_response.json())'''Output:[{"permissionType": "create","permissionId": "0089ced6-eaa8-4ac4-a6b2-de9d16928461","consentPurposes": [{"ttl": null,"enabled": True,"channel": "web","purposeId": 6,"purposeName": "Content selection, delivery & reporting","timestamp": 1614855618604}],"locale": "US","ipAddress": "127.0.0.1","language": "en","collectionMethod": "cookie","collectionLocation": "ae","policyUrl": "https://www.fullcontact-test.com/services-privacy-policy/","termsService": "https://www.fullcontact-test.com/content-policy/","timestamp": None,"created": 1614855618604},{"permissionType": "delete","permissionId": "0089ced6-eaa8-4ac4-a6b2-de9d169284rt4","consentPurposes": [{"ttl": null,"enabled": True,"channel": "web","purposeId": 2,"purposeName": "Content selection, delivery & reporting","timestamp": 1614855618607}],"locale": "US","ipAddress": "127.0.0.1","language": "en","collectionMethod": "cookie","collectionLocation": "ae","policyUrl": "https://www.fullcontact-test.com/services-privacy-policy/","termsService": "https://www.fullcontact-test.com/content-policy/","timestamp": None,"created": 1614855618607}]'''# Synchronous Current executionpermission_current_response=fullcontact_client.permission.current(query={"email":"cutomer1@fullcontact.com"})print(permission_current_response.json())'''Output:{"3": {"offline": {"ttl": 1095,"enabled": True,"channel": "offline","purposeId": 3,"purposeName": "Personalized Content Profile","timestamp": 1614837134541},"phone": {"ttl": 1095,"enabled": True,"channel": "phone","purposeId": 3,"purposeName": "Personalized Content Profile","timestamp": 1614837134541},"mobile": {"ttl": 1095,"enabled": True,"channel": "mobile","purposeId": 3,"purposeName": "Personalized Content Profile","timestamp": 1614837134541},"email": {"ttl": 1095,"enabled": True,"channel": "email","purposeId": 3,"purposeName": "Personalized Content Profile","timestamp": 1614837134541}},"6": {"web": {"ttl": null,"enabled": True,"channel": "web","purposeId": 6,"purposeName": "Content selection, delivery & reporting","timestamp": 1614856047618}}}'''# Synchronous Verify executionpermission_verify_response=fullcontact_client.permission.verify(query={"email":"cutomer1@fullcontact.com"},purposeId=6,channel="web")print(permission_verify_response.json())'''Output:{"ttl": 1024,"enabled": true,"channel": "web","purposeId": 6,"purposeName": "Content selection, delivery & reporting","timestamp": 1614856047613}'''FullContactClient.permission.create()class:fullcontact.schema.permission_schema.PermissionCreateRequestSchemaParameters:**query:kwargs- [required]headers:dict- [optional]Supported fields inquery:query:MultifieldReq- [required]consentPurposes: List[PurposeRequestSchema] - [required]locale: stripAddress: strlanguage: strcollectionMethod: str - [required]collectionLocation: str - [required]policyUrl: str - [required]termsService: str - [required]tcf: strtimestamp: intPurposeRequestSchemapurposeId: int - [required]channel: List[str]ttl: intenabled: bool  - [required]Returns:class:fullcontact.response.permission_response.PermissionCreateResponseA basic API response with response code as202if successful.Instance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headersFullContactClient.permission.delete()class:fullcontact.schema.permission_schema.PermissionDeleteRequestSchemaParameters:**query:kwargs- [required]headers:dict- [optional]querytakes aMultiFieldReqReturns:class:fullcontact.response.permission_response.PermissionDeleteResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headersFullContactClient.permission.find()class:fullcontact.schema.permission_schema.PermissionFindRequestSchemaParameters:**query:kwargs- [required]headers:dict- [optional]querytakes aMultiFieldReqReturns:class:fullcontact.response.permission_response.PermissionFindResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headersFullContactClient.permission.current()class:fullcontact.schema.permission_schema.PermissionCurrentRequestSchemaParameters:same as that ofFullContactClient.permission.find()Returns:class:fullcontact.response.permission_response.PermissionCurrentResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headersget_consent_for_purposeId(self, purposeId: int):dict- of Consent set for the purposeIdFullContactClient.permission.verify()class:fullcontact.schema.permission_schema.PermissionVerifyRequestSchemaParameters:**query:kwargs- [required]headers:dict- [optional]Supported fields inquery:query:MultifieldReq- [required]purposeId: int - [required]channel: str - [required]Returns:class:fullcontact.response.permission_response.PermissionVerifyResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headersPermission APIs Asynchronous methodsClient Library also support corresponding async methods for Permission APIs such as:permission.create_async()permission.delete_async()permission.find_async()permission.current_async()permission.verify_async()All these takes same parameters as their synchronous counterparts but return aFutureinstead.class:concurrent.Futures.FutureMore onconcurrent.Futures.Future:https://docs.python.org/3/library/concurrent.futures.html#future-objectsVerify APIThe client library provides methods to interact with V3 Verfiy API (verify.match,verify.signalsandverify.activityendpoints) throughFullContactClient.verifyobject. The V3 Verify API can be accessed using
the methodsmatch(),signals()andactivity(), respectively. These APIs can be accessed using the async version these
functions,match_async(),signals_async()andactivity_async(). Additional headers can be set on a per-request basis by
setting the parameterheaderswhile calling these methods.Being a request level parameter, this can be used to override any header that has been set on the client level.Verify API Documentation:https://docs.fullcontact.com/docs/verify-overview# Synchronous match executionmatch_response=fullcontact_client.verify.match(email="bart.lorang@fullcontact.com")print(match_response.json())# Output: {'email': True}# Synchronous signals executionsignals_response=fullcontact_client.verify.signals(email="marquitaross006@gmail.com")print(signals_response.json())'''Output:{ 'personIds': ['L0yG2Mp8Z4TVHxJK92GAxjWsTX6lrSfMBsQKvRsy5NzKnTm6'],'maids': [{'id': '0N3ZIUBF-RPCI-GO59-O29M-S3I3U0A8I9WUN', 'type': 'idfa', 'firstSeenMs': 0, 'lastSeenMs': 0, 'observations': 1, 'confidence': 1.0}],'name': {'givenName': 'Marquita', 'familyName': 'Ross'},'nonIds': [{'id': '0C-83f57c786a0b_-4a39efab23731c7EBC', 'firstSeenMs': 0, 'lastSeenMs': 0, 'observations': 1, 'confidence': 1.0}],'socialProfiles': {'twitterUrl': 'https://twitter.com/marqross91', 'linkedInUrl': 'https://www.linkedin.com/in/marquita-ross-5b6b72192'},'demographics': {'age': 42, 'ageRange': '40-49', 'gender': 'Female'},'employment': {'current': True, 'company': 'Mostow Co.', 'title': 'Senior Petroleum Manager'}}'''# Synchronous activity executionactivity_response=fullcontact_client.verify.activity(email="bart.lorang@fullcontact.com")print(activity_response.json())# Output: {'emails': 0.03}# Asynchronous match executionmatch_async_response=fullcontact_client.verify.match_async(email="bart.lorang@fullcontact.com")match_response=match_async_response.result()print(match_response.json())# Output: {'email': True}# Asynchronous signals executionsignals_async_response=fullcontact_client.verify.signals_async(email="marquitaross006@gmail.com")signals_response=signals_async_response.result()print(signals_response.json())'''Output:{ 'personIds': ['L0yG2Mp8Z4TVHxJK92GAxjWsTX6lrSfMBsQKvRsy5NzKnTm6'],'maids': [{'id': '0N3ZIUBF-RPCI-GO59-O29M-S3I3U0A8I9WUN', 'type': 'idfa', 'firstSeenMs': 0, 'lastSeenMs': 0, 'observations': 1, 'confidence': 1.0}],'name': {'givenName': 'Marquita', 'familyName': 'Ross'},'nonIds': [{'id': '0C-83f57c786a0b_-4a39efab23731c7EBC', 'firstSeenMs': 0, 'lastSeenMs': 0, 'observations': 1, 'confidence': 1.0}],'socialProfiles': {'twitterUrl': 'https://twitter.com/marqross91', 'linkedInUrl': 'https://www.linkedin.com/in/marquita-ross-5b6b72192'},'demographics': {'age': 42, 'ageRange': '40-49', 'gender': 'Female'},'employment': {'current': True, 'company': 'Mostow Co.', 'title': 'Senior Petroleum Manager'}}'''# Asynchronous activity executionactivity_async_response=fullcontact_client.verify.activity_async(email="bart.lorang@fullcontact.com")activity_response=activity_async_response.result()print(activity_response.json())# Output: {'emails': 0.03}FullContactClient.verify.match()class:fullcontact.api.verify_api.VerifyClientParameters:**query:kwargs- (required)headers:dict- [optional]querytakes inMultiFieldReq.Returns:VerifyMatchResponseclass:fullcontact.response.verify_response.MatchResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headersget_city():bool- city flag from Verify Match Responseget_region():bool- region flag from Verify Match Responseget_country():bool- country flag from Verify Match Responseget_continent():bool- continent flag from Verify Match Responseget_postalCode():bool- postalCode flag from Verify Match Responseget_familyName():bool- familyName flag from Verify Match Responseget_givenName():bool- givenName flag from Verify Match Responseget_phone():bool- phone flag from Verify Match Responseget_maid():bool- maid flag from Verify Match Responseget_email():bool- email flag from Verify Match Responseget_social():bool- social flag from Verify Match Responseget_nonId():bool- nonId flag from Verify Match ResponseFullContactClient.verify.match_async()class:fullcontact.api.verify_api.VerifyClientParameters:Same as that ofFullContactClient.verify.match()Returns:Future[VerifyMatchResponse]class:concurrent.Futures.FutureMore onconcurrent.Futures.Future:https://docs.python.org/3/library/concurrent.futures.html#future-objectsUseful Methods:result():VerifyMatchResponse-VerifyMatchResponseobject received once execution is
completedadd_done_callback(fn):None- Add a callback function to be executed on successful execution.FullContactClient.verify.signals()class:fullcontact.api.verify_api.VerifyClientParameters:**query:kwargs- (required)headers:dict- [optional]querytakes inMultiFieldReq.Returns:VerifySignalsResponseclass:fullcontact.response.verify_response.VerifySignalResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headersget_personIds(): List[str] - List of personIds from Signals responseget_name():dict- Name from Verify Signals responseget_emails(): List[dict] - List of email objects from Verify Signals responseget_phones(): List[dict] - List of phone objects from Verify Signals responseget_maids(): List[dict] - List of maids objects from Verify Signals responseget_nonIds(): List[dict] - List of nonIds objects from Verify Signals responseget_panoIds(): List[dict] - List of panoIds objects from Verify Signals responseget_ipAddresses(): List[dict] - List of ipAddress objects from Verify Signals responseget_socialProfiles(): List[str] - List of Social Profiles from Verify Signals responseget_demographics():dict- Demographics from Verify Signals responseget_employment():dict- Employment from Verify Signals responseget_locations(): List[dict] - List of location object from Verify Signals responseFullContactClient.verify.signals_async()class:fullcontact.api.verify_api.VerifyClientParameters:Same as that ofFullContactClient.verify.signals()Returns:Future[VerifySignalsResponse]class:concurrent.Futures.FutureMore onconcurrent.Futures.Future:https://docs.python.org/3/library/concurrent.futures.html#future-objectsUseful Methods:result():VerifySignalsResponse-VerifySignalsResponseobject received once
execution is completedadd_done_callback(fn):None- Add a callback function to be executed on successful execution.FullContactClient.verify.activity()class:fullcontact.api.verify_api.VerifyClientParameters:**query:kwargs- (required)headers:dict- [optional]querytakes inMultiFieldReq.Returns:VerifyActivityResponseclass:fullcontact.response.verify_response.VerifyActivityResponseInstance variablesis_successful:bool- Success flagresponse:requests.Response- Rawrequests.ResponseobjectMethods:json():dict- Response JSON as dictget_message():str- Response message or HTTP status messageget_headers():dict- Response headersget_emails():float- email activity score from Verify Activity ResponseFullContactClient.verify.activity_async()class:fullcontact.api.verify_api.VerifyClientParameters:Same as that ofFullContactClient.verify.activity()Returns:Future[VerifyActivityResponse]class:concurrent.Futures.FutureMore onconcurrent.Futures.Future:https://docs.python.org/3/library/concurrent.futures.html#future-objectsUseful Methods:result():VerifyActivityResponse-VerifyActivityResponseobject received once execution is
completedadd_done_callback(fn):None- Add a callback function to be executed on successful execution.