### List Folders Response Example Source: https://dev.emarsys.com/docs/core-api-reference/4y5ypcokeqyxz-list-media-database-folders This is an example of a successful JSON response when listing media database folders. It includes the folder ID, parent ID, and name. ```json { "replyCode": 0, "replyText": "string", "data": [ { "id": 0, "parent": 0, "name": "string" } ] } ``` -------------------------------- ### Response Example for Folder Creation Source: https://dev.emarsys.com/docs/core-api-reference/zkzp2zhplhd0o-create-a-media-database-folder This is an example of a successful response when a media database folder is created. The 'id' field in the 'data' object will contain the identifier of the newly created folder. ```json { "replyCode": 0, "replyText": "string", "data": { "id": 0 } } ``` -------------------------------- ### Create Field Response Example Source: https://dev.emarsys.com/docs/core-api-reference/eccvwbclv1qia-create-a-field This is an example of a successful response when creating a field. The 'data' object contains the 'id' of the newly created field. ```json { "replyCode": -2147483648, "replyText": "string", "data": { "id": 0 } } ``` -------------------------------- ### Response Example for Listing Choices Source: https://dev.emarsys.com/docs/core-api-reference/l337215i6omt4-list-available-choices-of-a-single-choice-field This is an example of a successful response when listing available choices for a field. It includes the reply code, text, and an array of choices with their IDs, text, and bit positions. ```json { "replyCode": -2147483648, "replyText": "string", "data": [ { "id": "string", "choice": "string", "bit_position": 0 } ] } ``` -------------------------------- ### Keyring List Response Example Source: https://dev.emarsys.com/docs/core-api-reference/ws3qa2r7hkz8d-list-keys-in-the-keyring This is an example of a successful JSON response when listing SFTP keys. It includes the reply code, text, and a data array containing key details such as ID, comment, and creation date. ```json { "replyCode": 0, "replyText": "string", "data": [ { "id": "string", "comment": "string", "created": "string" } ] } ``` -------------------------------- ### Create Contact List Response Example Source: https://dev.emarsys.com/docs/core-api-reference/enmevkj1fi016-create-a-contact-list This is an example of a successful response when creating or updating a contact list. It includes a reply code, summary text, and data containing the new list ID and any errors. ```json { "replyCode": -214748443648, "replyText": "string", "data": { "id": 0, "errors": {} } } ``` -------------------------------- ### List Contacts Response Example Source: https://dev.emarsys.com/docs/core-api-reference/tszh6bhkb1oma-list-contacts-in-a-contact-list This is an example of a successful JSON response when listing contacts from a contact list. It includes the reply code, reply text, and an array of contact identifiers. ```json { "replyCode": 0, "replyText": "string", "data": [ "string" ] } ``` -------------------------------- ### Successful Response Example Source: https://dev.emarsys.com/docs/core-api-reference/uxdooy8ggg3nu-query-an-external-event This is an example of a successful JSON response when querying an external event. It includes the reply code, text, and the data array containing event details. ```json { "replyCode": 0, "replyText": "string", "data": [ { "id": 0, "name": "string" } ] } ``` -------------------------------- ### Get Contact Data cURL Request Example Source: https://dev.emarsys.com/docs/core-api-reference/blzojxt3ga5be-get-contact-data This cURL command demonstrates how to make a POST request to the Get Contact Data endpoint, including necessary headers and the JSON body. ```shell curl --request POST \ --url https://api.emarsys.net/api/v3/contact/getdata \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 123' \ --header 'Content-Type: application/json' \ --data '{ \ "fields": [ \ "1", \ "2", \ "3" \ ], \ "keyId": "3", \ "keyValues": [ \ "steve.rogers@example.com", \ "peter.parker@example.com" \ ] \ }' ``` -------------------------------- ### Keyring Key Retrieval Response Example Source: https://dev.emarsys.com/docs/core-api-reference/3q2htugnlrwzx-retrieve-a-key-from-the-keyring This is an example of a successful JSON response when retrieving a key from the keyring. It includes the key's ID, comment, creation date, SSH fingerprint, and the public SSH key. ```json { "replyCode": 0, "replyText": "string", "data": { "id": "string", "comment": "string", "created": "string", "ssh_fingerprint": "string", "ssh_public_key": "string" } } ``` -------------------------------- ### List Available Fields Response Example Source: https://dev.emarsys.com/docs/core-api-reference/a0l7f9tviiuiv-list-available-fields This is an example of a successful JSON response (HTTP 200 OK) from the /field/translate/{languageId} endpoint. It includes the reply code, text, and an array of available fields, each with its ID, name, application type, and string ID. ```json { "replyCode": 0, "replyText": "OK", "data": [ { "id": 14, "name": "Country or region", "application_type": "singlechoice", "string_id": "country" } ] } ``` -------------------------------- ### List Contact Data Response Example Source: https://dev.emarsys.com/docs/core-api-reference/bmwrf7rjbt6q1-list-contact-data This is an example of a successful JSON response when listing contact data. It includes the 'data' object containing 'result' with contact 'id's, along with 'replyCode' and 'replyText'. ```json { "data": { "result": [ { "id": 0 } ] }, "replyCode": 0, "replyText": "string" } ``` -------------------------------- ### List Contact Lists Response Example Source: https://dev.emarsys.com/docs/core-api-reference/axpotjvepqdla-list-contact-lists This is an example of a successful JSON response when retrieving contact lists. It includes the reply code, text, and a data array containing details of each contact list. ```json { "replyCode": -2147483648, "replyText": "string", "data": [ { "id": "string", "name": "string", "created": "string", "type": 0 } ] } ``` -------------------------------- ### Get Contact Data Response Example Source: https://dev.emarsys.com/docs/core-api-reference/blzojxt3ga5be-get-contact-data This JSON structure shows a successful response from the Get Contact Data endpoint, containing retrieved data, errors, and reply status. ```json { "data": { "errors": [ {} ], "result": [ { "id": 0, "uid": "string" } ] }, "replyCode": 0, "replyText": "string" } ``` -------------------------------- ### Create External Event Response Example Source: https://dev.emarsys.com/docs/core-api-reference/39rrldcc17zoa-create-an-external-event This is an example of a successful response when creating an external event. It includes a reply code, text, and the data of the created event with its ID and name. ```json { "replyCode": 0, "replyText": "string", "data": { "id": 0, "name": "string" } } ``` -------------------------------- ### Successful Response Example Source: https://dev.emarsys.com/docs/core-api-reference/4ir8e6fgq3570-remove-contacts-from-a-contact-list This is an example of a successful response when contacts are removed from a list. It indicates the number of contacts deleted and includes an object for any errors encountered. ```json { "replyCode": 0, "replyText": "string", "data": { "deleted_contacts": 0, "errors": {} } } ``` -------------------------------- ### Add Contacts to Contact List Response Example Source: https://dev.emarsys.com/docs/core-api-reference/e6v1un6ph06f3-add-contacts-to-a-contact-list This is an example of a successful response when adding contacts to a list. It indicates the number of contacts successfully inserted and provides details for any errors encountered. ```json { "replyCode": -2147483648, "replyText": "string", "data": { "inserted_contacts": 0, "errors": {} } } ``` -------------------------------- ### List External Events Response Example Source: https://dev.emarsys.com/docs/core-api-reference/a0xz22yrzzduk-list-external-events This is an example of a successful JSON response when listing external events. It includes the reply code, text, and a data array containing event details. ```json { "replyCode": 0, "replyText": "string", "data": [ { "id": 0, "name": "string", "created": "string" } ] } ``` -------------------------------- ### Response Example for Get Contact Data Source: https://dev.emarsys.com/docs/core-api-reference/daqfwyi2qub2k-get-contact-data-in-a-contact-list This JSON structure represents a successful response when retrieving contact data. It includes a reply code, text, and a data object which may contain contact information. ```json { "replyCode": 0, "replyText": "string", "data": {} } ``` -------------------------------- ### Get Contact Data Request Body Example Source: https://dev.emarsys.com/docs/core-api-reference/blzojxt3ga5be-get-contact-data This JSON object specifies the fields to retrieve and the identifiers for the contacts. Use 'id' or 'uid' for reliable identification. ```json { "fields": [ "1", "2", "3" ], "keyId": "3", "keyValues": [ "steve.rogers@example.com", "peter.parker@example.com" ] } ``` -------------------------------- ### List Contacts in a Contact List (cURL Example) Source: https://dev.emarsys.com/docs/core-api-reference/tszh6bhkb1oma-list-contacts-in-a-contact-list This snippet shows how to make a GET request to the deprecated endpoint using cURL to retrieve contacts from a specific list. Ensure you replace `{listId}` with the actual contact list ID and `Authorization: Bearer 123` with your valid OAuth 2.0 token. ```shell curl --request GET \ --url https://api.emarsys.net/api/v3/contactlist/{listId}/contacts \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 123' ``` -------------------------------- ### Rename Contact List Response Example Source: https://dev.emarsys.com/docs/core-api-reference/eyeouexv6x71f-rename-a-contact-list This is an example of a successful response when renaming a contact list. It includes the reply code, text, and the updated contact list data. ```json { "replyCode": -2147483648, "replyText": "string", "data": { "id": 0, "name": "string" } } ``` -------------------------------- ### List Sections Response Example Source: https://dev.emarsys.com/docs/core-api-reference/tfyngxa5gtqz6-list-sections-in-a-template-based-email-campaign This is an example of a successful JSON response when listing sections for a template-based email campaign. It includes the reply code, text, and a data array containing section IDs and their group IDs. ```json { "replyCode": 0, "replyText": "string", "data": [ { "id": 0, "group_id": 0 } ] } ``` -------------------------------- ### Create Key - Shell cURL Request Source: https://dev.emarsys.com/docs/core-api-reference/a16fubcktp3m5-create-a-key-in-the-keyring Example of how to create a new key in the keyring using a cURL command. Ensure to replace '123' with your actual Bearer token. ```shell curl --request POST \ --url https://api.emarsys.net/api/v3/settings/keyring/keys \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 123' \ --header 'Content-Type: application/json' \ --data '{ \ "comment": "key_0" \ }' ``` -------------------------------- ### Verify Internal Contact Identifiers Response Example Source: https://dev.emarsys.com/docs/core-api-reference/t3q2e270pl9nr-verify-internal-contact-identifiers This is an example of a successful response from the /api/v3/contact/checkids endpoint. It includes 'data' with 'errors' and 'ids' objects, along with 'replyCode' and 'replyText'. ```json { "data": { "errors": {}, "ids": {} }, "replyCode": 0, "replyText": "string" } ``` -------------------------------- ### API Response Example for Field Changes Source: https://dev.emarsys.com/docs/core-api-reference/7ich4zk667hbe-query-field-changes This is an example of a successful API response when querying for contact field changes. It includes a reply code, text, and a data object which may contain results. ```json { "replyCode": -2147483648, "replyText": "string", "data": { "result": {} } } ``` -------------------------------- ### API Response Example for Contact IDs Source: https://dev.emarsys.com/docs/core-api-reference/alri5e1skm4jp-fetch-contacts-in-a-contact-list This is an example of a successful JSON response when fetching contact IDs. It includes a list of contact IDs under the 'value' key and a 'next' key for pagination, which contains the URL for the next chunk of results. ```json { "value": [ 1, 2, 3 ], "next": "/contactlist/330/contactIds?$skiptoken=750&$top=1000" } ``` -------------------------------- ### Create Contact API Success Response Example Source: https://dev.emarsys.com/docs/core-api-reference/g617t4kfs4y69-create-contact A successful response to the create contact API call, indicating the creation of contacts and returning their IDs. The 'errors' object will be empty on success. ```json { "data": { "errors": {}, "ids": [ 0 ] }, "replyCode": 0, "replyText": "string" } ``` -------------------------------- ### Batch Request Payload with Section and Global Variables Source: https://dev.emarsys.com/docs/core-api-reference/fl0xx6rwfbwqb-trigger-an-external-event This example demonstrates a batch request payload that includes both section-specific variables and global variables. The payload size is limited to 1 MB. ```json { "key_id": 3, "external_id": "test@example.com", "data": { "section_group1": [ { "section_variable1": "some_value", "section_variable2": "another_value" }, { "section_variable1": "yet_another_value", "section_variable2": "one_more_value" } ], "global": { "global_variable1": "global_value", "global_variable2": "another_global_value" } }, "attachment": [ { "filename": "example.pdf", "data": "ZXhhbXBsZQo=" } ] } ``` -------------------------------- ### Create Field cURL Request Example Source: https://dev.emarsys.com/docs/core-api-reference/eccvwbclv1qia-create-a-field Use this cURL command to send a POST request to create a new field. Ensure you replace '123' with your actual Bearer token and adjust the JSON body as needed. ```shell curl --request POST \ --url https://api.emarsys.net/api/v3/field \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 123' \ --header 'Content-Type: application/json' \ --data '{ \ "name": "The name of the new field", \ "application_type": "shorttext" \ }' ``` -------------------------------- ### Successful Response Example Source: https://dev.emarsys.com/docs/core-api-reference/abbwhrwftt8sz-get-a-section-of-a-template-based-email-campaign This JSON structure represents a successful response when retrieving details of an email campaign section. It includes various properties detailing the section's content, appearance, and targeting options. ```json { "replyCode": 0, "replyText": "string", "data": { "id": 0, "order": 1, "group_id": 0, "hide_on_mobile": true, "header_source": "string", "header_align": "left", "body_source": "string", "image_url": "http://example.com", "image_title": "string", "image_link": "http://example.com", "image_align": "left", "image_width": 0, "image_height": 0, "image_hide_on_mobile": true, "image_mobile": "string", "image_mobile_name": "string", "link_url": "http://example.com", "link_title": "string", "is_image_linked": true, "is_header_linked": true, "link_description": "string", "form_id": 0, "form_title": "string", "target_audience": "all", "use_social_network": 0, "enable_network_sharing": true, "advanced_html_source": "string", "advanced_text_source": "string", "target_audience_segment_id": 0 } } ``` -------------------------------- ### Get Internal Contact Identifiers Response Example Source: https://dev.emarsys.com/docs/core-api-reference/17lj2k744mxhf-get-internal-contact-identifiers This is an example of a successful JSON response when retrieving internal contact identifiers. It includes the contact's ID, reply code, and reply text. ```json { "data": { "id": 0 }, "replyCode": 0, "replyText": "string" } ``` -------------------------------- ### List All Folders (cURL) Source: https://dev.emarsys.com/docs/core-api-reference/4y5ypcokeqyxz-list-media-database-folders Use this cURL command to list all folders in the Media Database. Ensure your Authorization header contains a valid Bearer token. ```shell curl --request GET \ --url https://api.emarsys.net/api/v3/folder \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 123' ``` -------------------------------- ### API Response Example for Counting Contacts Source: https://dev.emarsys.com/docs/core-api-reference/kvrstrtu2zohd-count-contacts-in-a-contact-list This is an example of a successful JSON response when counting contacts in a list. The 'data' field will contain the total number of contacts. ```json { "replyCode": 0, "replyText": "string", "data": 0 } ``` -------------------------------- ### Create a Media Database Folder Source: https://dev.emarsys.com/docs/core-api-reference/da3f808300f17-emarsys-core-api-media-database-endpoint-batch Creates a new folder within the Media Database. This endpoint allows for the organization of media assets. ```APIDOC ## POST /media/folders ### Description Creates a new folder in the Media Database. ### Method POST ### Endpoint /media/folders ### Request Body - **name** (string) - Required - The name of the folder to be created. ### Request Example { "name": "New Folder Name" } ### Response #### Success Response (201 Created) - **id** (integer) - The ID of the newly created folder. - **name** (string) - The name of the newly created folder. - **created_at** (string) - The timestamp when the folder was created. #### Response Example { "id": 123, "name": "New Folder Name", "created_at": "2023-10-27T10:00:00Z" } ``` -------------------------------- ### List Programs Source: https://dev.emarsys.com/docs/core-api-reference/tkr6nu6e7kho3-list-programs Returns a list of all available (not deleted) Automation Center programs for a customer. ```APIDOC ## GET /api/v3/ac/programs ### Description Retrieves a list of all available (not deleted) Automation Center programs for a customer. ### Method GET ### Endpoint https://api.emarsys.net/api/v3/ac/programs ### Parameters ### Request Body ### Request Example ``` curl --request GET \ --url https://api.emarsys.net/api/v3/ac/programs \ --header 'Accept: text/html' \ --header 'Authorization: Bearer 123' ``` ### Response #### Success Response (200) - **replyCode** (integer) - Indicates the result of the operation. - **replyText** (string) - Provides a textual description of the result. - **data** (array[object]) - An array containing program details. - **id** (integer) - The unique identifier for the program. - **name** (string) - The name of the program. - **status** (string) - The current status of the program. - **parent_id** (integer or null) - The ID of the parent program, if applicable. #### Response Example ```json { "replyCode": 0, "replyText": "OK", "data": [ { "id": 1148, "name": "New Program", "status": "indesign", "parent_id": null } ] } ``` ``` -------------------------------- ### List Available Choices (cURL) Source: https://dev.emarsys.com/docs/core-api-reference/l337215i6omt4-list-available-choices-of-a-single-choice-field Use this cURL command to fetch all available options for a specified single or multi-choice field in a given language. Ensure you replace `{fieldID}` with the actual field identifier. ```shell curl --request GET \ --url https://api.emarsys.net/api/v3/field/{fieldID}/choice/translate/en \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 123' ``` -------------------------------- ### List All Media Files Source: https://dev.emarsys.com/docs/core-api-reference/qcvcsxardro12-list-media-database-files Use this cURL command to retrieve a list of all media files in the Media Database. Ensure your Authorization header is correctly set. ```shell curl --request GET \ --url https://api.emarsys.net/api/v3/file/ \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 123' ``` -------------------------------- ### Create Media Database Folder Source: https://dev.emarsys.com/docs/core-api-reference/zkzp2zhplhd0o-create-a-media-database-folder This endpoint creates a new folder in the Media Database. You must provide the name for the new folder and the identifier of the parent folder where it will be created. ```APIDOC ## POST /api/v3/folder ### Description Creates a new folder in a specified existing parent folder in the Media Database. ### Method POST ### Endpoint https://api.emarsys.net/api/v3/folder ### Security OAuth 2.0 ### Parameters #### Request Body - **name** (string) - required - The name of the new folder. - **parent** (integer) - required - The identifier of the parent folder. ### Request Example ```json { "name": "Assets", "parent": 12341234 } ``` ### Response #### Success Response (200) - **replyCode** (integer) - The Emarsys response code. - **replyText** (string) - The summary of the response. - **data** (object) - The requested data. - **id** (integer) - The identifier of the created folder. #### Response Example ```json { "replyCode": 0, "replyText": "string", "data": { "id": 0 } } ``` ``` -------------------------------- ### Request Body for Creating a Folder Source: https://dev.emarsys.com/docs/core-api-reference/zkzp2zhplhd0o-create-a-media-database-folder Use this JSON structure to define the name and parent folder ID for the new media database folder. The 'parent' ID must refer to an existing folder. ```json { "name": "Assets", "parent": 12341234 } ``` -------------------------------- ### List Programs (cURL) Source: https://dev.emarsys.com/docs/core-api-reference/tkr6nu6e7kho3-list-programs Use this cURL command to retrieve a list of all available Automation Center programs. Ensure your Authorization header contains a valid Bearer token. ```shell curl --request GET \ --url https://api.emarsys.net/api/v3/ac/programs \ --header 'Accept: text/html' \ --header 'Authorization: Bearer 123' ``` -------------------------------- ### API Response Example Source: https://dev.emarsys.com/docs/core-api-reference/u3621832k1g0q-list-available-choices-of-a-multiple-choice-field This is an example of a successful JSON response when listing available choices for a multiple-choice field. It includes the Emarsys response code, a reply text, and the data containing the field ID and its associated choices. ```json { "replyCode": -2147483648, "replyText": "string", "data": { "{fieldId}": [ { "id": "string", "choice": "string", "bit_position": 0 } ] } } ``` -------------------------------- ### List Media Database Folders Source: https://dev.emarsys.com/docs/core-api-reference/4y5ypcokeqyxz-list-media-database-folders Returns a list of all folders in the Media Database. You can optionally filter the results to show only subfolders of a specific folder by providing its ID. ```APIDOC ## GET /api/v3/folder ### Description Returns a list of all folders in the Media Database. Use the `folder` query parameter to only list subfolders of a specific folder. ### Method GET ### Endpoint https://api.emarsys.net/api/v3/folder ### Parameters #### Query Parameters - **folder** (integer) - Optional - The folder identifier. If provided, only subfolders of the specified folder are listed. ### Response #### Success Response (200) - **replyCode** (integer) - The Emarsys response code. - **replyText** (string) - The summary of the response. - **data** (array[object]) - The requested data. - **id** (integer) - The folder identifier. - **parent** (integer) - The identifier of the parent folder. - **name** (string) - The name of the folder. #### Response Example ```json { "replyCode": 0, "replyText": "string", "data": [ { "id": 0, "parent": 0, "name": "string" } ] } ``` ``` -------------------------------- ### Create a Contact List Source: https://dev.emarsys.com/docs/core-api-reference/bc66e44f1a6f3-emarsys-core-api-contact-lists-endpoint-batch Creates a new contact list. This endpoint allows for the initialization of a new list to which contacts can be added. ```APIDOC ## POST /contact-lists ### Description Creates a new contact list. ### Method POST ### Endpoint /contact-lists ### Request Body - **name** (string) - Required - The name of the contact list. ### Request Example { "name": "My New Contact List" } ### Response #### Success Response (200) - **id** (integer) - The unique identifier of the created contact list. - **name** (string) - The name of the created contact list. #### Response Example { "id": 12345, "name": "My New Contact List" } ``` -------------------------------- ### GET Request to Query External Event Source: https://dev.emarsys.com/docs/core-api-reference/uxdooy8ggg3nu-query-an-external-event Use this cURL command to make a GET request to the /api/v3/event/{eventId} endpoint. Ensure you replace {eventId} with the actual event ID and provide a valid Bearer token for authorization. ```shell curl --request GET \ --url https://api.emarsys.net/api/v3/event/{eventId} \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 123' ``` -------------------------------- ### Get Internal Contact Identifiers (cURL) Source: https://dev.emarsys.com/docs/core-api-reference/17lj2k744mxhf-get-internal-contact-identifiers Use this cURL command to make a GET request to the API endpoint for retrieving internal contact identifiers. Ensure you replace placeholders like {keyId} and {keyValue} with actual values. ```shell curl --request GET \ --url 'https://api.emarsys.net/api/v3/contact/query/?%7BkeyId%7D=%7BkeyValue%7D' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 123' ``` -------------------------------- ### Create a Program Source: https://dev.emarsys.com/docs/core-api-reference/42cdde709136d-emarsys-core-api-programs-endpoint-batch Creates a new program within the Emarsys system. This endpoint allows for the definition of new program configurations. ```APIDOC ## POST /programs ### Description Creates a new program. ### Method POST ### Endpoint /programs ### Parameters #### Request Body - **name** (string) - Required - The name of the program. - **description** (string) - Optional - A description of the program. ### Request Example { "name": "New Customer Outreach", "description": "Program to engage new customers." } ### Response #### Success Response (200) - **id** (integer) - The unique identifier of the newly created program. - **name** (string) - The name of the program. - **description** (string) - A description of the program. - **created_at** (string) - The timestamp when the program was created. - **updated_at** (string) - The timestamp when the program was last updated. #### Response Example { "id": 456, "name": "New Customer Outreach", "description": "Program to engage new customers.", "created_at": "2023-10-27T11:00:00Z", "updated_at": "2023-10-27T11:00:00Z" } ``` -------------------------------- ### Create Key Source: https://dev.emarsys.com/docs/core-api-reference/a16fubcktp3m5-create-a-key-in-the-keyring This endpoint creates a new key in the keyring for SFTP key-based authentication. It requires a comment for the key name in the request body. ```APIDOC ## POST /api/v3/settings/keyring/keys ### Description Creates and returns a new key in the keyring for SFTP key-based authentication. ### Method POST ### Endpoint https://api.emarsys.net/api/v3/settings/keyring/keys ### Parameters #### Request Body - **comment** (string) - required - The name of the key, appended as suffix. ### Request Example ```json { "comment": "key_0" } ``` ### Response #### Success Response (200) - **replyCode** (integer) - The Emarsys response code. - **replyText** (string) - The summary of the response. - **data** (object) - The requested data. - **id** (string) - The identifier of the key. - **comment** (string) - The name of the key. - **created** (string) - The creation date of the key. - **ssh_fingerprint** (string) - The SSH fingerprint of the key. - **ssh_public_key** (string) - The SSH key. #### Response Example ```json { "replyCode": 0, "replyText": "string", "data": { "id": "string", "comment": "string", "created": "string", "ssh_fingerprint": "string", "ssh_public_key": "string" } } ``` ``` -------------------------------- ### Get Contact Data in a Contact List Source: https://dev.emarsys.com/docs/core-api-reference/daqfwyi2qub2k-get-contact-data-in-a-contact-list Retrieves the data of specified contacts within a given contact list. This endpoint is deprecated and will be decommissioned in December 2024. It is recommended to use the 'Fetch contacts in a contact list' and 'Get contact data' endpoints as alternatives. ```APIDOC ## GET /api/v3/contactlist/{listId}/contacts/data ### Description Returns the data of the specified contacts in a contact list. This endpoint is deprecated and will be decommissioned in December 2024. As a replacement, it is recommended to use the Fetch contacts in a contact list endpoint first and then the Get contact data endpoint. ### Method GET ### Endpoint https://api.emarsys.net/api/v3/contactlist/{listId}/contacts/data ### Parameters #### Path Parameters - **listId** (integer) - Required - The contact list identifier. #### Query Parameters - **fields** (string) - Required - Specifies the fields by identifier or name to include in the returned result. - **limit** (integer) - Optional - Specifies the maximum number of records to return. (>= 1, <= 1000000) Default: 1000 - **offset** (integer) - Optional - Specifies an offset for pagination. The offset of the first record is 0. Default: 0 ### Request Example ```shell curl --request GET \ --url https://api.emarsys.net/api/v3/contactlist/{listId}/contacts/data \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 123' ``` ### Response #### Success Response (200) - **replyCode** (integer) - The Emarsys response code. - **replyText** (string) - The summary of the response. - **data** (object) - The requested data. Contains a map where keys are contact IDs (^[0-9]+) and values are contact data objects. #### Response Example ```json { "replyCode": 0, "replyText": "string", "data": {} } ``` ``` -------------------------------- ### Get a Section of a Template-based Email Campaign Source: https://dev.emarsys.com/docs/core-api-reference/c3cc3061150d2-emarsys-core-api-sections-endpoint-batch Retrieves the details of a specific section within a template-based email campaign. ```APIDOC ## GET /sections/{section_id} ### Description Retrieves a specific section of a template-based email campaign. ### Method GET ### Endpoint /sections/{section_id} ### Parameters #### Path Parameters - **section_id** (integer) - Required - The ID of the section to retrieve. ### Response #### Success Response (200) - **id** (integer) - The ID of the section. - **name** (string) - The name of the section. - **content** (string) - The HTML content of the section. ``` -------------------------------- ### List Keys in the Keyring Source: https://dev.emarsys.com/docs/core-api-reference/ws3qa2r7hkz8d-list-keys-in-the-keyring Retrieves a list of all keys in the keyring for SFTP key-based authentication. ```APIDOC ## GET /api/v3/settings/keyring/keys ### Description Lists all keys in the keyring for SFTP key-based authentication. ### Method GET ### Endpoint https://api.emarsys.net/api/v3/settings/keyring/keys ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```shell curl --request GET \ --url https://api.emarsys.net/api/v3/settings/keyring/keys \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 123' ``` ### Response #### Success Response (200) - **replyCode** (integer) - The Emarsys response code. - **replyText** (string) - The summary of the response. - **data** (array[object]) - The requested data. - **id** (string) - The identifier of the key. - **comment** (string) - The name of the key. - **created** (string) - The creation date of the key. #### Response Example ```json { "replyCode": 0, "replyText": "string", "data": [ { "id": "string", "comment": "string", "created": "string" } ] } ``` ``` -------------------------------- ### Retrieve a Key using cURL Source: https://dev.emarsys.com/docs/core-api-reference/3q2htugnlrwzx-retrieve-a-key-from-the-keyring This snippet demonstrates how to make a GET request to retrieve a key from the keyring using cURL. Ensure you replace `{keyId}` with the actual key identifier and provide a valid authorization token. ```shell curl --request GET \ --url https://api.emarsys.net/api/v3/settings/keyring/keys/{keyId} \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 123' ``` -------------------------------- ### Get a Media Database File Source: https://dev.emarsys.com/docs/core-api-reference/da3f808300f17-emarsys-core-api-media-database-endpoint-batch Retrieves details about a specific file within the Media Database using its unique identifier. ```APIDOC ## GET /media/files/{fileId} ### Description Retrieves details for a specific file in the Media Database. ### Method GET ### Endpoint /media/files/{fileId} ### Parameters #### Path Parameters - **fileId** (integer) - Required - The unique identifier of the file. ### Response #### Success Response (200 OK) - **id** (integer) - The ID of the file. - **name** (string) - The name of the file. - **folder_id** (integer) - The ID of the folder the file belongs to. - **url** (string) - The URL to access the file. - **mime_type** (string) - The MIME type of the file. - **size** (integer) - The size of the file in bytes. - **created_at** (string) - The timestamp when the file was uploaded. #### Response Example { "id": 789, "name": "example.jpg", "folder_id": 123, "url": "https://api.emarsys.net/media/files/789", "mime_type": "image/jpeg", "size": 102400, "created_at": "2023-10-27T10:10:00Z" } ``` -------------------------------- ### Get Internal Contact Identifiers Source: https://dev.emarsys.com/docs/core-api-reference/17lj2k744mxhf-get-internal-contact-identifiers Returns the internal identifier of a contact by the specified field and its value. This endpoint requires indexed fields. ```APIDOC ## GET /api/v3/contact/query/?{keyId}={keyValue} ### Description Returns the internal identifier of a contact by the specified field and its value. For details about contact identifiers, see Concepts. **Important:** This endpoint requires indexed fields. When you select a `keyId`, it needs to have an index. **Note:** As with List Contact Data, the interactive demo page (Try it out) is not functional for this endpoint. We are working on this issue. ### Method GET ### Endpoint https://api.emarsys.net/api/v3/contact/query/?{keyId}={keyValue} ### Parameters #### Path Parameters - **keyId** (integer) - Required - The identifier of the key field to use. Must be indexed. - **keyValue** (string) - Required - The value of the key field to identify the contact. #### Query Parameters - **return** (integer) - Required - The identifier of the field to return along with the contact identifier. If not provided, only the contact identifier is returned. - **excludeempty** (boolean) - Optional - If `true`, contacts with a null or empty value in the specified field are not returned. - **limit** (integer) - Optional - Specifies the maximum number of records to return. (Default: 1000000, Min: 1, Max: 1000000) - **offset** (integer) - Optional - Specifies an offset for pagination. The offset of the first record is 0. (Default: 0) ### Request Example ```shell curl --request GET \ --url 'https://api.emarsys.net/api/v3/contact/query/?%7BkeyId%7D=%7BkeyValue%7D' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 123' ``` ### Response #### Success Response (200) - **data** (object) - The requested data. - **id** (integer) - The numeric contact identifier. - **replyCode** (integer) - The Emarsys response code. - **replyText** (string) - The summary of the response. #### Response Example ```json { "data": { "id": 0 }, "replyCode": 0, "replyText": "string" } ``` ``` -------------------------------- ### cURL Request to Create a Folder Source: https://dev.emarsys.com/docs/core-api-reference/zkzp2zhplhd0o-create-a-media-database-folder This cURL command demonstrates how to send a POST request to create a new folder in the Media Database. Ensure you replace '123' with a valid OAuth 2.0 token and '12341234' with the correct parent folder ID. ```shell curl --request POST \ --url https://api.emarsys.net/api/v3/folder \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 123' \ --header 'Content-Type: application/json' \ --data '{ \ "name": "Assets", \ "parent": 12341234 \ }' ``` -------------------------------- ### Get Email Campaign Section Source: https://dev.emarsys.com/docs/core-api-reference/abbwhrwftt8sz-get-a-section-of-a-template-based-email-campaign Fetches the details of a section within a template-based email campaign using its email ID and section ID. ```APIDOC ## GET /api/v3/email/{emailId}/sections/{sectionId} ### Description Returns the details of a section of a template-based email campaign. **Note**: This endpoint is not compatible with VCE (block-based) e-mail templates. ### Method GET ### Endpoint https://api.emarsys.net/api/v3/email/{emailId}/sections/{sectionId} ### Parameters #### Path Parameters - **emailId** (integer) - Required - The identifier of the email campaign. - **sectionId** (integer) - Required - The identifier of the section. #### Request Body This endpoint does not accept a request body. ### Response #### Success Response (200) - **replyCode** (integer) - The Emarsys response code. - **replyText** (string) - The summary of the response. - **data** (object) - The requested data. - **id** (integer) - Required - The section identifier. - **order** (integer) - Indicates the order of the sections. Default: 1. - **group_id** (integer) - The identifier of the group that contains the section. - **hide_on_mobile** (boolean) - Determines whether the section is displayed on mobile. - **header_source** (string) - The HTML content of the header. - **header_align** (string) - The alignment of the text in the header. Allowed values: left, center, right. - **body_source** (string) - The HTML content of the body text. - **image_url** (string) - The URL of the image. - **image_title** (string) - The image caption. - **image_link** (string) - The destination URL of the image when clicked. - **image_align** (string) - The alignment of the image within the section. Allowed values: left, right. - **image_width** (integer or null) - The width of the image in pixels. - **image_height** (integer or null) - The height of the image in pixels. - **image_hide_on_mobile** (boolean) - Determines whether the image is displayed on mobile. - **image_mobile** (string) - Either the URL of the image or a generated name if it is in the media database. - **image_mobile_name** (string) - The original name of the image. - **link_url** (string) - The link URL. - **link_title** (string) - The link title. - **is_image_linked** (boolean) - Determines whether clicking on the image jumps to the URL defined in the `link_url` parameter. - **is_header_linked** (boolean) - Determines whether clicking on the header jumps to the URL defined in the `link_url` parameter. - **link_description** (string) - The description displayed in the individual link tracking analysis under Reporting in the Emarsys application. - **form_id** (integer) - The identifier of the form. - **form_title** (string) - The title of the form. - **target_audience** (string) - Determines the recipient group. Allowed values: all, segment. - **use_social_network** (integer) - Determines whether clickable social network icons are displayed in the section. Allowed values: 0, 1. - **enable_network_sharing** (boolean) - Determines whether network sharing is enabled. - **advanced_html_source** (string or null) - The advanced HTML source of the section. - **advanced_text_source** (string or null) - The advanced plain text source of the section. - **target_audience_segment_id** (integer) - The identifier of the target segment. #### Response Example (200) ```json { "replyCode": 0, "replyText": "string", "data": { "id": 0, "order": 1, "group_id": 0, "hide_on_mobile": true, "header_source": "string", "header_align": "left", "body_source": "string", "image_url": "http://example.com", "image_title": "string", "image_link": "http://example.com", "image_align": "left", "image_width": 0, "image_height": 0, "image_hide_on_mobile": true, "image_mobile": "string", "image_mobile_name": "string", "link_url": "http://example.com", "link_title": "string", "is_image_linked": true, "is_header_linked": true, "link_description": "string", "form_id": 0, "form_title": "string", "target_audience": "all", "use_social_network": 0, "enable_network_sharing": true, "advanced_html_source": "string", "advanced_text_source": "string", "target_audience_segment_id": 0 } } ``` #### Error Response (404) This endpoint can also return a 404 status code if the email or section is not found. ``` -------------------------------- ### Create Contact List cURL Request Source: https://dev.emarsys.com/docs/core-api-reference/enmevkj1fi016-create-a-contact-list This cURL command demonstrates how to send a POST request to create or update a contact list. Ensure you replace '123' with your actual authorization token. ```shell curl --request POST \ --url https://api.emarsys.net/api/v3/contactlist \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 123' \ --header 'Content-Type: application/json' \ --data '{ \ "key_id": "3", \ "name": "asgard_protectors", \ "description": "those who fight for Asgard", \ "external_ids": [ \ "thor@example.com", \ "odin@example.com", \ "loki@example.com" \ ] \ }' ``` -------------------------------- ### List Media Database Folders Source: https://dev.emarsys.com/docs/core-api-reference/da3f808300f17-emarsys-core-api-media-database-endpoint-batch Retrieves a list of all folders within the Media Database. This is useful for browsing the existing folder structure. ```APIDOC ## GET /media/folders ### Description Lists all available folders in the Media Database. ### Method GET ### Endpoint /media/folders ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of folders to return. - **offset** (integer) - Optional - The number of folders to skip before starting to collect the result set. ### Response #### Success Response (200 OK) - **folders** (array) - A list of folder objects. - **id** (integer) - The ID of the folder. - **name** (string) - The name of the folder. - **created_at** (string) - The timestamp when the folder was created. #### Response Example { "folders": [ { "id": 123, "name": "Folder One", "created_at": "2023-10-27T10:00:00Z" }, { "id": 456, "name": "Folder Two", "created_at": "2023-10-27T10:05:00Z" } ] } ```