# Salesforce Marketing Cloud

## Authentication methods

Marketing Cloud uses a complicated mix of credentials and keys, depending on which features you use:

[oauth-for-apis-ssh-for-sftp-and-gpg-payload-encryption](https://docs.omnata.com/omnata-product-documentation/omnata-sync-for-snowflake/apps/sfmc/oauth-for-apis-ssh-for-sftp-and-gpg-payload-encryption "mention")

[oauth-for-apis-ssh-for-sftp-without-payload-encryption](https://docs.omnata.com/omnata-product-documentation/omnata-sync-for-snowflake/apps/sfmc/oauth-for-apis-ssh-for-sftp-without-payload-encryption "mention")

[OAuth for APIs, Cloud Storage for file transfer](https://docs.omnata.com/omnata-product-documentation/omnata-sync-for-snowflake/apps/sfmc/oauth-for-apis-ssh-for-sftp-without-payload-encryption-1)

## Inbound Syncs

The following are available as inbound streams:

* Data Extensions (Full Refresh only)
* Journey History (Incremental only, beginning 30 days prior to sync start)

## Outbound Syncs

### Supported Targets

* Data Extensions

### Supported Sync Strategies

* Upsert (performs an AddAndUpdate import operation)
* Update (performs an UpdateButDoNotAdd import operation)
* Create (performs an AddAndDoNotUpdate import operation)
* Replace (performs an Overwrite import operation). Note that although Salesforce does not require a primary key for this operation, Omnata Push still requires one in order to properly track the full life cycle of records over time.

These operations are described [here](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/importdefinitionupdatetype.html).

## Functions

### FETCH\_DATA\_EXTENSIONS

Fetches a list of Data Extensions.

Parameters:

* CONNECTION\_SLUG (VARCHAR): The slug of the connection

Examples:

```sql
select *
from table(OMNATA_SALESFORCE_MARKETING_CLOUD_PLUGIN.UDFS.FETCH_DATA_EXTENSIONS(
                'my-sfmc-connection'));
```

### FETCH\_DATA\_EXTENSION\_RECORDS

Fetches records from a Data Extension.

Note that currently this function requires a connection method with FTP credentials.

Parameters:

* CONNECTION\_SLUG (VARCHAR): The slug of the connection
* DATA\_EXTENSION\_NAME (VARCHAR): The name of the data extension

Examples:

```
select *
from table(OMNATA_SALESFORCE_MARKETING_CLOUD_PLUGIN.UDFS.FETCH_DATA_EXTENSION_RECORDS(
                'my-sfmc-connection',
                'My Data Extension'));
```

### FETCH\_DATA\_EXTRACT\_DEFINITION

Fetches an individual data extract definition.

Parameters:

* CONNECTION\_SLUG (VARCHAR): The slug of the connection
* DEFINITION\_ID (VARCHAR): The ID of the data extract definition

Examples:

```
select OMNATA_SALESFORCE_MARKETING_CLOUD_PLUGIN.UDFS.FETCH_DATA_EXTRACT_DEFINITION(
                'my-sfmc-connection',
                'a1bcda25-8359-4c32-9876-452c530c196a');
```

### FETCH\_DATA\_EXTRACT\_DEFINITIONS

Fetches all data extract definitions.

Parameters:

* CONNECTION\_SLUG (VARCHAR): The slug of the connection

Examples:

```
select *
from table(OMNATA_SALESFORCE_MARKETING_CLOUD_PLUGIN.UDFS.FETCH_DATA_EXTRACT_DEFINITIONS(
                'my-sfmc-connection'));
```

### FETCH\_DATA\_EXTRACT\_TYPES

Fetches all data extract types.

Parameters:

* CONNECTION\_SLUG (VARCHAR): The slug of the connection

Examples:

```
select *
from table(OMNATA_SALESFORCE_MARKETING_CLOUD_PLUGIN.UDFS.FETCH_DATA_EXTRACT_TYPES(
                'my-sfmc-connection'));
```
