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,

  1. Open Windows Powershell

  2. Type Command: Get-FileHash -Algorithm SHA256 “filePath\filename.ext”

    1. Filename.ext should be replaced with the desired file name and path.

    2. 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,

  1. Open the Command Line.

  2. Type in Command: sha256sum <file_name>

    1. file_name should be replaced with the desired file name.

    2. 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:

  1. Get set up with a Melissa Customer ID. This will be needed to access files.

  2. 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:

    1. Using the Retrieve Available Release Version Numbers for Manifest endpoint to determine the desired release.

    2. 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.

  3. 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

  1. 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.

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"
]

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.