Example

Introduction

The SiteSpect API is based on REST principles and allows you to interact with SiteSpect from any client that supports HTTP requests. All API calls must be authenticated and accessed over SSL (HTTPS) and all data is transported using JSON.

Base URL and Discoverability

You can access the API through a single endpoint based on your SiteSpect environment.

SiteSpect Cloud customers can access the API through:
https://admin1.sitespect.com/api

SiteSpect Enterprise customers use:
http://[CUSTOMER].sitespect.com/api.

An authenticated GET request to the base URL returns all the available resources in a JSON data structure. We highly recommend that you use this base URL in your client-side code and discover resources through link relations. This approach limits the amount of client side changes as the API evolves over time.

Authentication/Token

Example Request:

curl \
  -d '{"username":"john","password":"paS4w0rd"}' \
  -X POST "https://admin1.sitespect.com/api/token"

Example Request:

curl \
  -d '{"apikey":"8as7d98sd7a9asdasdasda"}' \
  -X POST "https://admin1.sitespect.com/api/token"

Example Response

{
	"token": "brtaP8wzrJwJqbAQVnLsftcYA"
	"_links" : {
		"DiscoveryPage" : {
			"href" : "https://admin1.sitespect.com/api",
			"title" : "Available API Resources",
		}
	}
}

You can then pass that token to the “X-API-TOKEN” header for authentication. A DELETE request to the token resource terminates the token.

All API requests must be authenticated with a temporary token that is generated with user credentials or an API key. An API key can be created in your user profile.

Once you have the token, you can pass it into an “X-API-TOKEN” header with the value of the token in order to authenticate the request. The token expires within 15 minutes of non-usage and is tied to the permissions set for the specific user.

To generate a token, you must use SiteSpect and you must make a POST request to the token resource (/api/token) with your user credentials or apikey passed in the body of a JSON object.

Token Body Properties

Param Type Required Default Range Valid values
apikey string Yes - - -
username string Yes - - -
password string Yes - - -

JSON, Dates, and Formatting

Example Response:

{
   "_links" : {
       "site" : {
          "href" : "https://admin1.sitespect.com/api/site/{site-id}",
          "title" : "Site Information",
          "templated" : true
       }
   }
}

All data should be transferred using valid JSON format (with the exception of Campaign report data which, by default, uses CSV format). Since JSON does not specify how to handle hypermedia, the JSON responds using the HAL specification. Many resources are also specified using URI templates, allowing the client to fill in parts of the URI in order to locate the exact resource. When a link element’s href attribute contains a URI template, there is an additional “templated” attribute on the link with a boolean value true.

The response is minified by default but the prettyprint=true query parameter contains stylistic formatting for better readability. All JSON responses are returned with the standard application/json Content-type header to support in-browser display of these resources (with the exception of Campaign report data which is delivered in CSV format by default). If you are using a HAL browser or a client that already understands HAL link relations, you can always pass an Accept: application/hal+json header with your API requests; the server responds with the application/hal+json media type.

All dates must use ISO 8601 format. The following are good examples of a valid ISO 8601 date:

YYYYMMDDThhmmss[+-]hhmm

YYYY-MM-DDThh:mm:ss[+-]hh:mm

HTTP Methods

SiteSpect REST API uses the HTTP protocol for communication and supports the following methods (HTTP verbs) to perform actions on resources:

# Read one campaign
GET campaign/1632

# Read all variation groups under one campaign
GET campaign/1632/variation-groups

# Create a new set
POST site/1/set

# Update a set
PUT site/1/set

# Delete a campaign
DELETE campaign/1632

The response headers of any API call include an Allow header that shows the available methods for any resource and can be used and checked with the OPTIONS request. SiteSpect does not recommend but allows you to overwrite any HTTP method with a “method” URL query parameter. For example, a GET request with a method=POST query parameter performs a POST operation. This ensures maximum compatibility for clients who might not be capable of using certain HTTP verbs.

All collection calls allow only the GET method. The following table provides HTTP methods listed by API resource. Keep in mind that the methods available to you depend on your user privilege level.

Individual Resource Allowed Methods
Assignment Criteria GET
Assignment Criterion GET, DELETE, POST
Bandwidth GET
Cache Purge POST (results in a job you can then GET)
Campaign GET, DELETE, POST, PUT
Campaign Data GET, DELETE
Campaigns GET
Data Set GET, DELETE, POST, PUT
Data Sets GET
Event GET, POST
Events GET
Factor GET, DELETE, POST, PUT
Factors GET
File GET, POST
Files GET
Geo Location GET
Log File POST (results in a log you can then GET)
Log Files GET
Message GET, POST
Messages GET
Page Categories GET
Page Category GET, DELETE, POST, PUT
Performance Summary GET
Response Point GET, DELETE, POST, PUT
Response Points GET
Segment GET, DELETE, POST, PUT
Segments GET
Set GET, DELETE, POST, PUT
Sets GET
Site GET
Site Identities GET
Site Identity GET, DELETE
Site Metrics GET
Site Variation GET, DELETE, POST, PUT
Site Variations GET
Sites GET
Tag GET, DELETE, POST
Tags GET
Top Segments Configuration GET, PUT
Traffic Trends GET
User GET, DELETE, POST, PUT
Variation GET, DELETE, POST, PUT
Variation Group GET, DELETE, POST, PUT
Variation Groups GET
Variations GET

Resources

Uniform resource identifiers (URI) are constructed to indicate a hierarchical relationship between resources; they follow some standards. Every URI has an absolute path, contains only lowercase letters, and does not include a trailing forward slash. Singular nouns are used to represent individual resources and plural nouns are used to represent a collection of resources.

The discovery page or base URL of the API always lists the available resources and we recommend you retrieve the discovery page as a first step in your client side code and discover resources through link relations. Keep in mind that the main endpoint also requires token-based authentication. This section lists the detailed information about each available resource.

Assignment Criteria

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/assignmentcriteria"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
   "_links" : {
    "self" : {
            "href" : "https://admin1.sitespect.com/api/site/1/assignmentcriteria/",
            "title" : "All Assignment Criteria associated with this Site"
        }
   },
   "_embedded" : {
        "assignmentcriteria" : [
        {
                "_links" : {
                        "self" : {
                            "href" : "https://admin1.sitespect.com/api/site/1/assignmentcriterion/",
                            "title" : "Assignment Criterion Details"
                        },
                        "CriteriaTypeLabel" : "User Agent",
                        "CriteriaTypeName" : "USER_AGENT",
                        "ID" : 1,
                        "Name" : "Browser: Chrome",
                        "Status" : "Active"
                }
            },
            {
                ...
            }
   ]}
}

A collection of Assignment Criteria from a specific Site or Campaign, including a subset of each individual Assignment Criterion resource inserted into the “_embedded” JSON object. Retrieving this collection allows the client to view information about Assignment Criteria for a given Site or for a specific Campaign.

Resource URIs

https://admin1.sitespect.com/api/site/{site-id}/assignmentcriteria/{ac-status}

https://admin1.sitespect.com/api/site/{site-id}/campaign/{campaign-id}/assignmentcriteria

URL PARAMETERS GET

Field Type Description
ac-status

string

Optional

Allowed values: 'active', 'inactive'

Assignment Criterion

A resource that shows information for an individual Assignment Criterion. This view also includes extra specific data fields for the type of Assignment Criteria it represents.

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/assignmentcriterion/1"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, DELETE, POST, PUT
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
   "_links" : {
      "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/assignmentcriterion/1 ",
         "title" : "Assignment Criterion Details"
      }
   },
   "BrowserType" : "Chrome(?!.*Opera)",
   "CriteriaTypeLabel" : "User Agent",
   "CriteriaTypeName" : "USER_AGENT",
   "ID" : 1,
   "Name" : "Browser: Chrome",
   "Pre-Select" : "Not Pre-Selected",
   "Site_ID" : 1,
   "Status" : "Active",
   "Tags" : "",
   "associatedCampaigns" : [] 
}

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/assignmentcriterion/{assignmentcriterion-id}

URL Parameters

Property Description
site-id The ID of the Site.
assignmentcriterion-id The ID of the Assignment Criteria.

Body Properties POST PUT

Field Type Description
name String
userasmtcriteria_type String

Allowed values:'USER_GUID','HTTP_HEADER'

dataset_idoptional Integer Required if userasmtcriteria_type is USER_GUID
http_header_typeoptional String

Allowed values:'Request','Response'

Required if userasmtcriteria_type is HTTP_HEADER

http_header_nameoptional String Required if userasmtcriteria_type is HTTP_HEADER
http_header_valueoptional String Required if userasmtcriteria_type is HTTP_HEADER
default_campaign_inclusionoptional Integer Determine if the assignment criterion will be included when a campaign is created 0: not include, 1: include by default, 2: exclude by default

Default value: 0

Allowed values:012

labelsoptional integer/string/array Integer, String, non-empty array of Strings/Integers, comma delimited String

Default value: []

statusoptional Integer The status of AssignmentCriterion. 0: inactive, 1:active

Default value: 1

Allowed values:01

Bandwidth

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/bandwidth"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
   "_links" : {
      "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/bandwidth",
         "title" : "Bandwidth Information"
      }
   },
  "bandwidth" : [
      {
         "inbound" : 4.031,
         "outbound" : 66.841,
         "timeperiod" : "November 2016"
      },
      {
         "inbound" : 5.023,
         "outbound" : 63.25,
         "timeperiod" : "December 2016"
      }
   ]
}

A resource that shows how many gigabytes (GB) of data your Site has received and sent over time.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/bandwidth

Cache Purge

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/siteidentity/1/cachepurge"

Example Response


#HTTP/1.1 201 Created
#Status: 201 Created
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9996
#Location: https://admin1.sitespect.com/api/site/1/siteidentity/1/cachepurge/1

{
   "_links" : {
      "self" : {
         "href" : " https://admin1.sitespect.com/api/site/1/siteidentity/1/cachepurge/1"
      }
   }
}

The Cache Purge resource creates a job that clears the cache from a Site Identity. The resource is created with a POST call and returns with a 201 Created status code, as well as a location header and JSON body, which points to the location of the created cache purge job. We recommend using the location header to make a GET request on the cache purge job and to see the status of the cache purging operation. While the system is still purging, that resource returns a 202 Accepted status code with processing information in the JSON body. Upon purging completion, that resource returns a 200 OK status code.

You can purge individual files from the Site Identity by passing a reference to these files inside a JSON structure in your POST request.

The body param is just an array of files to purge.

Resource URI

https://admin1.sitespect.com /api/site/{site-id}/siteidentity/{siteidentity-id}/cachepurge

URL Parameters

Property Description
site-id The ID of the Site to which the Site Identity belongs.
siteidentity-id The ID of the Site Identity.

Campaign

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/campaign/1"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, DELETE, POST, PUT
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
   "_links" : {
      "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/campaign/1",
         "title" : "Campaign Information"
      },
      "campaignvariations" : {
         "href" : "https://admin1.sitespect.com/api/site/1/campaign/1/campaignvariations",
         "title" : "Campaign Variations associated with this Campaign"
      },
      "variationgroups" : {
         "href" : "https://admin1.sitespect.com/api/site/1/campaign/1/variationgroups",
         "title" : "Campaign's Variation Group Information"
      }
   },
   "CampaignType" : "FullFactorial",
   "Assignments" : 0,
   "ID" : 1,
   "DefaultSet" : true,
   "Status" : "active-running",
   "RecentAssignmentTime" : "2017-06-28T19:42:11",
   "RecentVisitTime" : "2017-06-28T19:42:11",
   "Visits" : 0,
   "Overlay" : false,
   "CampaignSetID" : 5,
   "SetType" : "Experiments",
   "Created" : "2016-06-28T19:42:11"
   "SetName" : "Experiments",
   "EndTime" : "Never",
   "Tags" : "first",
   "Name" : "My First Experiments Campaign",
   "Modified" : "2016-06-28T19:42:11"
}

