Other#
Best Practices#
To ensure fresh data, it is best to schedule automatic downloads to update application files, including checks for new releases and updates, on a regular basis (e.g. daily).
Use the File Hash Endpoint to ensure the integrity of file downloads.
Hash Verification#
It is recommended to script these commands in your language of choice to automatically run these checks after a file download.
FOR WINDOWS#
To determine file hash after download,
Open Windows Powershell
Type Command:
Get-FileHash -Algorithm SHA256 “filePath\filename.ext”
Filename.ext should be replaced with the desired file name and path.
Here, SHA256 can be replaced with the desired hash format.
After pressing enter, the command will return the file hash.
For example:
Algorithm Hash Path
--------- ---- ----
SHA256 3B50ACC702A31188D0913EF8BF92068199E39D3D9F72553E3F87C2910F432897 E:\Temp\melissadocs\source\re...
To compare, use the hash value endpoints for your file. Each endpoint is specified for either a data file, language interface file or a binary download. If these hash values match, your download was successful and the files were not corrupted.
FOR LINUX#
To determine file hash after download,
Open the Command Line.
Type in Command:
sha256sum <file_name>
file_name should be replaced with the desired file name.
Here, sha1sum can be replaced with the desired hash format.
After pressing enter, the command will return the file hash.
For example:
c429e37bdcfb8b49f4f61ca2ffa0fe747030f3cd683122eabaec67a31bc46724.
To verify the hash, use the hash value endpoints for your file. Each endpoint is specified for either a data file, language interface file or a binary download. If these hash values match, your download was successful and the files were not corrupted.
Basic Order of Operations#
Scripted File Download#
Melissa Releases is recommended for scripted file downloads, an efficient method to ensure fresh data and file updates from Melissa.
To get started:
Get set up with a Melissa Customer ID. This will be needed to access files.
Determine the release and manifest name of the file in which you’d like to download. It is recommended to be included in the script, to ensure the retrieval of the latest files. This can be done by:
Using the Retrieve Available Release Version Numbers for Manifest endpoint to determine the desired release.
Using the Retrieve a List of Manifests from a Specific Release Version Number endpoint to retrieve a list of all manifests associated with a release. To find the latest release, enter in LATEST for the release parameter.
After determining the desired release and manifest name, use the Retrieve a List of Files from a Specific Manifest endpoint to retrieve REST requests to download files corresponding to the release and manifest name.
OR
To find the desired release, architecture, OS, language interface, compiler and filename, go to the Use it from a Web Browser. You may download the file directly, or for scripted use.
For data files, use the Download Data File endpoint.
For a binary file download, use the Download Binary File endpoint.
For language interface files, use the Download Language Interface File endpoint.
Tutorial#
Address Object#
To fully update Address Object, we will need to download necessary data files as well any object wrappers/DLLS, if they have been updated. In this use case, we will download the address object binary as well as the address object data file.
1. Determine Release for Desired Manifest#
To retrieve the latest data, here we will determine the latest release, utilizing the Retrieve Available Release Version Numbers for Manifest endpoint. In this case, we are specifically looking at dq_addr_bins
and dq_addr_data
.
You may want to schedule a call to this endpoint on a regular basis (e.g. daily) to check for updates.
To access this endpoint, use the following GET requests [view template].
https://releases.melissadata.com/manifestReleases/dq_addr_bins?id={{customerId}}&format=json
https://releases.melissadata.com/manifestReleases/dq_addr_data?id={{customerId}}&format=json
Upon successful submission, you will receive a list of releases available for the manifest. The last date listed will be the latest release, and will be used to download the files needed.
Here is an example of the output, in JSON:
[
"2022.10",
"2022.11",
"2022.12"
"2023.01"
]
2. Retrieve Links to Download Files for Target Manifest#
After determining the latest release, use the Manifest List endpoint, to retrieve links to download files for the target manifest. Again, we specifically want to update the Address Object in this use case.
To access this endpoint, use the following GET requests [view template].
https://releases.melissadata.com/Manifest/LATEST/dq_addr_bins?id={{customerId}}&format=json
https://releases.melissadata.com/Manifest/LATEST/dq_addr_data?id={{customerId}}&format=json
You may also use LATEST for the release parameter, to download entire manifests. However, it is not recommended for individual files; there may be conflicts.
Upon successful submission for both endpoints, you will receive a list of download links for Address Object files.
Here is an example of the output in JSON, for dq_addr_bins
:
[
"https://releases.melissadata.net/Download/Library/LINUX/GCC48/64BIT/LATEST/libmdAddr.so/?id={{customerId}}",
"https://releases.melissadata.net/Download/Library/WINDOWS/DLL/32BIT/LATEST/mdAddr.dll/?id={{customerId}}",
"https://releases.melissadata.net/Download/Library/WINDOWS/DLL/64BIT/LATEST/mdAddr.dll/?id={{customerId}}"
]
The output will include all links to the mdAddr (the address object binary file) download, specified for the architecture, compiler and operating system. View the list of supported systems, architectures, and compilers at the os REST parameter.
For this use case, we need a Address Object download for Windows, on a 64BIT system. The compiler DLL is used for Address Object DLL’s.
For our data file download, here is an example of the JSON response:
[
"https://releases.melissadata.net/Download/Data/LATEST/ews.txt/?id={{customerId}}",
"https://releases.melissadata.net/Download/Data/LATEST/lcd256/?id={{customerId}}",
"https://releases.melissadata.net/Download/Data/LATEST/mdAddr.dat/?id={{customerId}}”
]
Here, we will choose to download mdAddr.dat as our desired data file. However, there are many other files we are able to download. This will depend on whether you need to update all address object data files or just a specific one.
3. Download Address Object File#
After retrieving the download links, use the link URL to begin the downloads. Use an appropriate library for your script to handle the file download stream into the installation directory. Consider that this may require administrative privileges for the target directory.
4. Check the File Hash#
After downloading the object, it is recommended to check the file hash to verify a successful download.
FOR WINDOWS#
For scripted use on Windows, it is recommended to use a library to create and execute system commands.
C++ and C#: system
Python: os
Java: runtime (built-in), process (built-in)
After determining the library needed, use the following command:
certutil -hashfile filename.ext HASH
Filename.ext should be replaced with the desired file name.
Here, hash can be replaced with the desired hash format.
For our use case, the command would be:
Certutil -hashfile mdAddr.dll SHA256
For Python, on Windows, using os, this command would look like:
import os
os.system("cd Desktop/FileLocation") # change directory to the file location
os.system("certutil -hashfile filename.ext HASH")
The command should return the file hash, for example: c749b3e0bdfda00043cacb7a1821de79782f21d432ff0eef648f8239e47fa52d
.
FOR LINUX#
After determining the library needed, use the following command:
Hashtypesum <file_name>
file_name
should be replaced with the desired file name.Here,
hashtypesum
can be replaced with the desired hash format +sum
.
For the address object example, this command would be: Sha256sum libmdAddr.so
The command should return the file hash, for example: c429e37bdcfb8b49f4f61ca2ffa0fe747030f3cd683122eabaec67a31bc46724
.
To verify the locally generated hashes, use the hash value endpoints for your file. Each endpoint is specified for either a data file, language interface file or a binary download. If these hash values match, your download was successful and the files were not corrupted.
For our use case, use the Retrieve Hash Value for Binary File endpoint to check the file hash for mdAddr.dll
. The hashType should match the one specified in the command.
https://releases.melissadata.net/SHA256/Library/WINDOWS/COM/64BIT/LATEST/AddrObj.dll?id={{customerId}}&format=JSON
The same steps can be followed for the data file, using the Retrieve Hash Value for Data File endpoint.
The responses should be the same as the file hash returned in the command.
Output#
After successful submission, you will be redirected to the online browser where you may select different releases and manifests from drop-down boxes. Be sure to include ID.
To access the site directly, use https://releases.melissadata.net/browse.