Get list of Campaign Steps

  • GET api/v2/campaigns/:id/steps returns the list of existing campaign steps.

Example

Request:

GET api/v2/campaigns/8/steps

Response:

[
  {
     "id": 652,
     "number": 1,
     "inMinutesCount": 60,
     "templates": [
       {
         "id": 821,
         "emailTemplateId": null,
         "emailTemplateName": "",
         "body": "1",
         "subject": "asdadsa",
         "ccList": "[email protected], [email protected]"
       },
       {
         "id": 822,
         "emailTemplateId": 44,
         "emailTemplateName": "10x",
         "body": "Hi {FirstName},

I have an idea that I can explain in 10 minutes that can get {Company} it’s  next [100 best clients].

I recently used this  idea to help our client {competitor} almost triple their monthly run  rate.

{FirstName}, let’s schedule a 10 minute call, so I can explain. When works best for you?

Thanks,

",
         "subject": "10x {Company} traction in 10 minutes",
         "ccList": "[email protected], [email protected]"
       }
    ]
  },
  {
     "id": 653,
     "number": 2,
     "inMinutesCount": 90,
     "templates": [
        {
          "id": 823,
 "emailTemplateId": null,
 "emailTemplateName": "",
 "body": "Body Text",
 "subject": "10x {Company} traction in 10 minutes",
 "ccList": "[email protected], [email protected]"
        },
        {
 "id": 824,
 "emailTemplateId": null,
 "emailTemplateName": "",
 "body": "body-2-b",
 "subject": "subject-2-b",
 "ccList": "[email protected], [email protected]"
        }
      ]
    }
  }
]

Data type (campaign step type)

  • id. integer, no maximum length, required for post/patch, 0 value for create method
  • number. integer, no maximum length, required (the numbers must be a sequence starting from 1, e.g. 1, 2, 3)
  • inMinutesCount. integer, no maximum length, required, must be greater than or equal to '0' for the first step, must be greater than '1' for the second and subsequent steps
  • templates. list of Campaign Step Template objects, required

Get Campaign Step

  • GET api/v2/campaigns/:id/steps/:stepId returns a particular campaign step in an existing campaign.

Example

Request:

GET api/v2/campaigns/8/steps/652

Response:

200 OK
{
  "id": 652,
  "number": 1,
  "inMinutesCount": 60,
  "templates": [
    {
      "id": 821,
      "emailTemplateId": null,
      "emailTemplateName": "",
      "body": "1",
      "subject": "asdadsa",
      "ccList": "[email protected], [email protected]"
    },
    {
      "id": 822,
      "emailTemplateId": 44,
      "emailTemplateName": "10x",
      "body": "Hi {FirstName},

I have an idea that I can explain in 10 minutes that can get {Company} it’s next [100 best clients].

I recently used this idea to help our client {competitor} almost triple their monthly run rate.

{FirstName}, let’s schedule a 10 minute call so I can explain. When works best for you?

Thanks,

",
      "subject": "10x {Company} traction in 10 minutes",
      "ccList": "[email protected], [email protected]"
    }
  ]
}

Add new step in Campaign

  • POST api/v2/campaigns/:id/steps/ adds a new step to an existing campaign.

This method adds a new step in an existing campaign. The new step number must increase the highest existing step number by 1.

Example

Request:

POST api/v2/campaigns/171/steps
{
  "number": "2",
  "InMinutesCount": "75",
  "templates": [
    {
      "body": "Hello World",
      "subject": "Template Subject",
      "сcList": "[email protected], [email protected]"
    }
  ]
}

Response:

200 OK
{
  "id": 171,
  "name": "Campaign No Settings 777",
  "emailAccount": "[email protected]",
  "status": "Active",
  "startDate": null,
  "settings": {
  "EmailsCountPerDay": 100,
  "daysToFinishProspect": 5,
  "daysFromLastProspectContact": 20,
  "emailSendingDelaySeconds": 67,
  "emailPriorityType": "First step emails",
  "disableOpensTracking": true,
  "repliesHandlingType": "Mark person as finished",
  "enableLinksTracking": false
},
  "steps": [
    {
      "id": 251,
      "number": 1,
      "inMinutesCount": 75,
      "templates": [
        {
          "id": 273,
          "name": "",
          "body": "Hello World",
          "subject": "Template Subject",
          "emailTemplateId": null,
          "attachmentsIdList": "",
          "attachments": [],
          "ccList": null,
          "isLocked": false
        }
      ]
    },
    {
      "id": 254,
      "number": 2,
      "inMinutesCount": 75,
      "templates": [
        {
          "id": 276,
          "name": "",
          "body": "Hello World",
          "subject": "Template Subject",
          "emailTemplateId": null,
          "attachmentsIdList": "",
          "attachments": [],
          "ccList": null,
          "isLocked": false
        }
      ]
    }
  ]
}