A resource that shows information about a specific Campaign including links to other sections of the Campaign such as Variation Groups.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/campaign/{campaign-id}

URL Parameters

Property Description
site-id The ID of the Site.
campaign-id The ID of the Campaign.

Body Properties POST PUT

Field Type Description
criticalresponsepointid Integer
name String
optimizationmetric String H:# Hits, B:Beta Hits, T:Transfer Time per hit, V:Captured value per hit

Allowed values:'H''B''T''V'

responsepoints Integer[] An array of ResponsePoint IDs
assignmentfrequencyoptional Integer

Default value: 100

Size range: 0,100

campaignsetoptional Integer

Default value: ID of ExperimentsSet

endofcampaignactionoptional String

Default value: alert

Allowed values:'alert''nonewassignments''pause''end'

endtimeoptional Date When the value is set to 0, campaign will run indefinately.

Default value: 0

goaloptional String

Default value: lowest

Allowed values:'highest''lowest'

tagsoptional integer/string/array Integer, String, non-empty array of Strings/Integers, comma delimited String

Default value: []

maxreweightpercentoptional Integer

Default value: 5

Size range: 1,100

mincontrolweightoptional Integer

Default value: 10

Size range: 1,100

minsamplesizeoptional Integer

Default value: 1000

Size range: 100,10000

minsignificanceleveloptional Integer

Default value: 70

Size range: 1,100

mintimerunningoptional Integer A number of seconds

Default value: 691200

Size range: 86400,31536000

optimizationoptional String

Default value: off

Allowed values:'off''automated''recommendations'

priorityoptional Integer

Default value: 5

Size range: 1,9

reportsamplerateoptional Integer

Default value: 100

Size range: 1,100

rptrackbehavioroptional Integer Specify how to track Response Point hits. 0:'from initial assignment', 1:'after being counted'

Default value: 0

Allowed values:01

starttimeoptional Date

Default value: Current Timestamp

statusoptional String

Default value: review

Allowed values:'active-paused''active-disabled''review''active-scheduled''active-running''active-nonewassignments''ended''archived'

timesinceassignmentlimitoptional Integer A number of seconds

Default value: 2592000

Size range: 1,712155258

timesincelastvisitlimitoptional Integer A number of seconds

Default value: 2592000

Size range: 1,2146878840

userasmtcriteriaoptional Object[] An Array of Objects.'userasmtcriteria': [ { 'id': 'audience_id', 'action': 'include' }, {'id':'audience_id', 'action': 'exclude'} ]

Default value: []

campaignvariationoptional array[] An Array of Ids.'campaignvariations': [ id,id ]

Default value: []

vargrpasmtheadernameoptional String

Default value: null

vargrpasmtheadertypeoptional String

Default value: N/A

Allowed values:'request''response'

vargrpasmtmethodoptional String

Default value: default

Allowed values:'default''specific''random'

variationsoptional Integer[] An array of Variation IDs

Default value: []

visitlimitforusersoptional Integer

Default value: 15

Size range: 1,9999

Campaign Data

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/campaign/1/campaigndata/dataexport/visit"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, DELETE
#Content-Type: text/csv
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997
#X-Report-Status: instant

"User_GUID","AsmtVisitCount","StartTime_SSE","StartTime_English","VisitLength",
"VariationGroup_ID","RefererUrl","EntryPageUrl","Pageviews","TotalVisits",
"TimeSinceFirstVisit (days)","UserAgent","User's IP Address","AncillaryCookie_Val",
"ConcurrentCampaigns","Browser","OS","Height","Width","TouchScreen",
"Wifi","Cellular","KeyBoard","SmartPhone","Tablet","New Campaign 1 (27)",
"New Campaign 1 (27)","New Metric, TotalHitsBi (147)"

The Campaign Data resource contains processed and raw report data from a specific Campaign. You can request raw report data (data export) by visit or user, which results in two separate URIs, depending on the view. You can also request processed report data (Performance Matrix) by visit or user. You can retrieve its main effects or interactions, resulting in four separate URIs depending on the report type. In addition to these different report types, query parameters allow you to filter the report data using many options.

Resource URIs

https://admin1.sitespect.com/api/site/{site-id}/campaign/{campaign-id})

/campaigndata/dataexport/visit

/campaigndata/dataexport/user

/campaigndata/performancematrix/visit/interactions

/campaigndata/performancematrix/visit/maineffects

/campaigndata/performancematrix/user/interactions

/campaigndata/performancematrix/user/maineffects

/campaigndata/topsegments

URL Parameters

Property Description
site-id The ID of the Site to which the Site Identity belongs.
campaign-id The ID of the Site Identity.
instant_report Pass true to request a pre-calculated report.
regenerate Pass true to regenerate the report.

Optional Query Parameters for Data Export Campaign Data GET

Field Type Description
acceptoptional String Accept is a query parameter overwrite of the Accept header.

Default value: csv

Allowed values:'csv''tsv''html'

applied_segment_idoptional Integer This param can be used multiple times to include segments. By default, no segment is included and data will reflect all visits.
endtimeoptional Date/String Valid ISO8601 Date

Default value: Any

excluded_segment_idoptional Integer This param can be used multiple times to exclude segments. By default, no segment is excluded and data will reflect all visits.
lineendoptional String

Default value: lf

Allowed values:'lf''cr''crlf'

quotesoptional String

Default value: double

Allowed values:'double''single''none'

segments_andor_flagoptional String

Default value: or

Allowed values:'and''or'

segment_byoptional String

Default value: visit

Allowed values:'user''visit'

show_ancillarycookie_valoptional Boolean

Default value: true

Allowed values:truefalse

show_concurrentcampaignsoptional Boolean

Default value: true

Allowed values:truefalse

show_factors_idoptional Boolean

Default value: true

Allowed values:truefalse

show_factors_fulloptional Boolean

Default value: true

Allowed values:truefalse

show_headerrowoptional Boolean

Default value: true

Allowed values:truefalse

show_mobile_fieldsoptional Boolean

Default value: true

Allowed values:truefalse

show_starttime_sseoptional Boolean

Default value: true

Allowed values:truefalse

show_starttime_englishoptional Boolean

Default value: true

Allowed values:truefalse

show_starttime_exceloptional Boolean

Default value: true

Allowed values:truefalse

show_totalvisitsoptional Boolean

Default value: true

Allowed values:truefalse

show_timesincefirstvisitoptional Boolean

Default value: true

Allowed values:truefalse

show_user_guidoptional Boolean

Default value: true

Allowed values:truefalse

show_uservisit_asmtvisitcountoptional Boolean

Default value: true

Allowed values:truefalse

show_uservisit_refererurloptional Boolean

Default value: true

Allowed values:truefalse

show_uservisit_remoteaddroptional Boolean

Default value: true

Allowed values:truefalse

show_uservisit_entrypageurloptional Boolean

Default value: true

Allowed values:truefalse

show_useragentoptional Boolean

Default value: true

Allowed values:truefalse

show_uservisit_pageviewsoptional Boolean

Default value: true

Allowed values:truefalse

show_visitlengthoptional Boolean

Default value: true

Allowed values:truefalse

starttimeoptional Date/String Valid ISO8601 Date

Default value: Any

timezoneoptional String

Default value: GMT

Optional Query Parameters for Performance Matrix Campaign Data GET

Field Type Description
acceptoptional String Accept is a query parameter overwrite of the Accept header.

Default value: csv

Allowed values:'csv''json'

applied_segment_idoptional Integer This param can be used multiple times to include segments. By default, no segment is included and data will reflect all visits.
endtimeoptional Date/String Valid ISO8601 date

Default value: Any

excluded_segment_idoptional Integer This param can be used multiple times to exclude segments. By default, no segment is excluded and data will reflect all visits.
precisionoptional Integer

Default value: 2

Size range: 1,6

prettyprintoptional Boolean

Default value: false

Allowed values:truefalse

segments_andor_flagoptional String

Default value: and

Allowed values:'and''or'

show_probabilityoptional Boolean

Default value: true

Allowed values:truefalse

show_zscoreoptional Boolean

Default value: true

Allowed values:truefalse

show_responsepointsoptional Boolean

Default value: true

Allowed values:truefalse

show_uservisitstatsoptional Boolean

Default value: true

Allowed values:truefalse

show_samplestatsoptional Boolean

Default value: true

Allowed values:truefalse

show_avgdeltapercoptional Boolean

Default value: true

Allowed values:truefalse

show_avgdeltaoptional Boolean

Default value: true

Allowed values:truefalse

show_stdoptional Boolean

Default value: true

Allowed values:truefalse

show_confgraphicoptional Boolean

Default value: true

Allowed values:truefalse

show_candlesticksoptional Boolean

Default value: true

Allowed values:truefalse

starttimeoptional Date/String Valid ISO8601 date

Default value: Any

statusoptional String

Default value: all

Allowed values:'all''active''inactive'

Query Parameters for Top Segments Campaign Data

Parameter Type Required Default Range Valid value
metric Integer Yes - - -
onlyallsegment Integer Yes - - ‘1’, '0’
optimizationmetric string Yes - - 'H’, 'B’, ’T’, 'V’, ’S’

Campaigns

A collection of Campaign resources for a specific Site with each individual Campaign resource inserted into the “_embedded” JSON object. Retrieving this collection allows the client to view all Campaigns, their individual details, and links to different sections of the Campaign such as Variation Groups. You can retrieve this collection of Campaigns using a single status (all, review, active-scheduled, active-running, active-nonewassignments, active-disabled, active-paused, ended) or a combination of statuses (i.e., active-running+active-nonewassignments).

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/campaigns"

Example Response

#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
   "_links" : {
      "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/campaigns ",
         "title" : "All Campaigns for a Specific Site"
      }
   },
   "_embedded" : {
      "campaigns" : [
         {
            "_links" : {
               "self" : {
                  "href" : " https://admin1.sitespect.com/api/site/1/campaign/1",
                  "title" : "Campaign Information"
               },
               "variationgroups" : {
                  "href" : "https://admin1.sitespect.com/api/site/1/campaign/1/variationgroups",
                  "title" : "Campaign's Variation Group Information"
               }
            },
            "CampaignType" : "FullFactorial",
            "Assignments" : 0,
            "ID" : 1,
            "DefaultSet" : true,
            "Status" : "active-running",
            "RecentAssignmentTime" : "2017-06-28T19:42:11",
	    "RecentVisitTime" : "2017-06-28T19:42:11",
            "Visits" : 0,
            "Overlay" : false,
            "CampaignSetID" : 5,
            "SetType" : "Experiments",
            "Created" : "2016-06-28T19:42:11",
            "SetName" : "Experiments",
            "EndTime" : "Never",
            "Tags" : "first",
            "Name" : "My First Experiments Campaign",
            "Modified" : "2016-06-28T19:42:11"
         },
         {
            ...
         }
      ]
   }
}

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/campaigns/{campaign-status}

https://admin1.sitespect.com/api/site/{site-id}/campaigns?recent_activity_date=2017-12-05T20:00:00

https://admin1.sitespect.com/api/site/{site-id}/campaigns/archived?recent_activity_date=2017-12-05T20:00:00

URL Parameters GET

Field Type Description
campaign-status

string

Optional

Allowed values: 'ready', 'active-paused', 'active-disabled', 'review', 'active-scheduled', 'active-running', 'active-nonewassignments', 'ended', 'archived'

recent_active_date

Date/String

Optional

Valid ISO8601 Date

Data Set

An individual Data Set resource that can be created, retrieved, updated, purged and deleted using standard HTTP methods. To purge the dataset, use DELETE method on data set's data.

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/dataset/1"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, DELETE, POST, PUT
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
    "Created" : "2016-10-20T14:31:17",
    "StaleTime": "2016-10-20T14:31:17",
    "Name": "SpecialUsers",
    "ItemCount": 467,
    "Modified": "2016-10-20T14:31:17",
    "ID": 1,
    "_links": {
        "self" : {
            "title": "Individual Dataset",
            "href": "https://admin1.sitespect.com/api/site/1/dataset/1"
        }
    }
}

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/dataset
https://admin1.sitespect.com/api/site/{site-id}/dataset/{id}/data

