[SalesForce] Exact Target REST API Can’t Create Send Definition

I am trying to create a send definition via the Exact Target API. I've been using POSTMAN to test my API calls. When I submit a create send definition call I am getting the following error:

{
  "isError": true,
  "message": "Error creating integrated send definition: JSON Deserialization Exception: Location Unknown"
}

Below is the Request I am making via POSTMAN. Note: 'TestClass' is the name and external key of a send classification I created.

{
        "EmailDefinition": {
            "Name": "New Product",
            "EmailId": 17,
            "SendClassificationId": "TestClass",
            "Targets": [
                {
                    "Type": "Campaign",
                    "Name": "New Product Alert"
                }
            ]
        }
}

Best Answer

Based on the additional information that you provided, as you need send an email directly from Marketing Cloud using the Fuel REST API, the createDefinition method that you are using isn't appropriate for what you are trying to acheive.

Instead, you should be using the messageDefinitionSends method which will send a pre-defined email to a subscriber that you include in your request payload. Before using this method, you will firstly need to create a Triggered Send. Once you have done this, you can initiate the Triggered Send using the messageDefinitionSends method as per the screenshot below.

To create a Triggered Send, select Triggered Emails from the Interactions menu in the Email app, click Create and configure the Triggered Send. Once you have saved the Triggered Send, you will need to Start the Triggered Send by selecting the Send then click the Start/Restart button.

Triggered Send menu

Then you will need to include External Key for the Triggered Send that you created in the URL for your POST request to the messageDefinitionSends method:

https://www.exacttargetapis.com/messaging/v1/messageDefinitionSends/key:{{insertExternalKeyHere}}/send
Related Topic