Contribution Packages#
Introduction#
The Contribution Packages are designed to accelerate your integration process. This documentation details how these packages provide efficient access to our Contribution API, enabling quicker deployment of data corrections and modifications within your applications. The Contribution API enables submitting corrections and modifications to Melissa data, including GeoPoint corrections, MAK/MIK additions, changes, and removals.
For a guide on installing packages, see Package Installation.
Initialization#
There are two different constructors that you can utilize when initializing Contribution.
Initialize the Cloud API object with a license key
Contribution contribution = new Contribution(MELISSA_LICENSE_KEY);
TBD
Initialize the Cloud API object, which will read the license key from the environment variable MD_LICENSE or configured using a set method
Click here to learn more about setting up the environment variable.
Contribution contribution = new Contribution()
TBD
Configuration#
The Contribution API supports both GET and POST requests depending on the endpoint.
Some endpoints support both GET and POST: addMAK, changeGeoPoint, removeMAK, removeMIK
Some endpoints are POST-only: addMIK, changeMAK, changeMIK
Each endpoint has its own dedicated request method (e.g. GetAddMAK<T>(), PostAddMAK<T>()).
(GET) Using one of three ways to configure each respective parameter
(POST) Using the Set Post Body Method to pass a pre-constructed post request object as the post body containing all parameters
(POST) Using Set Methods to configure parameters, then calling the endpoint-specific post method
Requests#
GET#
To send a GET request, there are three ways you can configure the parameters to make a request.
Method 1: Using the Set Value Method to specify the parameter and value you want to set it to
Method 2: Using direct property access to set parameter values
Method 3: Using specialized Set Methods to set parameter values
Method 1: Using Set Value Method#
This function allows you to specify input parameters and the values you want to set them to.
Format
contribution.SetValue("AddressLine1", ADDRESS_LINE_1);
contribution.SetValue("Locality", LOCALITY);
contribution.SetValue("AdministrativeArea", ADMINISTRATIVE_AREA);
contribution.SetValue("PostalCode", POSTAL_CODE);
contribution.SetValue("Country", COUNTRY);
contribution.SetValue("Latitude", LATITUDE);
contribution.SetValue("Longitude", LONGITUDE);
TBD
Example
contribution.SetValue("AddressLine1", "22382 Avenida Empresa");
contribution.SetValue("Locality", "Rancho Santa Margarita");
contribution.SetValue("AdministrativeArea", "CA");
contribution.SetValue("PostalCode", "92688");
contribution.SetValue("Country", "US");
contribution.SetValue("Latitude", "33.637562");
contribution.SetValue("Longitude", "-117.606887");
TBD
Method 2: Using Direct Property Access#
This allows you to set values directly using the Cloud API’s parameter names.
Format
contribution.AddressLine1 = ADDRESS_LINE_1;
contribution.Locality = LOCALITY;
contribution.AdministrativeArea = ADMINISTRATIVE_AREA;
contribution.PostalCode = POSTAL_CODE;
contribution.Country = COUNTRY;
contribution.Latitude = LATITUDE;
contribution.Longitude = LONGITUDE;
TBD
Example
contribution.AddressLine1 = "22382 Avenida Empresa";
contribution.Locality = "Rancho Santa Margarita";
contribution.AdministrativeArea = "CA";
contribution.PostalCode = "92688";
contribution.Country = "US";
contribution.Latitude = "33.637562";
contribution.Longitude = "-117.606887";
TBD
Method 3: Using Specialized Methods#
These functions allow you to set the input parameters for the Cloud API.
See Set Methods for a list of available parameters.
Format
contribution.SetAddressLine1(ADDRESS_LINE_1);
contribution.SetLocality(LOCALITY);
contribution.SetAdministrativeArea(ADMINISTRATIVE_AREA);
contribution.SetPostalCode(POSTAL_CODE);
contribution.SetCountry(COUNTRY);
contribution.SetLatitude(LATITUDE);
contribution.SetLongitude(LONGITUDE);
TBD
Example
contribution.SetAddressLine1("22382 Avenida Empresa");
contribution.SetLocality("Rancho Santa Margarita");
contribution.SetAdministrativeArea("CA");
contribution.SetPostalCode("92688");
contribution.SetCountry("US");
contribution.SetLatitude("33.637562");
contribution.SetLongitude("-117.606887");
TBD
POST#
To send a POST request, there are two ways you can configure the parameters to make a request.
Method 1: Using the Set Post Body Method to pass a pre-constructed post request object as the post body containing all parameters
Method 2: Using Set Methods to configure parameters, then calling the endpoint-specific post method
Method 1: Set Post Body#
This function allows you to pass a pre-constructed post body with all parameters for POST requests. Each endpoint has its own post request class and corresponding set method.
Format
contribution.SetAddMAKPostBody(new ContributionAddMAKPostRequest
{
CustomerID = MELISSA_LICENSE_KEY,
AddressLine1 = ADDRESS_LINE_1,
Locality = LOCALITY,
AdministrativeArea = ADMINISTRATIVE_AREA,
PostalCode = POSTAL_CODE,
Country = COUNTRY,
Latitude = LATITUDE,
Longitude = LONGITUDE,
Reason = REASON,
RespondToEmail = RESPOND_TO_EMAIL
});
TBD
Example
contribution.SetAddMAKPostBody(new ContributionAddMAKPostRequest
{
CustomerID = MELISSA_LICENSE_KEY,
AddressLine1 = "22382 Avenida Empresa",
Locality = "Rancho Santa Margarita",
AdministrativeArea = "CA",
PostalCode = "92688",
Country = "US",
Latitude = "33.637562",
Longitude = "-117.606887",
Reason = "Add a MAK",
RespondToEmail = "youremail@melissadata.com"
});
TBD
Method 2: Set Input Parameters#
You will use set methods to configure the parameters (license, address fields, reason, etc.), then call the endpoint-specific post method.
See Set Methods for a list of available parameters.
Format
contribution.SetLicense(MELISSA_LICENSE_KEY);
contribution.SetAddressLine1(ADDRESS_LINE_1);
contribution.SetLocality(LOCALITY);
contribution.SetAdministrativeArea(ADMINISTRATIVE_AREA);
contribution.SetPostalCode(POSTAL_CODE);
contribution.SetCountry(COUNTRY);
contribution.SetLatitude(LATITUDE);
contribution.SetLongitude(LONGITUDE);
contribution.SetReason(REASON);
contribution.SetRespondToEmail(RESPOND_TO_EMAIL);
TBD
Example
contribution.SetLicense(MELISSA_LICENSE_KEY);
contribution.SetAddressLine1("22382 Avenida Empresa");
contribution.SetLocality("Rancho Santa Margarita");
contribution.SetAdministrativeArea("CA");
contribution.SetPostalCode("92688");
contribution.SetCountry("US");
contribution.SetLatitude("33.637562");
contribution.SetLongitude("-117.606887");
contribution.SetReason("Add a MAK");
contribution.SetRespondToEmail("youremail@melissadata.com");
TBD
Response#
When submitting a request, you have the option to either get the response as a string or encapsulate the response into the respective Cloud API response object. Each endpoint has its own dedicated GET and/or POST method.
As a String#
Submit a GET or POST request and get the response as a string.
string response = contribution.GetAddMAK<string>();
TBD
string response = contribution.PostAddMAK<string>();
TBD
As a Response Object#
Submit a GET or POST request and encapsulate the response into the Cloud API response object.
ContributionResponse responseObject = contribution.GetAddMAK<ContributionResponse>();
TBD
ContributionResponse responseObject = contribution.PostAddMAK<ContributionResponse>();
TBD
Accessing Values#
When encapsulating the response into the Cloud API’s respective response object, there are three ways to access values. The response is a flat object (no Records list) with fields such as Version, TransmissionReference, TransmissionResults, Results, and Message.
Click here to learn more about the Contribution response format.
1. Using the Get Value Method:
Pass the field name as a string to the Get Value Method, and it will return the corresponding field value.
responseObject.GetValue("Results");
responseObject.GetValue("Message");
TBD
2. Accessing Properties directly
Values can be accessed directly using the response object’s field names.
responseObject.Results;
responseObject.Message;
TBD
3. Use Specialized Methods
Use get methods corresponding to field name to get the field value.
responseObject.GetResults();
responseObject.GetMessage();
TBD
Methods#
The methods listed below pertain to the Contribution Cloud API object.
For methods related to the respective Cloud API’s response object click here.
Constructors#
These methods initialize and configure instances of the Cloud API object. Use these methods to create a new object, optionally providing initial values such as a license string to customize the instance during its creation.
Method |
Description |
|---|---|
|
Constructor to initialize the Contribution object. |
|
Constructor to initialize the Contribution object with a license string. |
Method |
Description |
|---|---|
|
TBD |
Set Methods#
These methods configure or modify parameters for the Cloud API object. Use these methods to make adjustments to the parameters during the execution of the Cloud API, ensuring flexibility in customizing API requests.
Method |
Description |
|---|---|
|
Set the base URL. |
|
Set the license string. |
|
Set the endpoint. |
|
Set the format. |
|
Set the address line 1. |
|
Set the address line 2. |
|
Set the address line 3. |
|
Set the address line 4. |
|
Set the address line 5. |
|
Set the address line 6. |
|
Set the address line 7. |
|
Set the address line 8. |
|
Set the administrative area. |
|
Set the locality. |
|
Set the postal code. |
|
Set the country. |
|
Set the latitude. |
|
Set the longitude. |
|
Set the Melissa Address Key. |
|
Set the Melissa Identity Key. |
|
Set the transmission reference. |
|
Set the reason. |
|
Set the respond to email. |
|
Set the action. |
|
Set the organization. |
|
Set the first name. |
|
Set the last name. |
|
Set the full name. |
|
Set the city. |
|
Set the state. |
|
Set the input parameter to a specified value. |
|
Set the post body for addMAK post requests. |
|
Set the post body for addMIK post requests. |
|
Set the post body for changeGeoPoint post requests. |
|
Set the post body for changeMAK post requests. |
|
Set the post body for changeMIK post requests. |
|
Set the post body for removeMAK post requests. |
|
Set the post body for removeMIK post requests. |
Method |
Description |
|---|---|
|
TBD |
Get Methods#
These methods retrieve parameter values from the Cloud API object. Use these methods to access the parameters configured for the Cloud API, providing insight into the current state of the object’s settings.
Method |
Description |
|---|---|
|
Get the base URL. |
|
Get the license string. |
|
Get the endpoint. |
|
Get the format. |
|
Get the address line 1. |
|
Get the address line 2. |
|
Get the address line 3. |
|
Get the address line 4. |
|
Get the address line 5. |
|
Get the address line 6. |
|
Get the address line 7. |
|
Get the address line 8. |
|
Get the administrative area. |
|
Get the locality. |
|
Get the postal code. |
|
Get the country. |
|
Get the latitude. |
|
Get the longitude. |
|
Get the Melissa Address Key. |
|
Get the Melissa Identity Key. |
|
Get the transmission reference. |
|
Get the reason. |
|
Get the respond to email. |
|
Get the action. |
|
Get the organization. |
|
Get the first name. |
|
Get the last name. |
|
Get the full name. |
|
Get the city. |
|
Get the state. |
|
Get the value of an input parameter. |
|
Get the post body for addMAK post requests. |
|
Get the post body for addMIK post requests. |
|
Get the post body for changeGeoPoint post requests. |
|
Get the post body for changeMAK post requests. |
|
Get the post body for changeMIK post requests. |
|
Get the post body for removeMAK post requests. |
|
Get the post body for removeMIK post requests. |
Method |
Description |
|---|---|
|
TBD |
Class Methods#
These methods perform service-level operations, handling the core processing and interactions for the Cloud API object. Use these methods to execute primary functionalities such as making API requests to the various Contribution endpoints.
Method |
Description |
|---|---|
|
Makes a synchronous GET request to the addMAK endpoint and returns the response (string or deserialized response object). |
|
Makes an asynchronous GET request to the addMAK endpoint and returns the response (string or deserialized response object). |
|
Makes a synchronous POST request to the addMAK endpoint and returns the response (string or deserialized response object). |
|
Makes an asynchronous POST request to the addMAK endpoint and returns the response (string or deserialized response object). |
|
Makes a synchronous POST request to the addMIK endpoint and returns the response (string or deserialized response object). |
|
Makes an asynchronous POST request to the addMIK endpoint and returns the response (string or deserialized response object). |
|
Makes a synchronous GET request to the changeGeoPoint endpoint and returns the response (string or deserialized response object). |
|
Makes an asynchronous GET request to the changeGeoPoint endpoint and returns the response (string or deserialized response object). |
|
Makes a synchronous POST request to the changeGeoPoint endpoint and returns the response (string or deserialized response object). |
|
Makes an asynchronous POST request to the changeGeoPoint endpoint and returns the response (string or deserialized response object). |
|
Makes a synchronous POST request to the changeMAK endpoint and returns the response (string or deserialized response object). |
|
Makes an asynchronous POST request to the changeMAK endpoint and returns the response (string or deserialized response object). |
|
Makes a synchronous POST request to the changeMIK endpoint and returns the response (string or deserialized response object). |
|
Makes an asynchronous POST request to the changeMIK endpoint and returns the response (string or deserialized response object). |
|
Makes a synchronous GET request to the removeMAK endpoint and returns the response (string or deserialized response object). |
|
Makes an asynchronous GET request to the removeMAK endpoint and returns the response (string or deserialized response object). |
|
Makes a synchronous POST request to the removeMAK endpoint and returns the response (string or deserialized response object). |
|
Makes an asynchronous POST request to the removeMAK endpoint and returns the response (string or deserialized response object). |
|
Makes a synchronous GET request to the removeMIK endpoint and returns the response (string or deserialized response object). |
|
Makes an asynchronous GET request to the removeMIK endpoint and returns the response (string or deserialized response object). |
|
Makes a synchronous POST request to the removeMIK endpoint and returns the response (string or deserialized response object). |
|
Makes an asynchronous POST request to the removeMIK endpoint and returns the response (string or deserialized response object). |
|
Makes a synchronous getversion request and returns the parsed Cloud API version. |
|
Makes an asynchronous getversion request and returns the parsed Cloud API version. |
Method |
Description |
|---|---|
|
TBD |