URL Parameters

Property Description
site-id The ID of the Site.

Body Properties POST PUT

Field Type Description
name

string

Required

Default value: -

Size range: -

Allowed values: -

dataset

string/integer

Optional. An array of strings.
"dataset": ["G123543123","G434312312","G123212222"]

Default value: []

Size range: -

Allowed values: -

reportreference

object

Optional.

Default value: {}

Size range: -

Allowed values: -

staledate

date

Optional

Default value: Current Timestamp plus one year

Size range: -

Allowed values: -

Body Properties Put

Field Type Description
name

string

Optional

Default value: -

Size range: -

Allowed values: -

dataset

array

Optional

Default value: -

Size range: -

Allowed values: -

staledate

date

Optional

Default value: -

Size range: -

Allowed values: -

Data Sets

A collection of available Data Sets for a specific Site, including each individual Data Set resource inserted into the “_embedded” JSON object. Retrieving this collection allows the client to see information about all the Data Sets that have been created for a specific Site.

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/datasets"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
   "_links" : {
     "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/datasets",
         "title" : "All Datasets for a Specific Site"
      }
   },
   "_embedded" : {
      "datasets" : [
         {
           "_links" : {
             "self" : {
                 "href" : "https://admin1.sitespect.com/api/site/1/dataset/1",
                 "title" : "Individual Dataset",
              }
         },
         'Name' : 'My DataSet',
         'ID' : 1,
         'Site_ID' : 1,
         'ItemCount' : 192,
         'Created' : '2016-08-01T20:24:00-08:00',
         'Modified' : '2016-08-08T20:24:00-08:00',
         'StaleDate' : '2016-09-08T20:24:00-08:00'
        },
        {
           ...
        }
   ]}
}

Resources URI

https://admin1.sitespect.com/api/site/{site-id}/datasets

URL Parameters

Property Description
site-id The ID of the Site

Event

A resource that shows information for an individual historical event.

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/event/1"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, POST
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
   "_links" : {
      "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/event/1 ",
         "title" : "Individual Event Details"
      }
   },
   "ID" : 1,
   "Time" : "2016-06-28T19:42:11",
   "Type" : "Campaign",
   "User" : "admin",
   "Object" : "Test Campaign 1",
   "Description" : "Campaign – Updated",
   "Text" : "Status Change: Review => Active - Scheduled."
}

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/event/{event-id}

URL Parameters

Property Description
site-id The ID of the Site.
event-id The ID of the event.

Body Properties Post

Field Type Description
category

string

Required

Default value: -

Size range: -

Allowed values: 'site', 'set', 'siteidentity', 'campaign', 'testcampaign', 'assignmentcriteria', 'responsepoint', 'sitevariation', 'variation', 'factor', 'variationgroup', 'dataset', 'segment', 'adminuser', 'apikey'

fid

integer

Id of the object that the event applies to

Default value: -

Size range: -

Allowed values: -

text

string

Required

Default value: -

Size range: -

Allowed values: -

Events

A collection of historical events, including each individual event resource inserted into the “_embedded” JSON object. Retrieving this collection allows the client to view historical events for all resources or a specific resource.

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/events"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
   "_links" : {
     "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/events ",
         "title" : "Events Associated with this Site"
      }
   },
   "_embedded" : {
      "events" : [
         {
           "_links" : {
             "self" : {
                 "href" : "https://admin1.sitespect.com/api/site/1/event/1 ",
                 "title" : "Individual Event Details"
             },
            "ID" : 10,
            "Time" : "2016-06-28T19:42:11",
            "Type" : "Campaign",
            "User" : "admin",
            "Object" : "Test Campaign 1",
            "Description" : "Campaign – Updated",
            "Text" : "Status Change: Review => Active - Scheduled."
         }
        },
        {
           ...
        }
   ]}
}

Resource URIs

https://admin1.sitespect.com/api/site/{site-id}/events

https://admin1.sitespect.com/api/site/{site-id}/events/all

https://admin1.sitespect.com/api/site/{site-id}/{resource}/{resource-id}/events

For Example, retrieving historical events for a Campaign resource looks like this:

https://admin1.sitespect.com/api/site/{site-id}/campaign/{campaign-id}/events

The following is an example of retrieving historical events for a Variation of a Factor:

https://admin1.sitespect.com/api/site/{site-id}/factor/{factor-id}/variation/{variation-id}/events

Factor

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/7/factor/32"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, DELETE, PUT, POST
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
    "_links": {
        "self": {
            "title": "Factor Details",
            "href": "https://admin1.sitespect.com/api/site/7/factor/32"
        }
    },
    "DefaultModificationRegExSearch": "search",
    "Tags": [],
    "DefaultNewVisitRating": 0,
    "DefaultPriority": 50,
    "DefaultDisableWhenNoMatch": true,
    "Type": "Regular",
    "DefaultUrlForPreview": "http://test.domain.com",
    "ID": 32,
    "MatchConditions": [
        {
            "type": "Url",
            "UrlCriterion": "/home",
            "id": 10
        }
    ],
    "DefaultModificationRegExReplace": "find",
    "DefaultRequireRating": 0,
    "Name": "replace search with find",
    "ParentFactorID": null,
    "DefaultAsmtCountLogic": true,
    "Status": "Active",
    "AssociatedCampaigns": [] 
}

A resource that shows information for an individual Factor.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/factor/{factor-id}

Body Properties Post Put

Field Type Description
name String
type String

Allowed values:'amps''clientside''mobile''origin''redirect''regular'

tagsoptional integer/string/array Integer, String, non-empty array of Strings/Integers, comma delimited String

Default value: []

statusoptional String

Default value: active

Allowed values:'inactive''active'

Regular Factors

Field Type Description
countuserwhentriggeredoptional Boolean

Default value: true

Allowed values:truefalse

defaultmodificationregexsearchoptional String

Default value: Empty String

defaultmodificationregexreplaceoptional String

Default value: null

disablecampaignoptional Boolean

Default value: false

Allowed values:truefalse

evaluationsequenceoptional Integer

Default value: 50

Size range: -100,100

isvisuallyeditedoptional Boolean

Default value: false

Allowed values:truefalse

matchconditionsoptional Object[] An Array of Objects.'matchconditions': [ { 'condition': 'value' }, {'condition':'value'} ]

Default value: []

Size range: 0,5

newvisitratingoptional Integer

Default value: 0

Size range: -127,127

pagecategoryidoptional Integer
parentfactoridoptional Integer/String

Default value: undef

requirevisitratingoptional Integer

Default value: 0

Size range: -127,127

urlforpreviewoptional String

Default value: Default URL for Preview

previewoptional String

Default value: Empty String

AMPS Factors

Field Type Description
ampsfilter String

Allowed values:'add_head''collapse_whitespace''combine_css''combine_javascript''convert_jpeg_to_progressive''convert_jpeg_to_webp''convert_meta_tags''convert_png_to_jpeg''convert_to_webp_lossless''defer_javascript''extend_cache''extend_cache_css''extend_cache_images''extend_cache_pdfs''extend_cache_scripts''fallback_rewrite_css_urls''flatten_css_imports''inline_css''inline_images''inline_import_to_link''inline_javascript''inline_preview_images''insert_dns_prefetch''insert_image_dimensions''lazyload_images''make_google_analytics_async''move_css_above_scripts''move_css_to_head''outline_css''outline_javascript''prioritize_critical_css''recompress_images''remove_comments''resize_images''resize_mobile_images''rewrite_css''rewrite_domains''rewrite_images''rewrite_javascript''rewrite_style_attributes''sprite_images''trim_urls'

countuserwhentriggeredoptional Boolean

Default value: true

Allowed values:truefalse

evaluationsequenceoptional Integer

Default value: 50

Size range: -100,100

matchconditionsoptional Object[] An Array of Objects.'matchconditions': [ { 'condition': 'value' }, {'condition':'value'} ]

Default value: []

Size range: 0,5

parentfactoridoptional Integer/String

Default value: undef

urlforpreviewoptional String

Default value: Default URL for Preview

Client-Side Factors

Field Type Description
defaultmodificationregexsearch String
defaultmodificationattributesoptional Object

Default value: null

defaultmodificationcssoptional Object

Default value: null

defaultmodificationregexreplaceoptional String

Default value: null

defaultmodificationscriptoptional String

Default value: null

evaluationsequenceoptional Integer

Default value: 50

Size range: -100,100

isvisuallyeditedoptional Boolean

Default value: false

Allowed values:truefalse

matchconditionsoptional Object[] An Array of Objects.'matchconditions': [ { 'condition': 'value' }, {'condition':'value'} ]

Default value: []

Size range: 0,5

parentfactoridoptional Integer/String

Default value: undef

previewoptional String

Default value: Empty String

urlforpreviewoptional String

Default value: Default URL for Preview

Mobile Factor

Field Type Description
mobiletoken String

Origin Factor

Field Type Description
controlorigincookiename String Alias for controloriginname, either field name can be used here
controlorigincookievalue String Alias for controloriginvalue, either field name can be used here
countuserwhentriggeredoptional Boolean

Default value: true

Allowed values:truefalse

defaultdisablewhencookieconflictoptional Boolean

Default value: true

Allowed values:truefalse

defaultdisablewhenoriginconflictoptional Boolean

Default value: true

Allowed values:truefalse

evaluationsequenceoptional Integer

Default value: 50

Size range: -100,100

parentfactoridoptional Integer/String

Default value: undef

originexperimenttypeoptional String

Default value: header-origin-only

Allowed values:'header-origin-only''header''cookie''url''query-parameter'

urlforpreviewoptional String

Default value: Default URL for Preview

Redirect Factor

Field Type Description
countuserwhentriggeredoptional Boolean

Default value: true

Allowed values:truefalse

defaultmodificationregexsearchoptional String

Default value: Empty String

defaultmodificationregexreplaceoptional String

Default value: null

defaultvariationredirecttypeoptional Integer/String

Default value: 301

Allowed values:'301''302''internal'

disablecampaignoptional Boolean

Default value: false

Allowed values:truefalse

evaluationsequenceoptional Integer

Default value: 50

Size range: -100,100

isvisuallyeditedoptional Boolean

Default value: false

Allowed values:truefalse

matchconditionsoptional Object[] An Array of Objects.'matchconditions': [ { 'condition': 'value' }, {'condition':'value'} ]

Default value: []

Size range: 0,5

newvisitratingoptional Integer

Default value: 0

Size range: -127,127

parentfactoridoptional Integer/String

Default value: undef

requirevisitratingoptional Integer

Default value: 0

Size range: -127,127

urlforpreviewoptional String

Default value: Default URL for Preview

Factors

Example Request


curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/7/factors"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
    "_links": {
        "self": {
            "href": "https://admin1.sitespect.com/api/site/7/factors",
            "title": "All Factors associated with this Site"
        }
    },
    "_embedded": {
        "factors": [
            {
                "DefaultModificationRegExReplace": "find",
                "MatchConditions": null,
                "ParentFactorID": null,
                "Name": "replace search with find",
                "DefaultRequireRating": 0,
                "DefaultAsmtCountLogic": true,
                "Status": "Active",
                "Tags": [],
                "DefaultModificationRegExSearch": "search",
                "DefaultPriority": 50,
                "DefaultDisableWhenNoMatch": true,
                "DefaultNewVisitRating": 0,
                "DefaultUrlForPreview": "http://test.domain.com",
                "Type": "Regular",
                "_links": {
                    "self": {
                        "title": "Factor Details",
                        "href": "https://admin1.sitespect.com/api/site/7/factor/32"
                    }
                },
                "ID": 32
            },
            ...
        ]
    }
}

