This code showcases the Melissa Personator Consumer Cloud API using Python3.
Please feel free to copy or embed this code to your own project. Happy coding!
For the latest Melissa Personator Consumer release notes, please visit: https://releasenotes.melissa.com/cloud-api/personator-consumer/
For further documentation, please visit: https://docs.melissa.com/cloud-api/personator-consumer/personator-consumer-index.html
The console will ask the user for:
- AddressLine1
- City
- State
- Postal
- Country
And return information of the person such as:
- AddressExtras
- AddressKey
- AddressLine1
- AddressLine2
- City
- CompanyName
- EmailAddress
- Latitude
- Longitude
- MelissaAddressKey (MAK)
- MelissaAddressKeyBase
- NameFull
- PhoneNumber
- PostalCode
- RecordExtras
- Reserved
- Results
- State
- Windows 10 64-bit Python 3.10.4, Powershell 5.1
- Ubuntu Linux 20.04.04 LTS 64-bit Python 3.10.4
- Personator Consumer Cloud API Version 9.4.0.1358
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
git clone https://github.com/MelissaData/PersonatorConsumer-Python3
cd PersonatorConsumer-Python3
Before starting, make sure that Python3 has been correctly installed on your machine and your environment paths are configured.
You can download Python here: https://www.python.org/downloads/
To set up your Path to correctly to use the python3 command, execute the following steps:
-
Run Powershell as an administrator
-
Execute the command:
New-Item -ItemType SymbolicLink -Path "Link" -Target "Target"where "Target" is the path to py.exe (by default this should be "C:\Windows\py.exe")
and "Link" is the path to py.exe, but "py.exe" is replaced with "python3.exe"
For Example:
New-Item -ItemType SymbolicLink -Path "C:\Windows\python3.exe" -Target "C:\Windows\py.exe"
If you are unsure, you can check by opening a command prompt window and typing the following:
python3 --version
Parameters:
-
-addressline1: an input address line 1
-
-city: an input city
-
-state: an input state
-
-postal: an input postal code
-
-country: an input country
This is convenient when you want to get results for a specific person in one run instead of testing multiple records in interactive mode.
-
-license (optional): a license string to test the Cloud API
There are two modes:
-
Interactive
The script will prompt the user for input(s), then use the provided input(s) to call the Cloud API. For example:
.\PersonatorConsumerPython3.ps1 -
Command Line
You can pass address line 1, city, state, postal code, country, and a license string into
-addressline1,-city,-state,-postal,-country, and-licenseparameters respectively to test the Cloud API. For example:.\PersonatorConsumerPython3.ps1 -addressline1 "22382 Avenida Empresa" -city "Rancho Santa Margarita" -state "CA" -postal "92688" -country "United States" .\PersonatorConsumerPython3.ps1 -addressline1 "22382 Avenida Empresa" -city "Rancho Santa Margarita" -state "CA" -postal "92688" -country "United States" -license "<your_license_string>"
This is the expected output from a successful setup for interactive mode:
Before starting, check to see if you already have the Python3 already installed by entering this command:
python3 --version
If the Python3 is already installed, you should see it in the following list:
As long as the above list contains version 3.xx.xx (underlined in red), then you can skip to the next step. If your list does not contain version 3, or you get any kind of error message, then you will need to download and install Python3.
To download, run the following commands to add the Microsoft package signing key to your list of trusted keys and add the package repository.
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
Next, you can now run this command to install the Python3:
sudo apt-get update && \
sudo apt-get install -y python3
Once all of this is done, you should be able to verify that the Python3 is installed with the Python3 --version command.
Parameters:
-
--addressline1: an input address line 1
-
--city: an input city
-
--state: an input state
-
--postal: an input postal code
-
--country: an input country
This is convenient when you want to get results for a specific request in one run instead of testing multiple records in interactive mode.
-
--license (optional): a license string to test the Cloud API
There are two modes:
-
Interactive
The script will prompt the user for input(s), then use the provided input(s) to call the Cloud API. For example:
./PersonatorConsumerPython3.sh -
Command Line
You can pass address line 1, city, state, postal code, country, and license string into
--addressline1,--city,--state,--postal,--country, and--licenseparameters respectively to test the Cloud API. For example:./PersonatorConsumerPython3.sh --addressline1 "22382 Avenida Empresa" --city "Rancho Santa Margarita" --state "CA" --postal "92688" --country "United States" ./PersonatorConsumerPython3.sh --addressline1 "22382 Avenida Empresa" --city "Rancho Santa Margarita" --state "CA" --postal "92688" --country "United States" --license "<your_license_string>"
This is the expected output from a successful setup for interactive mode:
For details about the result codes please refer to https://docs.melissa.com/melissa/result-codes/result-codes-index.html
For free technical support, please call us at 800-MELISSA ext. 4 (800-635-4772 ext. 4) or email us at [email protected].
To purchase this product, contact the Melissa sales department at 800-MELISSA ext. 3 (800-635-4772 ext. 3).



