Overview - what this Library is?
We want to provide our clients a way to use our system however they like. That is why we have introduced the Integration Libraries - a group of functions and declarations to help you implement our API to your system.
How to download and implement the Library
After you have downloaded the library (which is a single .py file), you might want to put it in your Python directory to have a quick and easy access to it manually or through your own code.
You will be using the import functionality to access any classes and methods that you need. Here's an example of such import. Insert this line of code at the beginning of your script:
from ElasticEmailClient import ApiClient, Account, Email
How to start working with the Library on your project
Whether you want to send an email or modify your template, you can do so by using the specific class under which the relevant methods can be found. You can refer to the ApiTypes class to create the desired object that would be used as a parameter in some calls.
The responses are being held as the dictionaries. Many of them are the representations of classes that you can find in the ApiTypes class or our API documentation. Use whichever source you like to read the response and use it however you like - print it on the screen or log in your database.
First of all, we need to set up an ApiKey, that is the unique identifier of your account. You can do this in two ways:
First option: open up ElasticEmailClient.py in your editor. Then, in the ApiClient class, you can find two fields: apiKey and apiUri. Change the former's value to your ApiKey available to you here. Don't mind the apiUri field, it is best to leave it untouched.
Second option: simply overwrite the apiKey field's value of the ApiClient class at the start of your code. Remember to import the ApiClient class first:
from ElasticEmailClient import ApiClient
ApiClient.apiKey = '11111111-2222-3333-4444-555555555555'