A collection of Factors from a specific Site, including each individual Factor resource inserted into the “_embedded” JSON object. You can filter this collection by active or inactive status.(i.e., https://admin1.sitespect.com/api/site/{site-id}/factors/active).

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/factors/{factor-status}

URL Parameters Get

Field Type Description
factor-status

string

Optional

Allowed values: 'active', 'inactive'

File

Example Request

curl
  -H "Content-Type:multipart/form-data"
  -H "X-API-TOKEN:DgyXvOwGKClXZWTyDN68gDXea"
  -F "Filename=@/Users/example/Downloads/example.jpg"
  -F "name=Filename"
  "https://admin1.sitespect.com/api/site/1/file"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Content-Type: application/json; charset=utf-8
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9897

{
    "_links": {
        "self": {
            "title": "Stored Files",
            "href": "https://admin1.sitespect.com/api/site/1/files"
        }
    },
    "DefaultUrlForPreview": "http://example.com",
    "Files": [
        {
            "UploadTime": "2016-05-30T15:28:06",
            "FilePath": "/__ssobj/static/example.png",
            "Name": "powered.png"
        }
    ],
    "synced": "2018-05-23T19:36:27"
}

A resource for creating a file in the SiteSpect file store. It allows a POST request for creation and then the binary file can be retrieved through a regular request to the file location. The POST requires a “filename” parameter and the file must be uploaded using form data.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/file

URL Parameters

Property Description
site-id The ID of the Site.

Body Properties Post

Field Type Description
Filename

object

Required

Default value: -

Size range: -

Allowed values: 'formData with a file input with name attribute of "Filename"'

Files

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/files"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
    "_links": {
        "self": {
            "title": "Stored Files",
            "href": "https://admin1.sitespect.com/api/site/1/files"
        }
    },
    "DefaultUrlForPreview": "http://engine.mobile-sandbox.com",
    "Files": [
        {
            "UploadTime": "2016-05-30T15:28:06",
            "FilePath": "/__ssobj/static/powered.png",
            "Name": "powered.png"
        }
    ],
    "synced": "2016-05-30T15:28:15"
}

A collection of files from a specific Site, including the individual file information for each inserted into the Files array. Do not use the “_embedded” JSON object; an individual file request does not go through the API but as a direct request to the binary file via the file path.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/files

URL Parameters

Property Description
site-id The ID of the Site.

Geo Location

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/geoselector/geoarea"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
    "_links": {
        "self": {
            "href": "https://admin1.sitespect.com/api/geoselector/geoarea",
            "title": "GeoArea Information"
        }
    },
    "Type": "GeoArea",
    "ID": "all",
    "_embedded": [
        {
            "_links": {
                "self": {
                    "href": "https://admin1.sitespect.com/api/geoselector/geoarea/americas",
                    "title": "GeoCountry for a Specific GeoArea"
                }
            },
            "Name": "Americas",
            "Type": "GeoArea",
            "ID": "americas",
            "ChildType": "GeoCountry"
        },
        {
            "ChildType": "GeoCountry",
            "ID": "apac",
            "Type": "GeoArea",
            "Name": "Asia Pacific",
            "_links": {
                "self": {
                    "title": "GeoCountry for a Specific GeoArea",
                    "href": "https://admin1.sitespect.com/api/geoselector/geoarea/apac"
                }
            }
        },
        {
            "_links": {
                "self": {
                    "href": "https://admin1.sitespect.com/api/geoselector/geoarea/emea",
                    "title": "GeoCountry for a Specific GeoArea"
                }
            },
            "Name": "Europe, the Middle East and Africa",
            "ID": "emea",
            "ChildType": "GeoCountry",
            "Type": "GeoArea"
        }
    ]}

A resource that shows geo-location information. You can use this resource to browse and explore SiteSpect’s geographical database.

Resource URI

https://admin1.sitespect.com/api/geoselector/geoarea

URL Parameters

Property Description
site-id The ID of the Site.

Log File

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/logfile/1"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, POST
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
   "_links" : {
      "self" : {
          "href" : "https://admin1.sitespect.com/api/site/1/logfile/1",
          "title" : "Individual log file information"
      },
      "download" : {
           "href" : "https://admin1.sitespect.com/api/site/1/logfile/1/download",
           "title" : "Download log file"
       }
    },
    "End" : "2016-07-17T20:00:00",
    "ID" : 1,
    "Name" : "07-08-2016-20:00_TO_07-17-2016-20:00_10.log",
    "SiteIdentities" : [
        10
     ],
    "Site_ID" : 1,
    "Size" : "0.00 KB",
    "Start" : "2016-07-08T20:00:00",
    "Status" : "New"           
}

A resource that shows information about a specific log file or creates a log file, depending on what HTTP method is used to call on this resource. A GET request provides information about an individual log file and this information contains a URL path for the actual log data download. A POST request to this resource initiates log file creation.

Resource URIs

https://admin1.sitespect.com/api/site/{site-id}/logfile

https://admin1.sitespect.com/api/site/{site-id}/logfile/{logfile-id}

https://admin1.sitespect.com/api/site/{site-id}/logfile/{logfile-id}/download

URL Parameters

Property Description
site-id The ID of the Site.
logfile-id The ID of the log file.

Body Properties Post

Field Type Description
start

date

Required

Default value: -

Size range: -

Allowed values: -

end

date

Required

Default value: -

Size range: -

Allowed values: -

siteidentities

integer

Optional

Default value: Array of all SiteIdentities

Size range: -

Allowed values: -

Log Files

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/logfiles"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
   "_links" : {
     "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/logfiles",
         "title" : "All log files for this Site"
      }
   },
   "_embedded" : {
      "logfiles" : [
         {
           "_links" : {
             "self" : {
                 "href" : "https://admin1.sitespect.com/api/site/1/logfile/1",
                 "title" : "Individual log file information"
              },
             "download" : {
                 "href" : "https://admin1.sitespect.com/api/site/1/logfile/1/download",
                 "title" : "Download log file"
              }
          },
          "End" : "2016-07-17T20:00:00",
          "ID" : 1,
          "Name" : "07-08-2016-20:00_TO_07-17-2016-20:00_10.log",
          "SiteIdentities" : [
             10
           ],
          "Site_ID" : 1,
          "Size" : "0.00 KB",
          "Start" : "2016-07-08T20:00:00",
          "Status" : "New"           
          }
        },
        {
           ...
        }
   ]}
}

A collection of available log files for a specific Site, including each individual Log File resource inserted into the “_embedded” JSON object. Retrieving this collection allows the client to see information about all the log files that have been created for a specific Site.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/logfiles

URL Parameters

Property Description
site-id The ID of the Site.

Message

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/7/message/5"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, POST
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
    "_links": {
        "self": {
            "href": "https://admin1.sitespect.com/api/message/5",
            "title": "Message Information"
        }
    },
    "Description": null,
    "TemplateBody": null,
    "CreateTime": "2016-05-30T15:18:15",
    "ID": 5,
    "Subject": "Sample Subject",
    "SiteID": null,
    "IsHTML": true,
    "MessageTemplateID": null,
    "ReadTime": "never",
    "AdminUserID": 4,
    "TemplateSubject": null,
    "Body": "Sample Body",
    "MessageTemplateData": null
}

A resource that shows information for an individual message.

Resource URI

https://admin1.sitespect.com/api/message/{message-id}

URL Parameters

Property Description
site-id The ID of the Site.
message-id The ID of the message.

Body Properties Post

Field Type Description
subject

string

Required

Default value: -

Size range: -

Allowed values: -

body

string

Required

Default value: -

Size range: -

Allowed values: -

ids

integer

Any array of System User IDs. Message will be sent to those users

Default value: -

Size range: -

Allowed values: -

Messages

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/7/messages"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
    "_links": {
        "self": {
            "href": "https://admin1.sitespect.com/api/site/7/messages",
            "title": "All Messages for a Specific Site"
        }
    },
    "_embedded": {
        "messages": [
            {
                "_links": {
                    "self": {
                        "title": "Message Information",
                        "href": "https://admin1.sitespect.com/api/message/5"
                    }
                },
                "CreateTime": "2016-05-30T15:18:15",
                "Site_Name": null,
                "Subject": "Sample Subject",
                "ID": 5,
                "ReadTime": "Never"
            }
        ]
    }
}

A collection of messages from a specific Site, including each individual Message resource inserted into the “_embedded” JSON object. Retrieving this collection allows the user to retrieve all of his or her messages. To filter by read or unread messages, just attach that URL parameter at the end of the request (i.e., https://admin1.sitespect.com/api/site/7/messages/unread).

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/messages

Body Properties

Field Type Description
messages-status

string

Optional

Allowed values: 'read', 'unread'

Page Categories

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/pagecategories"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
  "_links": {
    "self": {
      "title": "All Page Categories associated with this Site",
      "href": "https://admin1.sitespect.com/api/site/1/pagecategories/"
    }
  },
  "_embedded": {
    "pagecategories": [
      {
        "ID": "11",
        "_links": {
          "self": {
            "title": "Page Category Details",
            "href": "https://admin1.sitespect.com/api/site/1/pagecategory/11"
          }
        },
        "Name": "Product Pages"
      }
    ]
  }
}

A collection of Page Categories from a specific Site, including a subset of each individual page category resource inserted into the “_embedded” JSON object. Retrieving this collection allows the client to view a subset of information about all page categories for a given Site.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/pagecategories

Page Category

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/pagecategory/11"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, POST, PUT, DELETE
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
  "_links": {
    "self": {
      "title": "Page Category Details",
      "href": "https://admin1.sitespect.com/api/site/1/pagecategory/11"
    }
  },
  "ID": "11",
  "Name": "Product Pages",
  "MatchConditions": [
    {
      "site_id": "1",
      "type": "Url",
      "id": "1211",
      "UrlCriterion": "/product/"
    }
  ]
}

A resource that shows information for an individual Page Category, including all the Match Conditions that are associated with the pages it represents.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/pagecategory/{pagecategory-id}

Body Properties Post Put

Field Type Description
name String
matchconditionsoptional Object[] An Array of Objects.'matchconditions': [ { 'condition': 'value' }, {'condition':'value'} ]

Default value: []

Performance Summary

A resource that shows the dashboard report or performance summary of your campaigns. You can pass status as a query parameter to filter the campaigns.

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://demo.sitespect.com/api/site/1/campaigns/PerformanceSummary"

Example Response

#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
    "_links": {
        "self": {
            "href": "https://demo.sitespect.com/api/site/1/campaigns/PerformanceSummary",
            "title": "Dashboard Performance Summary"
        }
    },
    "tags": [
        "promos"
    ],
    "campaigns": [
        {
            "ResponsepointName": "Action: Add to Bag",
            "StartTime": "2016-09-25 09:00:00",
            "OptimizationMetric": "B",
            "Tags": [
                "list-page"
            ],
            "Status": "active-running",
            "Name": "Search Result Layout",
            "IsPinned": true,
            "VariationGroups": [
                {
                    "Significance": 99.956406,
                    "Status": 1,
                    "Name": "Large Images",
                    "Cumulative_Visitors": 315651,
                    "LastDay": "2016-06-23",
                    "Cumulative_Sum_Values": 57333,
                    "Visitors": 12690,
                    "ID": 99287,
                    "Sum_Values_Squares": 1607,
                    "Sum_Values": 1607,
                    "Cumulative_Average": 0.181634146573272,
                    "Cumulative_Sum_Values_Squares": 57333,
                    "ChangeFromControl": 0.01909739350367,
                    "IsControl": 0,
                    "DaysAtTrustworthiness": {
                        Good: 8,
                        Better: 8,
                        Best: 8
                    }
                },
                {
                    "Visitors": 12495,
                    "Name": "Control Group",
                    "Status": 1,
                    "LastDay": "2016-06-23",
                    "Cumulative_Sum_Values": 56072,
                    "Cumulative_Visitors": 314604,
                    "Cumulative_Sum_Values_Squares": 56072,
                    "IsControl": 1,
                    "ID": 99286,
                    "Cumulative_Average": 0.178230410293575,
                    "Sum_Values": 1441,
                    "Sum_Values_Squares": 1441
                }
            ],
            "CampaignSetID": 1476,
            "CriticalResponsePointID": 66117,
            "ID": 3146
        }
    ]
}

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/campaigns/PerformanceSummary

