Campaign

Campaign

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

Name

Type

Description

Name

Type

Description

id

Integer

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

afterid

Integer

Optional – 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

Name

Type

Description

Name

Type

Description

id

String

The campaign ID.

type

String

The campaign type - Email, Portable Media.

name

String

The campaign name.

stage

String

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

description

String

The campaign description.

active

Boolean

Is the campaign active?

category

String

The campaign category.

planName

String

The campaign plan name.

planid

Number

The campaign plan name.

status

String

The most recent status message on the campaign.

startDate

Date

The scheduled start date.

endDate

Date

The scheduled end date.

cutoffDate

Date

The scheduled cutoff date.

emailCountScheduled

Number

The number of emails scheduled, but not yet sent.

emailCountSent

Number

The number of emails sent.

emailCountTest

Number

The number of test emails sent.

emailCountBounce

Number

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

emailPageViewRate

Number

The page view percentage rate.

emailCountPageView

Number

The total page views in this campaign.

timeStamp

Date

Date/Time of last edit.

approvalStatus

String

Approval status.

campaignIntent

String

Campaign intent.

lifeCycle

String

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

Error 4xx

Name

Type

Description

Name

Type

Description

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

Name

Type

Description

Name

Type

Description

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"
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

Name

Type

Description

Name

Type

Description

campaign

Object[]

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

Error 4xx

Name

Type

Description

Name

Type

Description

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