Request Data type, campaign steps

  • id. integer, no maximum length, required for post/patch, 0 value for create method
  • number. integer, no maximum length, required (the numbers must be a sequence starting from 1, e.g. 1, 2, 3)
  • inMinutesCount. integer, no maximum length, required, must be greater than or equal to '0' for the first step, must be greater than '1' for the second and subsequent steps
  • templates. list of Campaign Step Template objects, required

Response data type, campaign

  • id.  integer, no maximum length, read-only
  • name. string, maximum length 255 symbols, read and update, required for Create Campaign only
  • emailAccount. string, maximum length 255 symbols, read and update, not required (if default one exists) 
  • status. string, maximum length 25 symbols, read-only
  • settings. object, no maximum length, read and update, not required
  • steps. objects list, no maximum length, read and update, required for Create Campaign only.

Response data type, campaign settings

  • EmailsCountPerDay. integer, no maximum length, read and update, required
  • daysToFinishProspect. integer, no maximum length, read and update, required 
  • daysFromLastProspectContact. integer, no maximum length, read and update, required 
  • emailSendingDelaySeconds. integer, no maximum length, read and update, required 
  • emailPriorityType. string/enum, maximum length 25 symbols, read and update, required 
  • disableOpensTracking. boolean, no maximum length, read and update, required 
  • repliesHandlingType. string/enum, maximum length 25 symbols, read and update, required 
  • enableLinksTracking. boolean, no maximum length, read and update, required. 

Response data type, campaign steps

  • id. integer, no maximum length, required for post/patch, 0 value for create method
  • number. integer, no maximum length, required (the numbers must be a sequence starting from 1, e.g. 1, 2, 3)
  • inMinutesCount. integer, no maximum length, required, must be greater than or equal to '0' for the first step, must be greater than '1' for the second and subsequent steps
  • templates. list of Campaign Step Template objects, required

Error Codes:

1. When there is no campaign with the given id:

400 Bad Request
{
  "message": "The request is invalid.",
  "modelState":
{
  "id": ["There is no campaign with given id" ]
}
}

2. When the step number is wrong:

400 Bad Request
{
  "message": "The request is invalid.",
  "modelState":
    {
      "step.Number": [ "Campaign step numbers must be consequentive starting from 1" ]
    }
}

3. When the given email template id does not exist or cannot be used by current user:

400 Bad Request
{
  "message": "The request is invalid.",
  "modelState":
    {
      "emailTemplateId": [ "The email template wih id = 15 does not exist or cannot be used for your account" ]
    }
}

Update step in Campaign

  • PATCH api/v2/campaigns/:id/steps/ updates and existing step in an existing campaign.

Example

Request:

PATCH api/v2/campaigns/171/steps/652
{
  "number": 1,
  "inMinutesCount": 75,
  "templates": [
    {
      "id": 1457,
      "emailTemplateId": 34,
      "subject": "Subject2",
      "body": "My Body",
      "сcList": "[email protected]"
    }
  ]
}

Response:

200 OK
{
  "id": 652,
  "number": 1,
  "inMinutesCount": 75,
  "templates": [
    {
      "id": 821,
      "emailTemplateId": null,
      "emailTemplateName": "",
      "body": "1",
      "subject": "asdadsa",
      "ccList": "[email protected], [email protected]"
    },
    {
      "id": 822,
      "emailTemplateId": 44,
      "emailTemplateName": "10x",
      "body": "Template Body",
      "subject": "10x {Company} traction in 10 minutes",
      "ccList": "[email protected], [email protected]"
    }
  ]
}

Remove step in campaign

  • DELETE api/v2/campaigns/:id/steps/:stepId removes an existing step from an existing campaign.

You cannot remove a step if:

  1. The campaign was deleted or archived or there is no campaign with given Id;
  2. There is only one step in the campaign;
  3. At least one email was in campaign was already finished.

Example
 

Request:

DELETE api/v2/campaigns/171/steps/652

Response:

200 OK
Did this answer your question?