https://admin1.sitespect.com/api/site/{site-id}/campaigns/PerformanceSummary?trustworhy=1

URL Parameters GET

Field Type Description
statusoptional String Optional Query Parameter used to filter campaigns

Default value: active-running

Allowed values:'active-paused''active-disabled''review''ready''active-scheduled''active-running''active-nonewassignments''ended''archived'

trustworhyoptional number Option Query Parameter used to return the days the campaigns has been at 90% significance or more

The value need to be set to 1

Response Point

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/responsepoint/1"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, DELETE, POST, PUT
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
   "_links" : {
      "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/responsepoint/1 ",
         "title" : "Response Point Details"
      }
   },
   "AssociatedCampaigns" : [
      {
         "_links" : {
            "self" : {
               "href" : " https://admin1.sitespect.com/api/site/1/campaign/1",
               "title" : "Campaign Information"
            }
         },
         "TestCampaign_ID" : 1,
         "TestCampaign_Name" : "2016.06.28",
         "TestCampaign_Status" : "review"
      },
      {
         "_links" : {
            "self" : {
               "href" : "https://admin1.sitespect.com/api/site/1/campaign/2",
               "title" : "Campaign Information"
            }
         },
         "TestCampaign_ID" : 2,
         "TestCampaign_Name" : "TC1",
         "TestCampaign_Status" : "active - running"
      }
   ],
   "BodyContentCriteriaRegEx" : "",
   "CgiNameCriteria" : "",
   "CgiValueCriteriaRegEx" : "",
   "CompositeEquation" : null,
   "CountUserWhenTriggered" : false,
   "EvaluationSequence" : 75,
   "HTTPHeaderNameRegEx" : "",
   "HTTPHeaderValueRegEx" : "",
   "ID" : 1,
   "IsBaseline" : false,
   "IsComposite" : false,
   "Name" : "RP1",
   "NewVisitRating" : 0,
   "ReportingMetrics" : [
      "Hits"
   ],
   "RequiredVisitRating" : 0,
   "Site_ID" : 1,
   "Status" : "Active",
   "Updated" : "2016-06-24T15:18:19",
   "UrlCriteriaRegEx" : "/",
   "UrlForPreview" : "http://www.domain.com",
   "IsCritical" : true,
   "Description" : "",
   "MeasurementType" : "page_views",
   "CreateTime" : "2016-06-24T15:18:19"
}

A resource that shows information for an individual Response Point. This view also includes an array of associated Campaigns, which show the Campaigns that contain the Response Point.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/responsepoint/{responsepoint-id}

URL Parameters

Property Description
site-id The ID of the Site.
responsepoint-id The ID of the Response Point.

Body Properties Post Put

Field Type Description
name String
capturecginameoptional String

Default value: null

capturebodycontentregexoptional String

Default value: null

countuserwhentriggeredoptional Boolean

Default value: false

Allowed values:truefalse

compositeequationoptional String

Default value: null

customvarurlparameteroptional String Required if the Responsepoint is CustomVariable

Default value: null

customvarbodytextoptional String Required if the Responsepoint is CustomVariable

Default value: null

evaluationsequenceoptional Integer

Default value: 10

Size range: -100,100

isbaselineoptional Boolean

Default value: false

Allowed values:truefalse

iscompositeoptional Boolean

Default value: false

Allowed values:truefalse

tagsoptional integer/string/array Integer, String, non-empty array of Strings/Integers, comma delimited String

Default value: []

matchconditionsoptional Object[] An Array of Objects.'matchconditions': [ { 'condition': 'value' }, {'condition':'value'} ]

Default value: []

newvisitratingoptional Integer

Default value: 0

Size range: -127,127

prepopulatedrpoptional Boolean

Default value: false

Allowed values:truefalse

reportingmetricsoptional String H:# Hits, B:Beta Hits, T:Transfer Time per hit, V:Captured value per hit, S:transfer time (seconds) per hit, C: Custom Variable

Default value: H

Allowed values:'H''B''T''V''S''C'

requirevisitratingoptional Integer

Default value: 0

Size range: -127,127

statusoptional String

Default value: active

Allowed values:'inactive''active'

urlforpreviewoptional String

Default value: Default URL for Preview

ismobileappoptional Boolean

Default value: false

Allowed values:truefalse

mobiletokenoptional String Required if ismobileapp is true
measurementtypeoptional String

Default value: "page_views"

IsCriticaloptional Boolean

Default value: false

Descriptionoptional String

Default value: ""

Response Points

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/responsepoints"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
   "_links" : {
     "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/responsepoints",
         "title" : "All Response Points associated with this Site"
      }
   },
   "_embedded" : {
      "responsepoints" : [
         {
           "_links" : {
             "self" : {
                 "href" : "https://admin1.sitespect.com/api/site/1/responsepoint/1 ",
                 "title" : "Response Point Details"
              },
            "BodyContentCriteriaRegEx" : "",
            "CgiNameCriteria" : "",
            "CgiValueCriteriaRegEx" : "",
            "CompositeEquation" : null,
            "CountUserWhenTriggered" : false,
            "EvaluationSequence" : 75,
            "HTTPHeaderNameRegEx" : "",
            "HTTPHeaderValueRegEx" : "",
            "ID" : 1,
            "IsBaseline" : false,
            "IsComposite" : false,
            "Name" : "RP1",
            "NewVisitRating" : 0,
            "ReportingMetrics" : [
               "Hits"
            ],
            "RequiredVisitRating" : 0,
            "Site_ID" : 1,
            "Status" : "Active",
            "Updated" : "2016-06-24T15:18:19",
            "UrlCriteriaRegEx" : "/",
			"CreateTime" : "2016-06-24T15:18:19",
            "UrlForPreview" : "http://www.domain.com",
			"IsCritical" : true,
			"Description" : "",
			"MeasurementType" : "page_views",
        },
        {
           ...
        }
   ]}
}

A collection of Response Points from a specific Site or Campaign, including a subset of each individual Response Point resource inserted into the “_embedded” JSON object. Retrieving this collection allows the client to view Response Points for a given Site or for a specific Campaign. The collection call does not include information about associated Campaigns.

Resource URIs

https://admin1.sitespect.com/api/site/{site-id}/responsepoints/{responsepoints-status}

https://admin1.sitespect.com/api/site/{site-id}/campaign/{campaign-id}/responsepoints

URL Parameters Get

Field Type Description
responsepoints-status

string

Optional

Allowed values: 'active', 'inactive'

Segment

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/segment/1"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, DELETE, POST, PUT
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
   "_links" : {
      "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/segment/1 ",
         "title" : "Individual Segment Details"
      }
   },
   "ID" : 232,
   "Status" : "active",
   "Equation" : "([ReferringURL] like '%.%')",
   "Tag" : "",
   "Name" : "Referral: Has Referring URL "
}

A resource that shows information for an individual Segment.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/segment/{segment-id}

URL Parameters

Property Description
site-id The ID of the Site.
segment-id The ID of the Segment.

Body Properties Post Put

Field Type Description
name String
equation Integer/String
tagsoptional integer/string/array Integer, String, non-empty array of Strings/Integers, comma delimited String

Default value: []

modeoptional String

Default value: Expert

Allowed values:'Normal''Expert'

statusoptional Integer/String

Default value: active

Allowed values:'active''inactive'

Segments

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/segments"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
   "_links" : {
     "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/segments ",
         "title" : "All Segments"
      }
   },
   "_embedded" : {
      "segments" : [
         {
           "_links" : {
             "self" : {
                 "href" : "https://admin1.sitespect.com/api/site/1/segment/1 ",
                 "title" : "Individual Segment Details"
              },
            "ID" : 232,
            "Status" : "active",
            "Equation" : "([ReferringURL] like '%.%')",
            "Tag" : "",
            "Name" : "Referral: Has Referring URL"
           }
        },
        {
           ...
        }
   ]}
}

A collection of Segments from a specific Site, including each individual Segment resource inserted into the “_embedded” JSON object. Retrieving this collection allows the client to view Segment information, which can be used to organize Campaign report data by a specific Segment.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/segments

URL Parameters

Property Description
site-id The ID of the Site.

Set

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/7/set/12"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, DELETE, PUT, POST
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
    "_links": {
        "campaigns": {
            "href": "https://admin1.sitespect.com/api/site/7/set/12/campaigns",
            "title": "Campaigns in a specific Set"
        },
        "self": {
            "href": "https://admin1.sitespect.com/api/site/7/set/12",
            "title": "Campaign Set Information"
        }
    },
    "ImportSet": false,
    "CanEdit": false,
    "UserAsmtCriteriaRelated": [],
    "Overlay": false,
    "CanEditName": false,
    "SetType": "Experiments",
    "ID": 12,
    "DefaultSet": true,
    "CanEditOverlay": false,
    "CanDelete": false,
    "Campaigns": 0,
    "Name": "Experiments"
}

A resource that shows information for an individual Set.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/set/{campaign-set-id}

URL Parameters

Property Description
site-id The ID of the Site.
campaign-set-id The ID of the Campaign Set.

Body Properties Post

Field Type Description
name String
overlayoptional Boolean

Default value: false

Allowed values:truefalse

Body Properties Put

Field Type Description
name String
overlayoptional Boolean

Default value: false

Allowed values:truefalse

Sets

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/7/sets"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
    "_links": {
        "self": {
            "href": "https://admin1.sitespect.com/api/site/7/sets",
            "title": "All Campaign Sets for a specific Site"
        }
    },
    "_embedded": {
        "sets": [
            {
                "Name": "Experiments",
                "CanDelete": false,
                "CanEditOverlay": false,
                "Campaigns": 0,
                "_links": {
                    "campaigns": {
                        "title": "Campaigns in a specific Set",
                        "href": "https://admin1.sitespect.com/api/site/7/set/12/campaigns"
                    },
                    "self": {
                        "title": "Campaign Set Information",
                        "href": "https://admin1.sitespect.com/api/site/7/set/12"
                    }
                },
                "ID": 12,
                "DefaultSet": true,
                "CanEdit": false,
                "UserAsmtCriteriaRelated": [],
                "CanEditName": false,
                "Overlay": false,
                "SetType": "Experiments",
                "ImportSet": false
            },
            {
                "_links": {
                    "self": {
                        "href": "https://admin1.sitespect.com/api/site/7/set/13",
                        "title": "Campaign Set Information"
                    },
                    "campaigns": {
                        "title": "Campaigns in a specific Set",
                        "href": "https://admin1.sitespect.com/api/site/7/set/13/campaigns"
                    }
                },
                "ID": 13,
                "DefaultSet": false,
                "CanEdit": false,
                "CanEditName": false,
                "UserAsmtCriteriaRelated": [],
                "Overlay": true,
                "SetType": "Targeting",
                "ImportSet": false,
                "Name": "Targeting",
                "CanEditOverlay": false,
                "CanDelete": false,
                "Campaigns": 0
            }
        ]
    }
}

A collection of Sets from a specific Site, including each individual Set resource inserted into the “_embedded” JSON object. Retrieving this collection allows the client to get information on all the Sets and then retrieve Campaigns that belong to a specific Set.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/sets

URL Parameters

Property Description
site-id The ID of the Site.

