Personator Consumer Packages#

Packages/Samples covers the usage of Melissa Cloud APIs using popular third party tools, platforms, and programming languages. None of these are required but they can certainly get you up and running quickly.

For installation instructions and more detailed info, visit our Package Installation Guide: Installation Guide.

NuGet and Pip#

Melissa has developed an SDK for both NuGet (C# .NET) and pip (Python). Both environments follow the same patterns and naming convention so we will group them together.

GET Request#

Example

  • C#
  • Python
// Initialize Personator Consumer
PersonatorConsumer personatorConsumer = new PersonatorConsumer(MELISSA_LICENSE_KEY);

// Set the parameters
personatorConsumer.FullName = "Raymond Melissa";
personatorConsumer.AddressLine1 = "22382 Avenida Empresa";
personatorConsumer.City = "Rancho Santa Margarita";
personatorConsumer.State = "CA";
personatorConsumer.Postal = "92688";
personatorConsumer.Country = "United States";
personatorConsumer.Email = "info@melissa.com";
personatorConsumer.Phone = "800-635-4772";

// Make the GET request
PersonatorConsumerResponse responseObject = personatorConsumer.Get<PersonatorConsumerResponse>();

// Access the response value
string recId = responseObject.RecordID;
# Initialize Personator Consumer
personator_consumer = PersonatorConsumer(MELISSA_LICENSE_KEY)

# Set the parameters
personator_consumer.full_name = "Raymond Melissa"
personator_consumer.address_line1 = "22382 Avenida Empresa"
personator_consumer.city = "Rancho Santa Margarita"
personator_consumer.state = "CA"
personator_consumer.postal = "92688"
personator_consumer.country = "United States"
personator_consumer.email = "info@melissa.com"
personator_consumer.phone = "800-635-4772"

# Make the GET request
response_object = personator_consumer.get(PersonatorConsumerResponse)

# Access the response value
rec_id = response_object.record_id

POST Request#

Example

  • C#
  • Python
// Initialize Personator Consumer
PersonatorConsumer personatorConsumer = new PersonatorConsumer(MELISSA_LICENSE_KEY);

// Create a set of requests and set their parameters
personatorConsumer.AddRecord(new PersonatorConsumerRecordRequest
{
    RecordID = "1",
    FullName = "Raymond Melissa",
    AddressLine1 = "22382 Avenida Empresa",
    City = "Rancho Santa Margarita",
    State = "CA",
    PostalCode = "92688"
});

personatorConsumer.AddRecord(new PersonatorConsumerRecordRequest
{
    RecordID = "2",
    FullName = "John Melissa",
    AddressLine1 = "22382 Avenida Empresa",
    City = "Rancho Santa Margarita",
    State = "CA",
    PostalCode = "92688"
});

// Make the POST request
PersonatorConsumerResponse responseObject = personatorConsumer.Post<PersonatorConsumerResponse>();

// Access the response value
foreach (var record in responseObject.Records)
{
    Console.WriteLine("RecordID: " + record.RecordID);
}
# Initialize Personator Consumer
personator_consumer = PersonatorConsumer(MELISSA_LICENSE_KEY)

# Create a set of requests and set their parameters
personator_consumer.add_record(PersonatorConsumerRecordRequest
(
    record_id = "1",
    full_name = "Raymond Melissa",
    address_line1 = "22382 Avenida Empresa",
    city = "Rancho Santa Margarita",
    state = "CA",
    postal_code = "92688"
))

personator_consumer.add_record(PersonatorConsumerRecordRequest
(
    record_id = "2",
    full_name = "John Melissa",
    address_line1 = "22382 Avenida Empresa",
    city = "Rancho Santa Margarita",
    state = "CA",
    postal_code = "92688"
))

# Make the POST request
response_object = personator_consumer.post(PersonatorConsumerResponse)

# Access the response value
for record in response_object.records:
    print("RecordID: ", record.record_id)

For more information on the Personator Consumer Packages please click here.

To see detailed Sample Code for this package see:

OpenAPI (Swagger)#

OpenAPI is a popular specification for describing REST APIs. By providing swagger JSON documents, you can automatically generate client code and test applications.

Melissa is working on providing a swagger JSON document for our services. Please stay tuned!

Postman#

Postman is a quick and easy way to test raw HTTP requests and responses. Using our pre-made request templates, you can start testing and generating code snippets for our Cloud APIs in seconds.

Try it out now: Run In Postman

Sample Code#