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.

Contribution(string license)

Initialize the Cloud API object with a license key

  • C#
  • Python
Contribution contribution = new Contribution(MELISSA_LICENSE_KEY);
TBD

Contribution()

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.

  • C#
  • Python
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

  • C#
  • Python
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

  • C#
  • Python
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

  • C#
  • Python
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

  • C#
  • Python
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

  • C#
  • Python
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

  • C#
  • Python
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

  • C#
  • Python
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

  • C#
  • Python
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

  • C#
  • Python
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

  • C#
  • Python
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.

  • C#
  • Python
string response = contribution.GetAddMAK<string>();
TBD
  • C#
  • Python
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.

  • C#
  • Python
ContributionResponse responseObject = contribution.GetAddMAK<ContributionResponse>();
TBD
  • C#
  • Python
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.

  • C#
  • Python
responseObject.GetValue("Results");
responseObject.GetValue("Message");
TBD

2. Accessing Properties directly

Values can be accessed directly using the response object’s field names.

  • C#
  • Python
responseObject.Results;
responseObject.Message;
TBD

3. Use Specialized Methods

Use get methods corresponding to field name to get the field value.

  • C#
  • Python
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.

  • C#
  • Python

Method

Description

Contribution()

Constructor to initialize the Contribution object.

Contribution(string license)

Constructor to initialize the Contribution object with a license string.

Method

Description

TBD

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.

  • C#
  • Python

Method

Description

void SetBaseUrl(string baseUrl)

Set the base URL.

void SetLicense(string license)

Set the license string.

void SetEndpoint(string endpoint)

Set the endpoint.

void SetFormat(string format)

Set the format.

void SetAddressLine1(string addressLine1)

Set the address line 1.

void SetAddressLine2(string addressLine2)

Set the address line 2.

void SetAddressLine3(string addressLine3)

Set the address line 3.

void SetAddressLine4(string addressLine4)

Set the address line 4.

void SetAddressLine5(string addressLine5)

Set the address line 5.

void SetAddressLine6(string addressLine6)

Set the address line 6.

void SetAddressLine7(string addressLine7)

Set the address line 7.

void SetAddressLine8(string addressLine8)

Set the address line 8.

void SetAdministrativeArea(string administrativeArea)

Set the administrative area.

void SetLocality(string locality)

Set the locality.

void SetPostalCode(string postalCode)

Set the postal code.

void SetCountry(string country)

Set the country.

void SetLatitude(string latitude)

Set the latitude.

void SetLongitude(string longitude)

Set the longitude.

void SetMAK(string mak)

Set the Melissa Address Key.

void SetMIK(string mik)

Set the Melissa Identity Key.

void SetTransmissionReference(string transmissionReference)

Set the transmission reference.

void SetReason(string reason)

Set the reason.

void SetRespondToEmail(string respondToEmail)

Set the respond to email.

void SetAction(string action)

Set the action.

void SetOrganization(string organization)

Set the organization.

void SetFirstName(string firstName)

Set the first name.

void SetLastName(string lastName)

Set the last name.

void SetFullName(string fullName)

Set the full name.

void SetCity(string city)

Set the city.

void SetState(string state)

Set the state.

void SetValue(string parameter, string value)

Set the input parameter to a specified value.

void SetAddMAKPostBody(ContributionAddMAKPostRequest postBody)

Set the post body for addMAK post requests.

void SetAddMIKPostBody(ContributionAddMIKPostRequest postBody)

Set the post body for addMIK post requests.

void SetChangeGeoPointPostBody(ContributionChangeGeoPointPostRequest postBody)

Set the post body for changeGeoPoint post requests.

void SetChangeMAKPostBody(ContributionChangeMAKPostRequest postBody)

Set the post body for changeMAK post requests.

void SetChangeMIKPostBody(ContributionChangeMIKPostRequest postBody)

Set the post body for changeMIK post requests.

void SetRemoveMAKPostBody(ContributionRemoveMAKPostRequest postBody)

Set the post body for removeMAK post requests.

void SetRemoveMIKPostBody(ContributionRemoveMIKPostRequest postBody)

Set the post body for removeMIK post requests.

Method

Description

TBD

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.

  • C#
  • Python

Method

Description

string GetBaseUrl()

Get the base URL.

string GetLicense()

Get the license string.

string GetEndpoint()

Get the endpoint.

string GetFormat()

Get the format.

string GetAddressLine1()

Get the address line 1.

string GetAddressLine2()

Get the address line 2.

string GetAddressLine3()

Get the address line 3.

string GetAddressLine4()

Get the address line 4.

string GetAddressLine5()

Get the address line 5.

string GetAddressLine6()

Get the address line 6.

string GetAddressLine7()

Get the address line 7.

string GetAddressLine8()

Get the address line 8.

string GetAdministrativeArea()

Get the administrative area.

string GetLocality()

Get the locality.

string GetPostalCode()

Get the postal code.

string GetCountry()

Get the country.