Site

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
   "_links" : {
     "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1",
         "title" : "Data associated with this Site"
      }
   },
   "ActiveCampaigns" : 1,
   "ID" : 1,
   "Status" : "Online",
   "TotalCampaigns" : 2,
   "Created" : "2016-06-24T15:18:02",
   "Name" : "Default Site",
   "ActiveAssignments" : 100,
   "LastModified" : "2016-06-24T15:18:02",
   "BackEndProxyTimeout" : 60,
   "TotalAssignments" : 100
}

A resource that shows information about an individual Site.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}

URL Parameters

Property Description
site-id The ID of the Site.

Site Identities

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/sites/siteidentities"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
   "_links" : {
      "find" : {
         "href" : "https://admin1.sitespect.com/api/site/{site-id}/siteidentity/{siteidentity-id}",
         "templated" : 1
      },
      "self" : {
         "href" : "https://admin1.sitespect.com/api/sites/siteidentities",
         "title" : "All Site Identities"
      }
   },
   "_embedded" : {
      "siteidentities" : [
         {
           "BackEndIPAddress" : "10.10.10.10",
           "BackEndPort" : "8080",
           "BackEndProtocol" : "http",
           "Description" : "www.domain.com",
           "FrontEndName" : "www.domain.com",
           "FrontEndPort" : "80",
           "FrontEndProtocol" : "http",
           "LastPurgeMethod" : "Control Panel",
           "LastPurgeTime" : "Never",
           "_links" : {
              "cachepurge" : {
                 "href" : "https://admin1.sitespect.com/api/site/1/siteidentity/1/cachepurge",
                 "title" : "Cache Purge"
              },
              "self" : {
                 "href" : "https://admin1.sitespect.com/api/site/1/siteidentity/1"
              }
           }
        },
        {
           ...
        }
   ]}
}

A collection of Site Identity resources from all Sites available to the API user, including each individual site identity resource inserted into the “_embedded” JSON object. Retrieving this collection allows the client to view every Site Identity for each Site, retrieve a subset of Site Identity information, and find sub resources that belong to that Site Identity (like cache purge).

Resource URI

https://admin1.sitespect.com/api/sites/siteidentities

URL Parameters

Property Description
site-id The ID of the Site.

Site Identity

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/siteidentity/1"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, DELETE
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
   "_links" : {
      "cachepurge" : {
         "href" : "https://admin1.sitespect.com/api/site/1/siteidentity/1/cachepurge",
         "title" : "Cache Purge"
      },
      "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/siteidentity/1"
      }
   },
   "BackEndIPAddress" : "10.10.10.10",
   "BackEndPort" : "8080",
   "BackEndProtocol" : "http",
   "Description" : "www.domain.com",
   "FrontEndName" : "www.domain.com",
   "FrontEndPort" : "80",
   "FrontEndProtocol" : "http",
   "LastPurgeMethod" : "Control Panel",
   "LastPurgeTime" : "Never"
}

A resource that shows configuration information for an individual Site Identity.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/siteidentity/{siteidentity-id}

URL Parameters

Property Description
site-id The ID of the Site.
siteidentity-id The ID of the Site Identity.

Site Metrics

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/7/sitemetrics"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
   "_links": {
        "self": {
            "title": "Site Metrics Information",
            "href": "https://admin1.sitespect.com/api/site/7/sitemetrics"
        }
    },
    "NewUsers": {
        "data": [
            {
                "date": "2016-05-10",
                "traffic": 0
            },
            {
                "traffic": 0,
                "date": "2016-05-27"
            },
            ...
        ],
        "FID": 7,
        "Total": 0,
        "ChildFID": 0,
        "Category": 0,
        "SubCategory": 0,
        "Site_ID": 7,
        "DayCount": 0
    },
    "Robot": {
        "FID": 7,
        "Total": 0,
        "data": [
            {
                "traffic": 0,
                "date": "2016-03-12"
            },
            {
                "traffic": 0,
                "date": "2016-04-26"
            },
            ...
        ],
        "Site_ID": 7,
        "DayCount": 0,
        "ChildFID": 0,
        "Category": 0,
        "SubCategory": 6
    },
    "UserAsmtCritSample": {
        "data": [
            {
                "date": "2016-03-04",
                "traffic": 0
            },
            {
                "traffic": 0,
                "date": "2016-03-23"
            },
            ...
        ],
        "Total": 0,
        "FID": 7,
        "Category": 0,
        "SubCategory": 9,
        "ChildFID": 0,
        "Site_ID": 7,
        "DayCount": 0
    },
    "UnassignedUsers": {
        "Total": 0,
        "FID": 7,
        "data": [
            {
                "date": "2016-03-16",
                "traffic": 0
            },
            {
                "traffic": 0,
                "date": "2016-03-02"
            },
            ...
        ],
        "DayCount": 0,
        "Site_ID": 7,
        "SubCategory": 2,
        "Category": 0,
        "ChildFID": 0
    },
    "HumanTestNotInjected": {
        "data": [
            {
                "traffic": 0,
                "date": "2016-05-02"
            },
            {
                "date": "2016-03-08",
                "traffic": 0
            },
            ...
        ],
        "Total": 0,
        "FID": 7,
        "Category": 0,
        "SubCategory": 5,
        "ChildFID": 0,
        "Site_ID": 7,
        "DayCount": 0
    },
    "ReturnUsers": {
        "Category": 0,
        "SubCategory": 10,
        "ChildFID": 0,
        "DayCount": 0,
        "Site_ID": 7,
        "data": [
            {
                "date": "2016-04-23",
                "traffic": 0
            },
            {
                "date": "2016-04-10",
                "traffic": 0
            },
            ...
        ],
        "Total": 0,
        "FID": 7
    },
    "HumanTestNoCookie": {
        "FID": 7,
        "Total": 0,
        "data": [
            {
                "date": "2016-04-17",
                "traffic": 0
            },
            {
                "date": "2016-03-24",
                "traffic": 0
            },
            ...
        ],
        "Site_ID": 7,
        "DayCount": 0,
        "ChildFID": 0,
        "Category": 0,
        "SubCategory": 7
    },
    "NewAssignment": {
        "data": [
            {
                "date": "2016-04-16",
                "traffic": 0
            },
            {
                "traffic": 0,
                "date": "2016-05-14"
            },
            ...
        ],
        "Total": 0,
        "FID": 7,
        "Category": 0,
        "SubCategory": 1,
        "ChildFID": 0,
        "DayCount": 0,
        "Site_ID": 7
    },
    "HumanTestNoJS": {
        "DayCount": 0,
        "Site_ID": 7,
        "ChildFID": 0,
        "Category": 0,
        "SubCategory": 8,
        "FID": 7,
        "Total": 0,
        "data": [
            {
                "date": "2016-03-25",
                "traffic": 0
            },
            {
                "traffic": 0,
                "date": "2016-05-22"
            },
            ...
        ]
    },
    "AssignedVisits": {
        "Site_ID": 7,
        "DayCount": 0,
        "SubCategory": 3,
        "Category": 0,
        "ChildFID": 0,
        "Total": 0,
        "FID": 7,
        "data": [
            {
                "traffic": 0,
                "date": "2016-04-23"
            },
            {
                "traffic": 0,
                "date": "2016-04-26"
            },
            ...
        ]
    }
}

A collection of traffic data from a specific Site, including Total Visits, Assigned Visits, Unassigned Visits, New Users, and Robot Activity.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/sitemetrics

URL Parameters

Property Description
site-id The ID of the Site.

Site Variation

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/sitevariation/2"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, DELETE, PUT, POST
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
   "_links" : {
      "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/sitevariation/2 ",
         "title" : "Site Variation Details"
      }
   },
   "ID" : 2,
   "ApplyOnRPVHit" : "Always",
   "ApplyOnTestStatus" : "All Traffic",
   "DisableWhenNoMatch" : false,
   "EvaluationSequence" : 110,
   "Tags" : [],
   "Name" : "Days",
   "NewVisitRating" : 0,
   "ReplacementText" : "Monday to Friday",
   "RequiredVisitRating" : 0,
   "SearchText" : "Mon - Fri",
   "SiteID" : 1,
   "Status" : "Inactive",
   "Updated" : "2016-07-01T19:29:02",
   "UrlForPreview" : "http://www.domain.com/",
   "OriginExperimentType" : "None",
   "OriginName" : "",
   "OriginValue" : ""
}

A resource that shows information about an individual Site Variation.

Campaign variations, a type of Site Variation associated with specific campaign(s), can be identified by looking at the “type" parameter which has the value “Campaign” for Campaign Variations and “Site” for Site Variations. Campaign Variations will also have “CampaignIDs” array showing the associated campaigns.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/sitevariation/{sitevariation-id}

URL Parameters

Property Description
site-id The ID of the Site.
sitevariation-id The ID of the Site Variation.

Body Properties Post Put

Field Type Description
name String
applyonteststatusoptional String

Default value: all traffic

Allowed values:'all traffic''non-test traffic''preview traffic''test traffic''test traffic counted only'

applyonrpvhitoptional String

Default value: always

Allowed values:'always''response point hit''variation shown''variation shown or response point hit'

disablewhennomatchoptional Boolean

Default value: true

Allowed values:truefalse

evaluationsequenceoptional Integer

Default value: 110

Size range: -127,-101 or 101,127

tagsoptional integer/string/array Integer, String, non-empty array of Strings/Integers, comma delimited String

Default value: []

matchconditionsoptional Object[] An Array of Objects.'matchconditions': [ { 'condition': 'value' }, {'condition':'value'} ]

Default value: []

newvisitratingoptional Integer

Default value: 0

Size range: -127,127

replacementtextoptional String

Default value: Empty String

requiredvisitratingoptional Integer

Default value: 0

Size range: -127,127

searchtextoptional String

Default value: Empty String

statusoptional String

Default value: inactive

Allowed values:'inactive''active'

urlforpreviewoptional String

Default value: Default URL for Preview

Type String

Default value: 'Site'

Allowed values:'Site''Campaign'

CampaignIDs Array

Default value: []

OriginExperimentType String

Default value: "None"

OriginName String Required if OriginExperimentType is set

Default value: []

OriginValue String Required if OriginExperimentType is set

Default value: []

Site Variations

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/sitevariations"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
   "_links" : {
     "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/sitevariations",
         "title" : "All Site Variations associated with a Site"
      }
   },
   "_embedded" : {
      "segments" : [
         {
           "_links" : {
             "self" : {
                 "href" : "https://admin1.sitespect.com/api/site/1/sitevariation/2 ",
                 "title" : "Site Variation Details"
              },
              "ID" : 2,
              "ApplyOnRPVHit" : "Always",
              "ApplyOnTestStatus" : "All Traffic",
              "DisableWhenNoMatch" : false,
              "EvaluationSequence" : 110,
              "Tags" : [],
              "Name" : "Days",
              "NewVisitRating" : 0,
              "ReplacementText" : "Monday to Friday",
              "RequiredVisitRating" : 0,
              "SearchText" : "Mon - Fri",
              "SiteID" : 1,
              "Status" : "Inactive",
              "Updated" : "2016-07-01T19:29:02",
              "UrlForPreview" : "http://www.domain.com/",
			  "OriginExperimentType" : "None",
			  "OriginName" : "",
			  "OriginValue" : ""
           }
        },
        {
           ...
        }
   ]}
}

A collection of Site Variations from a specific Site, including each individual Site Variation resource inserted into the “_embedded” JSON object. Retrieving this collection allows the client to view all the Site Variations that are making change to a website or web page. This is similar to the Campaigns call and allows you to filter by status by appending a forward slash and the words active or inactive to the end of the URL.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/sitevariations

URL Parameters Get

Property Description
site-id The ID of the Site.

Body Properties

Field Type Description
sitevariations-statusoptional String

Allowed values:'active''inactive'

