In Maropost you have the ability to save contact in relational tables and structure the tables according to your requirements. At some point in time, you would like to fetch all the contacts present in the relational table or would like to view the details of a single contact present in your relational database. To be able to do this Maropost has a few options that you could use to get the desired results. Below mentioned are the methods through which you could fetch the contact details.
To fetch all contacts through an API Call:
You can fetch the all the contacts present in a relational table using the GET call mentioned on each table's information page. Maropost will always send a standardized data of 200 contacts per page which can be modified using the "per" and "page" parameters in the API call.
The maximum number of contact information which can be displayed on a single page is 5000 contacts. Below mentioned is a sample GET API call which would give you an idea how this method works. This call can be used by any program capable of running API calls or in a browser's URL bar.
Both http and https protocols are supported.
Sample API Call for tables on app.maropost.com:-
GET - https://*hashed account number*.tables.maropost.com/*table name*.json?auth_token=*Your API Key*
Sample API Call for tables on cloud.maropost.com:-
GET - https://rdb.maropost.com/*account number*/*table name*.json?auth_token=*Your API Key*
In the API calls mentioned above the structure is different as the platforms through which the relational tables have been created is different.
For tables created on app.maropost.com the link starts with a Hashed Account ID value followed by "tables.maropost.com" which is standardized value across all app.maropost.com accounts. The next value is the table name ending with the format you wish to use to fetch the results. The sample API calls use JSON format. Apart from JSON format, XML format can also be used. The call is completed by providing the "auth_token" which is for the security purpose and to authenticate the API call. You will have the ability to create API keys (with correct permission set) in your account that will serve as the auth tokens for your API calls.
The API calls for the tables present on the cloud.maropost.com are similar in structure minus the hashed account id and have a standardized "rdb.maropost.com" instead of "tables.maropost.com". It is followed by the table's name and format, completing the call is the auth token which has been explained above.
To fetch a single contact using API Call:
Fetching a single contact using the API from a relational table is similar to the call mentioned above. The only addition made to the call is the where clause which will help us to fetch a contact based on the value which we will declare in the API call, as seen in the sample below:
GET - https://rdb.maropost.com/*account number*/*table name*.json?where[email]=firstname.lastname@example.org&auth_token=*Your API Key*
You can use any column's name instead of "email" as seen in the sample above to fetch a contact based on the value of that column.
If multiple contacts satisfy the column's value mentioned in the API call, all the entries satisfying the value will be shown in the resulting data.
Exporting the Relational Table through the UI:
Maropost gives you the ability to export the table data in form of an XLS file. The option to export a data is present in front of each table's name, on the right-hand side. The file exported will be available to download, after processing, in the notification bell. Refer to the screenshot below for more information.
Exporting the table data using RDBMS credentials:
You can also use the RDBMS credentials to log into the Maropost relational table database using any application which supports the relational table access. The RDBMS credentials can be found in the "Connections" option from the top right-hand side account menu. Under the "Relational Tables" tab, you will find the credentials to log into your relational database.
You will be able to export a relational table's data through the application you are using.
View contact within a Relational Table:
Each table has a "View" button to view the contacts in a relational table. Clicking on the View button will redirect you the page that will show you all the contacts page wise. Only 10 contacts are shown per page on this page. You can use the "per=" function in the URL, to go to a specific page.