string GetLatitude()

Get the latitude.

string GetLongitude()

Get the longitude.

string GetMAK()

Get the Melissa Address Key.

string GetMIK()

Get the Melissa Identity Key.

string GetTransmissionReference()

Get the transmission reference.

string GetReason()

Get the reason.

string GetRespondToEmail()

Get the respond to email.

string GetAction()

Get the action.

string GetOrganization()

Get the organization.

string GetFirstName()

Get the first name.

string GetLastName()

Get the last name.

string GetFullName()

Get the full name.

string GetCity()

Get the city.

string GetState()

Get the state.

string GetValue(string parameter)

Get the value of an input parameter.

ContributionAddMAKPostRequest GetAddMAKPostBody()

Get the post body for addMAK post requests.

ContributionAddMIKPostRequest GetAddMIKPostBody()

Get the post body for addMIK post requests.

ContributionChangeGeoPointPostRequest GetChangeGeoPointPostBody()

Get the post body for changeGeoPoint post requests.

ContributionChangeMAKPostRequest GetChangeMAKPostBody()

Get the post body for changeMAK post requests.

ContributionChangeMIKPostRequest GetChangeMIKPostBody()

Get the post body for changeMIK post requests.

ContributionRemoveMAKPostRequest GetRemoveMAKPostBody()

Get the post body for removeMAK post requests.

ContributionRemoveMIKPostRequest GetRemoveMIKPostBody()

Get the post body for removeMIK post requests.

Method

Description

TBD

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.

  • C#
  • Python

Method

Description

T GetAddMAK<T>()

Makes a synchronous GET request to the addMAK endpoint and returns the response (string or deserialized response object).

async Task<T> GetAddMAKAsync<T>()

Makes an asynchronous GET request to the addMAK endpoint and returns the response (string or deserialized response object).

T PostAddMAK<T>()

Makes a synchronous POST request to the addMAK endpoint and returns the response (string or deserialized response object).

async Task<T> PostAddMAKAsync<T>()

Makes an asynchronous POST request to the addMAK endpoint and returns the response (string or deserialized response object).

T PostAddMIK<T>()

Makes a synchronous POST request to the addMIK endpoint and returns the response (string or deserialized response object).

async Task<T> PostAddMIKAsync<T>()

Makes an asynchronous POST request to the addMIK endpoint and returns the response (string or deserialized response object).

T GetChangeGeoPoint<T>()

Makes a synchronous GET request to the changeGeoPoint endpoint and returns the response (string or deserialized response object).

async Task<T> GetChangeGeoPointAsync<T>()

Makes an asynchronous GET request to the changeGeoPoint endpoint and returns the response (string or deserialized response object).

T PostChangeGeoPoint<T>()

Makes a synchronous POST request to the changeGeoPoint endpoint and returns the response (string or deserialized response object).

async Task<T> PostChangeGeoPointAsync<T>()

Makes an asynchronous POST request to the changeGeoPoint endpoint and returns the response (string or deserialized response object).

T PostChangeMAK<T>()

Makes a synchronous POST request to the changeMAK endpoint and returns the response (string or deserialized response object).

async Task<T> PostChangeMAKAsync<T>()

Makes an asynchronous POST request to the changeMAK endpoint and returns the response (string or deserialized response object).

T PostChangeMIK<T>()

Makes a synchronous POST request to the changeMIK endpoint and returns the response (string or deserialized response object).

async Task<T> PostChangeMIKAsync<T>()

Makes an asynchronous POST request to the changeMIK endpoint and returns the response (string or deserialized response object).

T GetRemoveMAK<T>()

Makes a synchronous GET request to the removeMAK endpoint and returns the response (string or deserialized response object).

async Task<T> GetRemoveMAKAsync<T>()

Makes an asynchronous GET request to the removeMAK endpoint and returns the response (string or deserialized response object).

T PostRemoveMAK<T>()

Makes a synchronous POST request to the removeMAK endpoint and returns the response (string or deserialized response object).

async Task<T> PostRemoveMAKAsync<T>()

Makes an asynchronous POST request to the removeMAK endpoint and returns the response (string or deserialized response object).

T GetRemoveMIK<T>()

Makes a synchronous GET request to the removeMIK endpoint and returns the response (string or deserialized response object).

async Task<T> GetRemoveMIKAsync<T>()

Makes an asynchronous GET request to the removeMIK endpoint and returns the response (string or deserialized response object).

T PostRemoveMIK<T>()

Makes a synchronous POST request to the removeMIK endpoint and returns the response (string or deserialized response object).

async Task<T> PostRemoveMIKAsync<T>()

Makes an asynchronous POST request to the removeMIK endpoint and returns the response (string or deserialized response object).

string GetApiVersion()

Makes a synchronous getversion request and returns the parsed Cloud API version.

async Task<string> GetApiVersionAsync()

Makes an asynchronous getversion request and returns the parsed Cloud API version.

Method

Description

TBD

TBD