Sites

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/sites"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
   "_links" : 
     "self" : {
         "href" : "https://admin1.sitespect.com/api/sites",
         "title" : "All Site Data"
      }
   },
   "_embedded" : {
      "sites" : [
         {
           "_links" : {
             "self" : {
                 "href" : "https://admin1.sitespect.com/api/site/1 ",
                 "title" : "Data associated with this Site"
             },
           "ActiveCampaigns" : 1,
           "ID" : 1,
           "Status" : "Online",
           "TotalCampaigns" : 2,
           "Created" : "2016-06-24T15:18:02",
           "Name" : "Default Site",
           "ActiveAssignments" : 100,
           "LastModified" : "2016-06-24T15:18:02",
           "BackEndProxyTimeout" : 60,
           "TotalAssignments" : 100
            }
        },
        {
           ...
        }
   ]}
}

A collection of Site resources from all Sites available to the API user, including each individual Site resource inserted into the “_embedded” JSON object. Retrieving this collection allows the client to view information about each Site and find sub resources that belong to that Site (like Campaigns).

Resource URI

https://admin1.sitespect.com/api/sites

Tag

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/7/tag/19"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, DELETE, POST
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
    "CreateTime": "2016-05-30T15:50:56",
    "_links": {
        "self": {
            "href": "https://admin1.sitespect.com/api/site/7/tag/19",
            "title": "Individual Tag Details"
        }
    },
    "Name": "testing",
    "ID": 19,
    "TagTextURIEncoded": "testing",
    "TagCount": 0
}

A resource that shows information for an individual Tag.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/tag/{tag-id}

URL Parameters

Property Description
site-id The ID of the Site.
tag-id The ID of the Tag.

Body Properties Post

Field Type Description
name

string

Required

Default value: -

Size range: -

Allowed values: -

Tags

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/7/tags"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
    "_links": {
        "self": {
            "href": "https://admin1.sitespect.com/api/site/7/tags",
            "title": "All Tags for this Site"
        }
    },
    "_embedded": {
        "tags": [
            {
                "_links": {
                    "self": {
                        "href": "https://admin1.sitespect.com/api/site/7/tag/19",
                        "title": "Individual Tag Details"
                    }
                },
                "CreateTime": "2016-05-30T15:50:56",
                "Name": "testing",
                "ID": 19,
                "TagTextURIEncoded": "testing",
                "TagCount": 0
            }
        ]
    } 
}

A collection of Tags from a specific Site, including each individual Tag resource inserted into the “_embedded” JSON object. Retrieving this collection allows the client to view Tag information, which can be used in the future to perform search operations for a Tag.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/tags

URL Parameters

Property Description
site-id The ID of the Site.

Top Segments Configuration

This resource configures Top Segments reports at the Site or Campaign level. You can use the Top Segments report in the Campaign Data resource to generate the report.

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/topsegments/configuration"

Example Response

#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, PUT
#Content-Type: application/json

{
  "_links": {
    "self": {
      "title": "Site Default Top Segments Configuration",
      "href": "https://admin1.sitespect.com/api/site/1/topsegments/configuration"
    }
  },
  "metric": {
    "ReportingMetrics": [
      "Beta Hits"
    ],
    "Name": "Contact Us - CONFIRMATION",
    "_links": {
      "self": {
        "title": "Response Point Details",
        "href": "https://admin1.sitespect.com/api/site/1/responsepoint/8312"
      }
    },
    "Optimization": "B",
    "ID": 8312
  },
  "segments": [
    {
      "Name": "All",
      "Sort": 1
    },
    {
      "Name": "Device: Is Mobile",
      "ID": 8258,
      "Sort": 2,
      "_links": {
        "title": "Individual Segment Details",
        "href": "https://admin1.sitespect.com/api/site/1/segment/8258"
      }
    },
    {
      "Name": "Geo: US",
      "ID": 8268,
      "Sort": 3,
      "_links": {
        "title": "Individual Segment Details",
        "href": "https://admin1.sitespect.com/api/site/1/segment/8268"
      }
    },
    {
      "Sort": 4,
      "_links": {
        "title": "Individual Segment Details",
        "href": "https://admin1.sitespect.com/api/site/1/segment/8262"
      },
      "ID": 8262,
      "Name": "User: First Visit in Campaign"
    },
    {
      "Name": "User: Repeat Visit in Campaign",
      "Sort": 5,
      "_links": {
        "href": "https://admin1.sitespect.com/api/site/1/segment/8263",
        "title": "Individual Segment Details"
      },
      "ID": 8263
    }
  ]
}

Resource URIs

https://admin1.sitespect.com/api/site/{site-id}/campaign/{campaign_id}/topsegments/configuration

https://admin1.sitespect.com/api/site/{site-id}/topsegments/configuration

Body Properties Put

Field Type Description
segments Integer[] Array of Segment IDs
optimizationmetric String H:# Hits, B:Beta Hits, T:Transfer Time per hit, V:Captured value per hit, S:transfer time (seconds) per hit

Allowed values:'H''B''T''V''S'

metric Integer ID of metric/responsepoint
setsitedefaultsoptional Boolean

Allowed values:truefalse

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/7/campaign/15/traffic"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
    "_links": {
        "self": {
            "href": "https://admin1.sitespect.com/api/site/7/campaign/15/traffic",
            "title": "Campaign Traffic Information"
        }
    },
    "Assignment": [
        {
            "traffic": 0,
            "date": "2016-05-11"
        },
        ...
    ],
    "VisitsUncounted": [
        {
            "traffic": 0,
            "date": "2016-05-11"
        },
        ….
    ],
    "VisitsCounted": [
        {
            "traffic": 0,
            "date": "2016-05-11"
        },
         ...
    ]
}

A collection of traffic for a specific Campaign, including Visits Counted, Visits Uncounted, and Assignment information.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/campaign/{campaign-id}/traffic

URL Parameters

Property Description
site-id The ID of the Site.
campaign-id The ID of the Campaign.

User

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/user/4"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, DELETE, PUT, POST
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
    "_links": {
        "self": {
            "title": "User Details",
            "href": "https://admin1.sitespect.com/api/user/4"
        }
    },
    "State": null,
    "Address2": null,
    "Country": null,
    "EnableAutoEscape": "1",
    "ExpireTime": "Never",
    "LastName": "My Last Name",
    "CompanyName": null,
    "Device_ID": null,
    "Phone": null,
    "City": null,
    "Email": "test@sitespect.com",
    "TimeZone_Code": "GMT",
    "AuthToken": "sOyTA3wertQwdaI7g32PdaTLR",
    "LockoutTime": "0",
    "Permissions": [
        {
            "Site_ID": "7",
            "Privilege": "Campaign Auditor"
        }
    ],
    "Fax": null,
    "BillingEntity": "",
    "Status": "Enabled",
    "ClickwrapAcceptanceTime": "2012-02-07T15:28:31",
    "CreateTime": "2016-05-27T19:37:10",
    "SystemAdmin": true,
    "Zip": null,
    "TimeZone_Offset": "+0000",
    "LastLoginTime": "1401463037",
    "AutoGeneratedPassword": true,
    "LastAccessTime": "1401463686",
    "FailedLoginAttempts": 0,
    "UserInterfaceSettings": {
        "EnableAlerts": true,
        "TimeZone": "GMT",
        "PreviewPopUpSetting_ObjectOnly": true,
        "EnableExpertFeatures": true,
        "ShowHelpIcons": true,
        "PreviewPopUpSetting_All": true,
        "TextAreaRows": 7,
        "PreviewPopUpSetting_ShareableLinks": false
    },
    "Username": "testuser",
    "PasswordExpireTime": "1408995442",
    "ID": "4",
    "LoginCount": 9,
    "Creator_ID": 0,
    "Address1": null,
    "FirstName": "My First Name",
    "UnreadMessageCount": 1
}

A resource that shows user account and profile information for a specific user.

Resource URI

https://admin1.sitespect.com/api/user/{username|user-id}

URL Parameters

Property Description
username OR user-id The ID of the user OR the username

Body Properties Post Put

Field Type Description
email String
username String
address1optional String

Default value: null

address2optional String

Default value: null

cityoptional String

Default value: null

countryoptional String

Default value: null

deviceidoptional Integer

Default value: null

faxoptional String

Default value: null

passwordoptional String

Default value: Auto Generated Password Use with currentpassword to change your password. When changing passwords, this field is required. Passwords must contain at least 10 characters and must contain at least one lowercase and uppercase character, a digit, and at least one special character.

currentpasswordoptional String

Your current password. Required only when you want to create a new password.

phoneoptional String

Default value: null

stateoptional String

Default value: null

userinterfacesettingsoptional Object An Object containing one or more of the following properties: enablealerts, enableexpertfeatures, previewpopupsetting_all, previewpopupsetting_Objectonly, previewpopupsetting_shareablelinks, showhelpicons, textarearows, timezone

Default value: Default Settings

zipoptional String

Default value: null

SA User

Field Type Description
billingentityoptional String

Default value: Empty String

companynameoptional String

Default value: null

enableautoescapeoptional Boolean

Default value: true

Allowed values:truefalse

expiretimeoptional Date When set to 0, the user account will never expire.

Default value: 0

firstnameoptional String

Default value: null

lastnameoptional String

Default value: null

permissionsoptional Object[] An array of Objects containing valid Privilege and Site_ID settings

Default value: null

resetpasswordoptional Boolean

Default value: false

Allowed values:truefalse

statusoptional String

Default value: enabled

Allowed values:'disabled''enabled'

systemadminoptional Boolean

Default value: false

Allowed values:truefalse

Users

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/users"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
   "_links" : 
     "self" : {
         "href" : "https://admin1.sitespect.com/api/users",
         "title" : "All User Data"
      }
   },
   "_embedded" : {
      "users" : [
         {
           "_links" : {
             "self" : {
                 "href" : "https://admin1.sitespect.com/api/user/1 ",
                 "title" : "User Details"
             },
			 "history" : {
                 "href" : "https://admin1.sitespect.com/api/user/1/events ",
                 "title" : "History of Changes to this User"
             },
           "ManageUsers" : "true",
		   "Device_ID" : "null",
		   "Email" : "test@gmail.com",
		   "ClickwrapAcceptanceTime" : "2012-02-07T15:28:31",
		   "Country" : "null",
		   "PasswordExpireTime" : "1492030856",
		   "UserBlacklist" : [],
		   "FailedLoginAttempts" : "0",
		   "Labs" : {          
                 "Page-LevelCustomVariable"" : false,
                 "NewLook" : false,
				 "VisualEditor" : false,
				 "NewBuildFlow" : false,
		   },
		   "UserInterfaceSettings" : {          
                 "ShowHelpIcons" : true,
                 "PreviewPopUpSetting_ShareableLinks" : false,
				 "EnableExpertFeatures" : true,
				 "TimeZone" : "GMT",
				 "PreviewPopUpSetting_All" : true,
				 "TextAreaRows" : 7,
				 "PreviewPopUpSetting_ObjectOnly" : true,
				 "EnableAlerts" : true,
		   },
		   "BillingEntity" : "",
		   "SystemAdmin"" : true,
		   "SslAdmin" : false,
		   "Status" : "Enabled",
		   "LastAccessTime" : "1484254830",
		   "Creator_ID" : 0,
		   "CreateTime"" : "2017-01-10T21:42:56",
		   "LoginCount" : 8,
		   "LastLoginTime" : "1484254699",
		   "Address1" : "Boston",
		   "AutoGeneratedPassword"" : true,
		   "City" : null,
		   "LastName" : null,
		   "State" : null,
		   "TimeZone_Offset" : "+0000",
		   "SslKeyUploader" : false,
		   "TimeZone_Code" : "GMT",
		   "ID" : "1",
		   "AuthToken" : "KKSZl4kSn6bsR5uHqKrUEEjuH",
		   "EnableAutoEscape" : "1",
		   "FirstName" : null,
		   "Fax" : null,
		   "Zip" : null,
		   "LockoutTime" : "0",
		   "Phone" : null,
		   "UnreadMessageCount" : 0,
		   Permissions : [],
		   "CompanyName" : null,
		   "UserWhiteList" : [],
		   "Address2" : null,
		   "Username" : "Test",
		   "ExpireTime" : "Never",
            }
        },
   ]
}

