It seems like your browser didn't download the required fonts. Please revise your security settings and try again.

Campaign

  • Last updated on

Permission Required to Use this API Endpoint

Email Campaign – Can Edit All

Read Data of a Campaign

Get detailed information about a specific campaign.

GET /rest/campaigns/id/afterid
Parameters
NameTypeDescription
idInteger

The Campaign ID. See Get all basic campaign data for all campaigns below to retrieve campaign ID information.

afteridIntegerOptional – Use when Paging is required. Each request now returns the maxIdReturned. Use this value as the afterid to retrieve the next page of records if necessary. See Paging below for more details.
access_token String

Set the access token if you have not added it as an Authorization header.

Example Usage
curl -X GET -H "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -H "Cache-Control: no-cache" "https://api.phishline.com/phishline_example/rest/campaigns/1234234234"
Paging

Paging is required if the request will return more than 5,000 records. The HTTP status code will be set to 206 – Partial Content

To get subsequent pages you must pass the maxIdReturned from the current request to the next request as the afterid.  Continue to do this until all the rows are returned and the remainingRowCount is zero and/or the HTTP status code returned is 200.

Example Usage with Paging
curl -X GET -H "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -H "Cache-Control: no-cache" "https://api.phishline.com/phishline_example/rest/campaigns/1234234234/563311"
Success Response Example

Note the following values indicate that paging is needed.

  • status code changes from 200 to 206
  • statusMessage changes from OK to PartialContent
  • remainingRowCount changes from zero to greater than zero

 

HTTP/1.1 200 OK
{
    "status": 200,
    "statusMessage": "OK",
    "statusDetails": {
        "Total Results": 1
    },
    "entity": "campaign",
    "jobid": 0,
    "notifications": {
        "API Token Expiration Date": "2019-09-21 11:15:09",
        "Maximum API calls per hour": 1000,
        "Your API calls in the last hour": 9
    },
    "totalRowCount": 1,
    "pageRowCount": 1,
    "remainingRowCount": 0,
    "maxIdReturned": 1021,
    "data": [
        {
            "type": "Email Campaign",
            "name": "Phishing Assessment 1",
            "stage": "4. Go Live!",
            "description": "First Phishing attempt",
            "active": "1",
            "category": "General",
            "planName": "Assessing current user abilities",
            "planid": "1",
            "status": "The system scheduled 100 new outbound messages.\nThere are 100 total outbound messages.\n",
            "excludeFromReporting": "0",
            "startDate": "2016-06-30 19:13:00",
            "endDate": "2016-07-01 19:13:00",
            "cutoffDate": "2016-07-03 19:13:00",
            "emailCountMax": "100",
            "mediaCount": "0",
            "mediaReportingDate": "0000-00-00 00:00:00",
            "emailCountAvailable": "0",
            "emailCountScheduled": "100",
            "emailCountSent": "0",
            "emailCountTest": "0",
            "emailCountBounce": "0",
            "emailPageViewRate": "7.61",
            "emailCountPageView": "7",
            "timeStamp": "2018-07-05 20:01:15",
            "approvalStatus": "Pending",
            "approvalComment": "",
            "approvalLog": "",
            "scheduleFromAddressTimezone": "0",
            "campaignIntent": "Testing",
            "lifecycle": "Completed",
            "enforceTemplateUniqueness": "0",
            "previewRtaGuid": "",
            "vendorName": "",
            "guid": "846e3761f05c30b87dicdc5d88d744400",
            "locked": "0",
            "id": "1"
        }
    ]
}

 

Success 200
NameTypeDescription
idString

The campaign ID.

typeString

The campaign type - Email, Portable Media.

nameString

The campaign name.

stageString

The current campaign stage (Design, Generate, Approve, Live)

descriptionString

The campaign description.

activeBoolean

Is the campaign active?

categoryString

The campaign category.

planNameString

The campaign plan name.

planidNumber

The campaign plan name.

statusString

The most recent status message on the campaign.

startDateDate

The scheduled start date.

endDateDate

The scheduled end date.

cutoffDateDate

The scheduled cutoff date.

emailCountScheduledNumber

The number of emails scheduled, but not yet sent.

emailCountSentNumber

The number of emails sent.

emailCountTestNumber

The number of test emails sent.

emailCountBounceNumber

The number of emails that have bounced (failed delivery).

emailPageViewRateNumber

The page view percentage rate.

emailCountPageViewNumber

The total page views in this campaign.

timeStampDate

Date/Time of last edit.

approvalStatusString

Approval status.

campaignIntentString

Campaign intent.

lifeCycleString

The current campaign cycle. For example: Completed, Current, Upcoming.

Error 4xx
NameTypeDescription
NotAuthorized 

Only authorized users can access this data.

NotFound 

The campaign was not found.

Error Response Example
HTTP/1.1 404 Not Found
{
  "status": 404,
  "statusMessage": "NotFound",
  "statusDetails": {
    "NotFound": "No campaign found for id 1234234234."
  },
  "entity": "unknown",
  "jobid": 0,
  "notifications": {
    "API Token Expiration Date": "2019-09-21 11:15:09",
    "Maximum API calls per hour": 1000,
    "Your API calls in the last hour": 17
  },
  "data": []
}

Get all basic campaign data for all campaigns

Get basic information about all campaigns.

GET /campaigns
 Parameters
NameTypeDescription
access_tokenString

Set the access token if you have not added it as an Authorization header.

Example Usage
curl -X GET -H "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -H "Cache-Control: no-cache" "https://api.phishline.com/phishline_example/rest/campaigns"
Success Response Example
See the API Success example for a single campaign.  The response is the same, but all campaigns will be listed in the data section, instead of only one.
Success 200
NameTypeDescription
campaignObject[]

List of campaigns. The data is the same as for an individual campaign. See the individual campaign endpoint.

Error 4xx
NameTypeDescription
NotAuthorized 

Only authorized users can access this data.

Error Response Example
HTTP/1.1 401 Not Authorized
{
    "status": 401,
    "statusMessage": "NotAuthorized",
    "statusDetails": {
        "Reason": "Valid access token required. Please re-authenticate."
    },
    "entity": "unknown",
    "jobid": 0,
    "notifications": [],
    "data": []
}

 

                                                               i.      “status” code will change from 200 to 206  

                                                             ii.      “statusMessage” will change to "PartialContent"

                                                           iii.      “remainingRowCount” will be greater than 0

 

/rest