A collection of Users resources from all Users available to the API user, including each individual User resource inserted into the “_embedded” JSON object. Retrieving this collection allows the client to view information about each User and find sub resources that belong to that User (like Campaigns).

Resource URI

https://admin1.sitespect.com/api/users

Variation

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/7/factor/32/variation/113"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, DELETE, PUT, POST
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
    "_links": {
        "self": {
            "href": "https://admin1.sitespect.com/api/site/7/factor/32/variation/113",
            "title": "Variation Details"
        }
    },
    "ModificationRegExReplace": "find",
    "Priority": 50,
    "ID": 113,
    "ParentVariationID": null,
    "NewRating": 0,
    "AsmtCountLogic": 1,
    "Tags": [],
    "VariationRedirectType": 0,
    "UrlForPreview": "http://test.domain.com",
    "DisableWhenCookieConflict": false,
    "Status": "Active",
    "RequireRating": 0,
    "OriginCookieValue": null,
    "AssociatedCampaigns": [],
    "IsMobileApp": false,
    "DisableWhenNoMatch": true,
    "AmpsFilter": null,
    "MobileToken": null,
    "ApplyOnTestStatus": "0",
    "Name": "search to find",
    "OriginCookieName": null,
    "ParentFactorID": null,
    "ModificationRegExSearch": "search"
}

A resource that shows information for an individual Variation.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/factor/{factor-id}/variation/{variation-id}

URL Parameters

Property Description
site-id The ID of the Site.
factor-id The ID of the Factor.
variation-id The ID of the Variation.

Body Properties Post Put

Field Type Description
name String
applyonteststatusoptional Integer 0: always, 1: variation shown, 2: response point hit, 3: variation shown or response point hit

Default value: 0

Allowed values:0123

asmtcountlogicoptional Boolean

Default value: true

Allowed values:truefalse

displayorderoptional Integer

Default value: 100

tagsoptional integer/string/array (Integer, String, non-empty array of Strings/Integers, comma delimited String)

Default value: []

modificationregexsearchoptional String

Default value: null

modificationregexreplaceoptional String

Default value: null

modificationattributesoptional Object

Default value: null

modificationcssoptional Object

Default value: null

modificationscriptoptional String

Default value: null

newvisitratingoptional Integer

Default value: New Visit Rating of Factor

Size range: -127,127

origincookievalueoptional String Alias for controloriginname, either field name can be used here

Default value: null

parentvariationidoptional Integer
previewoptional String

Default value: Empty String

redirectoptional Integer 0: not a redirect variation, 1: 301 redirect, 2: 302 redirect, 3: internal redirect

Allowed values:"0 if factor is not redirect factor""1, 2, 3 if factor is redirect factor"

requirevisitratingoptional Integer

Default value: Require Visit Rating of Factor

Size range: -127,127

sitevariationoptional Boolean

Default value: false

Allowed values:truefalse

statusoptional Integer -1: disabled, 0: inactive, 1: active

Default value: 1

Allowed values:-101

urlforpreviewoptional String

Default value: Default URL for Preview

Variation Group

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/campaign/2/variationgroup/1"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET, DELETE, POST, PUT
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9997

{
   "_links" : {
      "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/campaign/2/variationgroup/1"
      }
   },
   "ID" : 1,
   "Status" : "Active",
   "Control" : true,
   "Name" : "CONTROL GROUP",            
   "Assignments" : 12322,            
   "Visits" : 0,
   "AssignmentFrequency" : 100,
   "Screenshots" : [],
   "Variations" : [
   {
      "VariationName" : "CONTROL",
      "AmpsFilter" : "combine_css",
      "FactorID" : 318,
      "VariationID" : 721,
      "Control" : true,
      "OriginExperiment" : null,
       "FactorName" : "Combine CSS",
      "LinkedVariation" : false,
      "ParentFactorID" : null
   },
   {
      "VariationName" : "CONTROL",
      "AmpsFilter" : "combine_javascript",
      "FactorID" : 299,
      "VariationID" : 683,
      "Control" : true,
      "OriginExperiment" : null,
      "FactorName" : "Combine JavaScript",
      "LinkedVariation" : false,
      "ParentFactorID" : null
   }
   ]
}

A resource that shows detailed information about a Variation Group from a specific Campaign. The group includes all individual Variations that together make changes for the Campaign. The response for the group includes details about Status, assignments, visits and much more. In addition, each individual Variation provides even more detail.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/campaign/{campaign-id}/variationgroup/{variationgroup-id}

URL Parameters

Property Description
site-id The ID of the Site.
campaign-id The ID of the Campaign.
variation-id The ID of the Variation.

Body Properties Post Put

Field Type Description
name String
assignmentfrequencyoptional Integer

Default value: 100

Size range: -100,100

iscontroloptional Boolean

Default value: false

Allowed values:truefalse

purgeoptional Boolean

Default value: false

Allowed values:truefalse

screenshotsoptional Object[] An array of objects. [{'file': Image that is encoded to base64 string,'name':filename}]
Passing this in array will delete screenshot: {"name": "image1", delete: true}

Default value: []

statusoptional String

Default value: inactive

Allowed values:'inactive''active'

variationsoptional Integer[] Array of variation IDs

Default value: null

Variation Groups

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/campaign/2/variationgroups"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
   "_links" : {
     "self" : {
         "href" : "https://admin1.sitespect.com/api/site/1/campaign/2/variationgroups",
         "title" : " All Variation Groups "
      }
   },
   "_embedded" : 
      "variationgroups": [
         {
            "_links" : {
               "self" : {
                  "href" : "https://admin1.sitespect.com/api/site/1/campaign/2/variationgroup/1"
               }
            },
            "ID" : 1,
            "Status" : "Active",
            "Control" : true,
            "Name" : "CONTROL GROUP",            
            "Assignments" : 12322,            
            "Visits" : 0,
            "AssignmentFrequency" : 100,
			"Screenshots" : [],
            "Variations" : [
               {
                  "VariationName" : "CONTROL",
                  "AmpsFilter" : "combine_css",
                  "FactorID" : 318,
                  "VariationID" : 721,
                  "Control" : true,
                  "OriginExperiment" : null,
                  "FactorName" : "Combine CSS",
                  "LinkedVariation" : false,
                  "ParentFactorID" : null
               },
               {
                  "VariationName" : "CONTROL",
                  "AmpsFilter" : "combine_javascript",
                  "FactorID" : 299,
                  "VariationID" : 683,
                  "Control" : true,
                  "OriginExperiment" : null,
                  "FactorName" : "Combine JavaScript",
                  "LinkedVariation" : false,
                  "ParentFactorID" : null
               }
            ]
         },
         {
            ...
         }
      ]
   }
}

A collection of Variation Group resources for a specific Campaign including each individual Variation Group resource inserted into the “_embedded” JSON object. Retrieving this collection allows the client to view all Variation Groups for a Campaign, which provides a lot of detail about all the changes SiteSpect is making with the Campaign. Similar to the Campaigns call, you can filter by status by appending a forward slash and the words active or inactive to the end of the URL.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/campaign/{campaign-id}/variationgroups/{variationgroups-status}

URL Parameters Get

Field Type Description
variationgroups-statusoptional String

Allowed values:'active''inactive'

Variations

Example Request

curl \
  -H "X-API-TOKEN:brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/7/factor/32/variations"

Example Response


#HTTP/1.1 200 OK
#Status: 200 OK
#Allow: GET
#Content-Type: application/json
#X-RateLimit-Limit: 10000
#X-RateLimit-Remaining: 9998

{
    "_links": {
        "self": {
            "title": "Variations associated with this Site",
            "href": "https://admin1.sitespect.com/api/site/7/factor/32/variations"
        }
    },
    "_embedded": {
        "variations": [
            {
                "_links": {
                    "self": {
                        "href": "https://admin1.sitespect.com/api/site/7/factor/32/variation/113",
                        "title": "Variation Details"
                    }
                },
                "Name": "search to find",
                "OriginCookieName": null,
                "ModificationRegExSearch": "search",
                "ParentFactorID": null,
                "MobileToken": null,
                "ApplyOnTestStatus": "0",
                "DisableWhenNoMatch": true,
                "AmpsFilter": null,
                "IsMobileApp": false,
                "OriginCookieValue": null,
                "Status": "Active",
                "RequireRating": 0,
                "UrlForPreview": "http://test.domain.com",
                "DisableWhenCookieConflict": false,
                "VariationRedirectType": 0,
                "ParentVariationID": null,
                "AsmtCountLogic": 1,
                "Tags": [],
                "NewRating": 0,
                "ID": 113,
                "ModificationRegExReplace": "find",
                "Priority": 50
            },
            {
                "_links": {
                    "self": {
                        "href": "https://admin1.sitespect.com/api/site/7/factor/32/variation/112",
                        "title": "Variation Details"
                    }
                },
                "DisableWhenCookieConflict": false,
                "UrlForPreview": "http://test.domain.com",
                "AsmtCountLogic": 1,
                "NewRating": 0,
                "ParentVariationID": null,
                "Tags": [],
                "VariationRedirectType": 0,
                "ID": 112,
                "ModificationRegExReplace": "find",
                "Priority": 50,
                "Name": "Template",
                "ModificationRegExSearch": "search",
                "OriginCookieName": null,
                "ParentFactorID": null,
                "DisableWhenNoMatch": false,
                "AmpsFilter": null,
                "MobileToken": "Template",
                "ApplyOnTestStatus": "0",
                "IsMobileApp": false,
                "Status": "Active",
                "RequireRating": 0,
                "OriginCookieValue": null
            }
        ]
    }
}

A collection of Variations of a specific Factor, including each individual Variation resource inserted into the “_embedded” JSON object. The API returns one CONTROL Variation for each Factor, which can be identified with “Template” value under “Name”.

Resource URI

https://admin1.sitespect.com/api/site/{site-id}/factor/{factor-id}/variations

URL Parameters

Property Description
site-id The ID of the Site.

Errors

The following is an example of error code structure from an API call without proper authentication:

{
    "errors" : {
         "message" : { "Invalid or Missing Authentication"}
    }
}

Errors are returned using standard HTTP error code syntax and any additional information is included in the body of the response, JSON-formatted. Here are some standard API errors:

Error Code Text Description
400 Bad Request The request was invalid and further information is included in the error message.
401 Unauthorized The user was not authenticated due to a missing or incorrect API token
403 Forbidden The request is understood but it has been refused or access is not allowed. The error message will contain more information.
404 Not Found Resource not found in the specified path.
405 Method Not Allowed The type of HTTP request you attempted is not allowed. Check the Allow response header for allowed methods on this resource.
429 Too Many Requests The user has sent too many requests in a given amount of time. Please check the rate limit headers.
500 Internal Error The service encountered an error. Please try again later or contact support.

Rate Limiting

Example Request:

curl \
  -H "X-API-TOKEN: brtaP8wzrJwJqbAQVnLsftcYA" \
  "https://admin1.sitespect.com/api/site/1/campaigns" 
#HTTP/1.1 200 OK

#Status: 200 OK

#X-RateLimit-Limit: 10000

#X-RateLimit-Remaining: 9800

We limit requests to 10000 per hour, 100 reports requests per hour and 5 simultaneous requests at any given time for each API token. These limits can be lifted for Enterprise customers.

You can check the returned HTTP headers of any API request to see your current status.

CORS Whitelist

Normally, browsers block client-side requests across different origins. To help you work around this restriction, SiteSpect has a Cross-Origin Resource Sharing (CORS) Whitelist, which adds specific headers to the SiteSpect server response that allow such cross-domain communication. To add your domain to the CORS Whitelist, please contact Help Desk.