NAV

Introduction

Lucid brings efficiency and automation to online sampling with Lucid Marketplace, the world’s most powerful, open, and customizable online sampling platform.

The Marketplace and Monetization APIs provide a simple way to connect to millions of people and get answers in real time. By specifying a set of demographic qualifications and quotas, buyers can target a wide or very specific population on a topic of your choosing. As a supplier, you get fine grain control over your survey matching and business relationships on the platform.

We want to encourage innovation with minimal limits. We ask that you please be practical and considerate when determining call frequencies. We rate limit when needed to protect the system and ensure the highest level of service to all of our clients.

We also have a status page that displays real-time system performance. Any and all system downtime will be posted here.

Environments

Sandbox Endpoint

https://sandbox.techops.engineering/

Production Endpoint

https://api.samplicio.us/

To make Lucid’s APIs as explorable as possible, we have environments specific to your development needs. For access to these environments contact your Integration Consultant at integrations@luc.id. Please navigate to the Monetization Integration Guide or the Marketplace Integration Guide to see how to get started.

Users are financially responsible for all transactions made on the system regardless of whether it was the result of a bug in your integration.

Authentication

The Lucid APIs use a HTTP Authorization header for authentication. Every call should have a header Authorization: {{APIkey}}. Ensure that the key you are passing is the correct key for the environment. If you don’t already have a Lucid account, get started by signing up for a demo!

Request Format

Built on RESTful principles, the API uses HTTP methods and verbs. Requests should be made using JSON, and JSON is returned by all responses.

Running in Postman

postman

The entire Lucid Marketplace API collection can be easily imported into Postman, by clicking the button below:

Run in Postman

Postman is a free application that allows you to execute test calls in an intuitive interface.

HTTP Status Codes

Lucid Marketplace APIs use conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error caused by the information provided (i.e., a required parameter was omitted, a method was not found, etc.), and codes in the 5xx range indicate an error with Lucid’s servers (these are rare).

Status Code Status Text Description
200 OK The request has succeeded. The meaning of a success varies depending on the HTTP method:
GET: The resource has been fetched and is transmitted in the message body.
POST: The resource describing the result of the action is transmitted in the message body
201 Created The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request.
202 Accepted The request has succeeded and has been added to the queue, but the resource has not yet been created. This is typically the response sent after PUT and POST requests.
204 No Content There is no content to send for this request. This is common for DELETE requests.
307 Temporary Redirect The target resource resides temporarily under a different URI and the user agent MUST NOT change the request method if it performs an automatic redirection to that URI.
400 Bad Request This response means that server could not understand the request due to invalid syntax.
401 Unauthorized Authentication is needed to get requested response. This is similar to 403, but in this case, authentication is possible.
403 Forbidden Client does not have access rights to the content so server is refusing to give proper response.
404 Not Found Server cannot find the requested resource.
405 Method Not Found The request method is known by the server but has been disabled and cannot be used. Double check your method type (i.e. GET, POST, PUT, DELETE)
409 Conflict This response would be sent when a request conflicts with the current state of the server.
429 Too Many Requests The user has sent too many requests in a given amount of time (“rate limiting”).
499 Internal Server Error The server has encountered an internal error.
500 Internal Server Error The server has encountered a situation it doesn’t know how to handle.
502 Bad Gateway The server, while acting as a gateway or proxy, received an invalid response from an inbound server it accessed while attempting to fulfill the request.
503 Service Unavailable The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded.
504 Gateway Timeout This error response is given when the server is acting as a gateway and cannot get a response in time.

Lookup

Definitions

GET List Global Definitions

Definition

GET  https://api.samplicio.us/Lookup/v1/BasicLookups/BundledLookups/{Bundle}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Lookup/v1/BasicLookups/BundledLookups/CountryLanguages,Industries,SampleTypes,StudyTypes,SupplierLinkTypes,SurveyStatuses
require 'net/http'

uri = URI('https://api.samplicio.us/Lookup/v1/BasicLookups/BundledLookups/CountryLanguages,Industries,SampleTypes,StudyTypes,SupplierLinkTypes,SurveyStatuses')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$URL = "https://api.samplicio.us/Lookup/v1/BasicLookups/BundledLookups/CountryLanguages,Industries,SampleTypes,StudyTypes,SupplierLinkTypes,SurveyStatuses";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Lookup/v1/BasicLookups/BundledLookups/CountryLanguages,Industries,SampleTypes,StudyTypes,SupplierLinkTypes,SurveyStatuses'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Lookup/v1/BasicLookups/BundledLookups/CountryLanguages,Industries,SampleTypes,StudyTypes,SupplierLinkTypes,SurveyStatuses");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Lookup/v1/BasicLookups/BundledLookups/CountryLanguages,Industries,SampleTypes,StudyTypes,SupplierLinkTypes,SurveyStatuses",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetBundledLookups successful."
  ],
  "ResultCount": 6,
  "AllBidProbabilities": [],
  "AllBidStatuses": [],
  "AllCategoryLockOutDurations": [],
  "AllCountries": [],
  "AllCountryLanguages": [
  {
      "Code": "CHI-CN",
      "Id": "1",
      "IsActive": true,
      "Name": "Chinese Simplified - China",
      "SortOrder": 1
    }
  ],
  "AllIndustries": [
  {
      "Code": "AUTO",
      "Id": "1",
      "IsActive": true,
      "Name": "Automotive",
      "SortOrder": 1
    }
  ],
  "AllProposalTypes": [],
  "AllQuestionClassifications": [],
  "AllSampleTypes": [
  {
      "Code": "Consumer",
      "Id": "100",
      "IsActive": true,
      "Name": "Consumer",
      "SortOrder": 1
    }
  ],
  "AllStudyTypes": [
  {
      "Code": "ADH",
      "Id": "1",
      "IsActive": true,
      "Name": "Adhoc",
      "SortOrder": 1
    }
  ],
  "AllSupplierLinkTypes": [
  {
      "Code": "TS",
      "Id": "1",
      "IsActive": true,
      "Name": "Targeted / Standalone",
      "SortOrder": 1
    }
  ],
  "AllSupplierPreferenceTypes": [],
  "AllSupplierRequestStatuses": [],
  "AllSupplierTrackingUrlTypes": [],
  "AllSurveyPlatforms": [],
  "AllSurveyStatuses": [
  {
      "Code": "02",
      "Id": "1",
      "IsActive": true,
      "Name": "Pending",
      "SortOrder": 1
    }
  ],
  "AllThirdPartyServices": []
  }

Returns a list of global system definitions. Arguments can be passed individually or in aggregate, with arguments separated by a comma. One argument must be provided at minimum.

Arguments

Property Type Required Description
Bundle string true A string of lookup options delimited by a comma.

Options

Option Description
Countries Array of all countries.
CountryLanguages Array of all Country-Language pairs by ID.
Industries Array of all options for industry type.
SampleTypes Array of all types of sample that buyers can field on the platform.
StudyTypes Array of all types of studies buyers can field on the platform.
SupplierLinkTypes Array of all link types suppliers can use to send sample.
SurveyStatuses Array of all possible survey statuses on the platform.
BidProbabilities Array of all probabilities of a bid being awarded (Low, Med, High).
BidStatuses Array of all possible statuses for a bid.
ProposalTypes Array of all possible proposal types.
CategoryLockOutDurations Array of all possible lockout times.
QuestionClassifications Array of all question categories on the platform.
SupplierPreferenceTypes Array of all possible preferences a supplier can communicate.
SupplierRequestStatuses Array of all tracking methods a supplier can use to track a respondent’s status.
ThirdPartyServices Array of all Third Party Services on the platform.

GET List Suppliers

Definition

GET  https://api.samplicio.us/Core/v1/Suppliers/AllWithAccount

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Core/v1/Suppliers/AllWithAccount
require 'net/http'

uri = URI('https://api.samplicio.us/Core/v1/Suppliers/AllWithAccount')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$URL = "https://api.samplicio.us/Core/v1/Suppliers/AllWithAccount",

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Core/v1/Suppliers/AllWithAccount'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Core/v1/Suppliers/AllWithAccount");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "https://api.samplicio.us/Core/v1/Suppliers/AllWithAccount",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetAllSuppliersGroupedByAccount successful."
  ],
  "ResultCount": 4,
  "AccountsWithSuppliers": [
    {
      "AccountName": "Sample Company",
      "Suppliers": [
        {
          "Name": "Supplier 1",
          "Code": "1010"
        },
        {
          "Name": "Supplier 2",
          "Code": "1010"
        },
        {
          "Name": "Supplier 3",
          "Code": "1010"
        },
        {
          "Name": "Supplier 4",
          "Code": "1010"
        },
      ]
    }
  ]
}

Returns a list of all suppliers.

GET List Business Units

Definition

GET  https://api.samplicio.us/Core/v1/BusinessUnits/All

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Core/v1/BusinessUnits/All
require 'net/http'

uri = URI('https://api.samplicio.us/Core/v1/BusinessUnits/All')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php

$URL = "https://api.samplicio.us/Core/v1/BusinessUnits/All";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Core/v1/BusinessUnits/All'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Core/v1/BusinessUnits/All");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Core/v1/BusinessUnits/All",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

 {
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetAllBusinessUnits successful."
  ],
  "ResultCount": 1,
  "BusinessUnits": [
    {
      "AccountID": 001,
      "Id": "001",
      "Name": "Fulcrum"
    },
  ]
}

Returns a list of all Business Units.

Question Library

The questions in this library can be used to build qualifications for surveys created in the Lucid Marketplace. Each question represents a respondent profile datapoint.

GET List Standard Questions

Definition

GET  https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllQuestions/{CountryLanguageID}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllQuestions/{CountryLanguageID}
require 'net/http'

uri = URI('https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllQuestions/{CountryLanguageID}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$URL = "https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllQuestions/{CountryLanguageID}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllQuestions/{CountryLanguageID}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllQuestions/{CountryLanguageID}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Lookup/v1/QuestionLibrary/AllQuestions/{CountryLanguageID}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetAllQuestions successful."
  ],
  "ResultCount": 1,
  "Questions": [
    {
      "IsCoreDemographic": true,
      "IsFeasibilityFactor": true,
      "LK_QuestionClassificationID": 8,
      "Name": "AGE",
      "QuestionID": 42,
      "QuestionText": "What is your age?",
      "QuestionType": "Numeric - Open-end",
      "SurveyUse": 8162
    }
  ]
}    

Returns a list of all standard questions and question texts for the specified country-language pair.

Arguments

Property Type Required Description
CountryLanguageID int true Unique id associated with the country-language pair the question text applies to.

GET List Custom Questions

Definition

GET  https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllCustomQuestionsByAccount/{CountryLanguageID}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllCustomQuestionsByAccount/{CountryLanguageID}
require 'net/http'

uri = URI('https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllCustomQuestionsByAccount/{CountryLanguageID}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$URL = "https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllCustomQuestionsByAccount/{CountryLanguageID}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllCustomQuestionsByAccount/{CountryLanguageID}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllCustomQuestionsByAccount/{CountryLanguageID}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Lookup/v1/QuestionLibrary/AllCustomQuestionsByAccount/{CountryLanguageID}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetAllQuestions successful."
  ],
  "ResultCount": 1,
  "Questions": [
    {
      "__type": "PublicQuestionModel",
      "IsCoreDemographic": false,
      "IsFeasibilityFactor": false,
      "LK_QuestionClassificationID": null,
      "Name": "HHI",
      "QuestionID": 51,
      "QuestionText": "What is your annual household income before taxes?",
      "QuestionType": "Single Punch",
      "SurveyUse": 2,
      "AccountID": 1
    }
  ]
}    

Returns a list of custom questions associated with and created by your account for the specified country-language pair.

Arguments

Property Type Required Description
CountryLanguageID int true Unique id associated with the country-language pair the question text applies to.

GET Show Question Text

Definition

GET  https://api.samplicio.us/Lookup/v1/QuestionLibrary/QuestionById/{CountryLanguageID}/{QuestionID}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Lookup/v1/QuestionLibrary/QuestionById/{CountryLanguageID}/{QuestionID}
require 'net/http'

uri = URI('https://api.samplicio.us/Lookup/v1/QuestionLibrary/QuestionById/{CountryLanguageID}/{QuestionID}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Lookup/v1/QuestionLibrary/QuestionById/{CountryLanguageID}/{QuestionID}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Lookup/v1/QuestionLibrary/QuestionById/{CountryLanguageID}/{QuestionID}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Lookup/v1/QuestionLibrary/QuestionById/{CountryLanguageID}/{QuestionID}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Lookup/v1/QuestionLibrary/QuestionById/{CountryLanguageID}/{QuestionID}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetQuestionById successful."
  ],
  "ResultCount": 1,
  "Question": {
    "IsCoreDemographic": true,
    "IsFeasibilityFactor": true,
    "LK_QuestionClassificationID": 8,
    "Name": "AGE",
    "QuestionID": 42,
    "QuestionText": "What is your age?",
    "QuestionType": "Numeric - Open-end",
    "SurveyUse": 8420
  }
}

Returns the details of a specific standard or custom qualification.

Arguments

Property Type Required Description
CountryLanguageID int true Unique id associated with the country-language pair the question text applies to.
QuestionID int true Unique id associated with the question the question text applies to.

GET Show Question Options

Definition

GET  https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllQuestionOptions/{CountryLanguageID}/{QuestionID}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllQuestionOptions/{CountryLanguageID}/{QuestionID}
require 'net/http'

uri = URI('https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllQuestionOptions/{CountryLanguageID}/{QuestionID}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response= http.request(request)  
<?php

$URL = "https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllQuestionOptions/{CountryLanguageID}/{QuestionID}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllQuestionOptions/{CountryLanguageID}/{QuestionID}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Lookup/v1/QuestionLibrary/AllQuestionOptions/{CountryLanguageID}/{QuestionID}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Lookup/v1/QuestionLibrary/AllQuestionOptions/{CountryLanguageID}/{QuestionID}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetAllQuestionOptions successful."
  ],
  "ResultCount": 1,
  "QuestionOptions": [
    {
      "OptionText": "Male",
      "ParentItemText": null,
      "Precode": "1",
      "QuestionID": 43
    },
    {
      "OptionText": "Female",
      "ParentItemText": null,
      "Precode": "2",
      "QuestionID": 43
    }
  ]
}

Returns the answer options and associated precodes for a specific QuestionID and country-language pair.

Arguments

Property Type Required Description
CountryLanguageID int true Unique id associated with the country-language pair the question text applies to.
QuestionId int true Unique id associated with the question the question text applies to.

Monetization Integration

Surveys

The Survey resource contains basic information about a survey opportunity posted by a sample buyer. More detailed information about who qualifies for the survey is contained in the Qualifications and Quotas resources. These properties may return Null: BidIncidence, BidLengthOfInterview, IndustryID, and StudyTypeID.

Surveys Model

Property Type Description
SurveyName string External name of the survey. This name may be exposed to respondents. This value is not unique across surveys. Maximum length of 128.
SurveyNumber int Unique number associated with the survey.
SurveySID string Unique hash value (GUID) associated with the survey.
AccountName string Name of the buyer running the survey. Maximum length of 64.
CountryLanguageID int Unique id associated with the country-language pair the survey is open to.
LengthOfInterview int Median time for a respondent to complete the survey excluding the Marketplace prescreener in minutes.
BidIncidence double Estimated incidence rate of the survey as provided by the buyer.
Conversion int Percentage of respondents who complete the survey after qualifying.
CPI double Gross payout per complete. This value is before any applicable commissions or fees.
FieldEndDate datetime Target date for survey closure. This property usually does not indicate a hard closure time, although buyers may opt to automatically close the study. “FieldEndDate”: “\/Date(1388293200000-0600)\/”. Where 1388293200000 is a unix timestamp (in milliseconds) denoting 12/29/2013 05:00:00, where -0600 is the time difference from UTC
IndustryID int Industry associated with the survey’s topic.
StudyTypeID int Indicates the survey’s format and purpose (i.e. adhoc, recruit, etc).
OverallCompletes int Number of completes already achieved.
TotalRemaining int Number of completes still available.
CompletionPercentage int Percentage of the survey that has filled in terms of completes.
SurveyGroup string Deprecated: Will return null. Instead use the SurveyGroupExists property.
SurveyGroupID int Deprecated: Will return null. If SurveyGroupExists is true, then list the survey’s groups.
SurveyGroupExists int Indicates whether there is a survey group(s) associated with the survey. (0=false, 1=true)
BidLengthOfInterview int Estimated time for a respondent to complete the survey excluding the Marketplace prescreener in minutes as provided by the buyer.
TerminationLengthOfInterview int Median time for a respondent to be termed in minutes.
IsTrueSample string Property is returned but is nonfunctional.
SurveyMobileConversion int Percentage of mobile respondents who complete the survey after qualifying.
SurveyQuotaCalcTypeID int Indicates whether quotas are calculated based on completes or prescreens (1=Completes, 2=Prescreens).
SampleTypeID int The type of sample the survey is open to (i.e. consumer, business-to-business, etc).
CollectsPII boolean true indicates that the survey will collect PII.
IsOnlySupplierInGroup boolean true indicates that an allocation is reserved for a single supplier

GET List Marketplace Surveys

Definition

GET  https://api.samplicio.us/Supply/v1/Surveys/AllOfferwall/{SupplierCode}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Supply/v1/Surveys/AllOfferwall/{SupplierCode}
require 'net/http'

uri = URI('https://api.samplicio.us/Supply/v1/Surveys/AllOfferwall/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Supply/v1/Surveys/AllOfferwall/{SupplierCode}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Supply/v1/Surveys/AllOfferwall/{SupplierCode}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/Surveys/AllOfferwall/{SupplierCode}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Supply/v1/Surveys/AllOfferwall/{SupplierCode}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetAllOfferwallSurveys successful."
  ],
  "ResultCount": 1,
  "Surveys": [
    {
      "SurveyName": "Asthma Sufferers",
      "SurveyNumber": 457751,
      "SurveySID": "26CB55E2-74CC-4E19-88E3-7F2F8D4DE74D",
      "AccountName": "Sample Company",
      "CountryLanguageID": 9,
      "LengthOfInterview": 12,
      "BidIncidence": 30,
      "Conversion": 1,
      "CPI": 1.5,
      "FieldEndDate": "\/Date(1388293200000-0600)\/",
      "IndustryID": 30,
      "StudyTypeID": 1,
      "OverallCompletes": 5,
      "TotalRemaining": 995,
      "CompletionPercentage": 0,
      "SurveyGroup": null,
      "SurveyGroupID": null,
      "SurveyGroupExists": 1,
      "BidLengthOfInterview": 10,
      "TerminationLengthOfInterview": 6,
      "SurveyQuotaCalcTypeID": 1,
      "IsTrueSample": false,
      "SurveyMobileConversion": 0,
      "SampleTypeID": null,
      "CollectsPII": null,
      "IsOnlySupplierInGroup": false
    }
  ]
}

Returns a list of all live survey opportunities available through the Marketplace for which you do not have an allocation or entry link. After creating an entry link you can list allocated surveys or show an allocated survey to access these opportunities.

Arguments

Property Type Required Description
SupplierCode string true Unique code associated with a supplier account.

GET List Marketplace Surveys By Country Language

Definition

GET  https://api.samplicio.us/Supply/v1/Surveys/AllOfferwall/ByCountryLanguage/{CountryLanguageID}/{SupplierCode}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Supply/v1/Surveys/AllOfferwall/ByCountryLanguage/{CountryLanguageID}/{SupplierCode}
require 'net/http'

uri = URI('https://api.samplicio.us/Supply/v1/Surveys/AllOfferwall/ByCountryLanguage/{CountryLanguageID}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Supply/v1/Surveys/AllOfferwall/ByCountryLanguage/{CountryLanguageID}/{SupplierCode}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Supply/v1/Surveys/AllOfferwall/ByCountryLanguage/{CountryLanguageID}/{SupplierCode}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/Surveys/AllOfferwall/ByCountryLanguage/{CountryLanguageID}/{SupplierCode}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Supply/v1/Surveys/AllOfferwall/ByCountryLanguage/{CountryLanguageID}/{SupplierCode}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetAllOfferwallSurveysByCountryLanguage successful."
  ],
  "ResultCount": 1,
  "Surveys": [
    {
      "SurveyName": "Asthma Sufferers",
      "SurveyNumber": 457751,
      "SurveySID": "26CB55E2-74CC-4E19-88E3-7F2F8D4DE74D",
      "AccountName": "Sample Company",
      "CountryLanguageID": 9,
      "LengthOfInterview": 12,
      "BidIncidence": 30,
      "Conversion": 1,
      "CPI": 1.5,
      "FieldEndDate": "\/Date(1388293200000-0600)\/",
      "IndustryID": 30,
      "StudyTypeID": 1,
      "OverallCompletes": 5,
      "TotalRemaining": 995,
      "CompletionPercentage": 0,
      "SurveyGroup": null,
      "SurveyGroupID": null,
      "SurveyGroupExists": 1,
      "BidLengthOfInterview": 10,
      "TerminationLengthOfInterview": 6,
      "SurveyQuotaCalcTypeID": 1,
      "IsTrueSample": false,
      "SurveyMobileConversion": 0,
      "SampleTypeID": null,
      "CollectsPII": null
    }
  ]
}

Returns a list of all live survey opportunities available through the Marketplace for which you do not have an allocation or entry link, filtered by country language. After creating an entry link you can list allocated surveys or show an allocated survey to access these opportunities.

Arguments

Property Type Required Description
CountryLanguageID int true Country Language ID to filter with
SupplierCode string true Unique code associated with a supplier account.

Allocations

Allocations allow buyers to allocate portions of studies to specific suppliers. This resource returns the allocation you have been given for a study based on your supplier code. These properties may return Null: BidIncidence, BidLengthOfInterview, IndustryID, and StudyTypeID.

SupplierAllocationSurveys Model

Property Type Description
SurveyName string External name of the survey. This name may be exposed to respondents. This value is not unique across surveys.
SurveyNumber int Unique number associated with the survey.
SurveySID string Unique hash value (GUID) assoicated with the survey.
AccountName string Name of the buyer running the survey.
CountryLanguageID int Unique id associated with the country-language pair the survey is open to.
LengthOfInterview int Median time (in minutues) for a respondent to complete the survey, excluding the Marketplace prescreener
BidIncidence double Estimated incidence rate of the survey as provided by the buyer.
Conversion int Percentage of respondents who complete the survey after qualifying.
FieldBeginDate datetime Target date for survey start. This property usually does not indicate a hard start time, although buyers may opt to automatically open the study. Ex: “FieldBeginDate”: “\/Date(1388293200000-0600)\/” where 1388293200000 is a unix timestamp (in milliseconds) denoting 12/29/2013 05:00:00, where -0600 is the time difference from UTC
FieldEndDate datetime Target date for survey closure. This property usually does not indicate a hard closure time, although buyers may opt to automatically close the study. Ex: “FieldEndDate”: “\/Date(1388293200000-0600)\/” where 1388293200000 is a unix timestamp (in milliseconds) denoting 12/29/2013 05:00:00, where -0600 is the time difference from UTC
IndustryID int Industry associated with the survey’s topic.
StudyTypeID int Indicates the survey’s format and purpose (i.e. adhoc, recruit, etc).
Priority int Survey priority from 1-11 (1 being the highest). Priority only applies to routed sample.
SurveyGroup string Deprecated: Will return null. Instead use the SurveyGroupExists property.
SurveyGroupExists int Indicates whether there is a survey group(s) associated with the survey. (0=false, 1=true)
BidLengthOfInterview int Estimated time (in minutes) for a respondent to complete the survey, as provided by the buyer, excluding the Marketplace prescreener.
TerminationLengthOfInterview int Median time (in minutes) for a respondent to be termed.
IsTrueSample string Property is returned but is nonfunctional.
SurveyMobileConversion int Percentage of mobile respondents who complete the survey after qualifying.
SurveyQuotaCalcTypeID int Indicates whether quotas are calculated based on completes or prescreens (1=Completes, 2=Prescreens).
SampleTypeID int The type of sample the survey is open to (i.e. consumer, business-to-business, etc).
CollectsPII boolean true indicates that the survey will collect PII.

SupplierAllocationSurvey Model

Property Type Description
SurveyName string External name of the survey. This name may be exposed to respondents. This value is not unique across surveys.
SurveyNumber int Unique number associated with the survey.
SurveySID string Unique hash value (GUID) assoicated with the survey.
AccountName string Name of the buyer running the survey.
CountryLanguageID int Unique id associated with the country-language pair the survey is open to.
LengthOfInterview int Median time for a respondent to complete the survey excluding the Marketplace prescreener in minutes.
BidIncidence double Estimated incidence rate of the survey as provided by the buyer.
Conversion int Percentage of respondents who complete the survey after qualifying.
FieldBeginDate datetime Target date for survey start. This property usually does not indicate a hard start time, although buyers may opt to automatically open the study. Ex: “FieldBeginDate”: “\/Date(1388293200000-0600)\/” where 1388293200000 is a unix timestamp (in milliseconds) denoting 12/29/2013 05:00:00, where -0600 is the time difference from UTC
FieldEndDate datetime Target date for survey closure. This property usually does not indicate a hard closure time, although buyers may opt to automatically close the study. Ex: “FieldEndDate”: “\/Date(1388293200000-0600)\/” where 1388293200000 is a unix timestamp (in milliseconds) denoting 12/29/2013 05:00:00, where -0600 is the time difference from UTC
IndustryID int Industry associated with the survey’s topic.
StudyTypeID int Indicates the survey’s format and purpose (i.e. adhoc, recruit, etc).
Priority int Survey priority from 1-11 (1 being the highest). Priority only applies to routed sample.
SupplierAllocations array Contains an array of SupplierAllocations elements described below.
OfferwallTotalRemaining int Deprecated: Use the AllocationRemaining and HedgeRemaining properties return in each respective model.
OfferwallAllocations array Contains an array of OfferwallAllocations elements described below.
SurveyGroup string Deprecated: Will return null. Instead use the SurveyGroupExists property.
SurveyGroupID int Deprecated: Will return null. If SurveyGroupExists is true, then list the survey’s groups.
SurveyGroupExists int Indicates whether there is a survey group(s) associated with the survey. (0=false, 1=true)
BidLengthOfInterview int Estimated time (in minutes) for a respondent to complete the survey, as provided by the buyer, excluding the Marketplace prescreener.
TerminationLengthOfInterview int Median time (in minutes) for a respondent to be termed.
IsTrueSample string Property is returned but is nonfunctional.
SurveyMobileConversion int Percentage of mobile respondents who complete the survey after qualifying.
SurveyQuotaCalcTypeID int Indicates whether quotas are calculated based on completes or prescreens (1=Completes, 2=Prescreens).
SampleTypeID int The type of sample the survey is open to (i.e. consumer, business-to-business, etc).
CollectsPII boolean true indicates that the survey will collect PII.
IsOnlySupplierInGroup boolean true indicates that an allocation is reserved for a single supplier

SupplierAllocations Model

Property Type Description
SupplierCode int Unique code associated with a supplier account.
SupplierName string Name of the supplier.
IsBlockRouted boolean Indicates if the survey accepts routed sample.
AchievedCompletes int Number of completes that have been already achieved by the supplier in this survey.
AllocationRemaining int Number of completes remaining as part of the allocation.
HedgeRemaining int Number of unallocated completes available to any suppliers with access to hedge.
TargetModel int Contains an array of TargetModel elements described below.

OfferwallAllocations Model

Property Type Description
SupplierCode int Unique code associated with a supplier account.
SupplierName string Name of the supplier.
OfferwallCompletes int Number of completes that have been already achieved by the Marketplace for this survey.
AllocationRemaining int Number of completes remaining as part of the allocation.
HedgeRemaining int Number of unallocated completes available to any suppliers with access to hedge.
TargetModel int Contains an array of TargetModel elements described below.

TargetModel Model

Property Type Description
SupplierLinkType int Defines the type of buyer-supplier engagement and the respondent’s path in Lucid Marketplace. See List Global Definitions for a map of supplier link types.
LiveSupplierLink string Live supplier-specific respondent entry link generated by Lucid Marketplace.
SupplierLinkSID string Unique hash value (GUID) associated with a LiveSupplierLink.
TargetCCPI double Gross payout per targeted complete.

GET List Allocated Surveys

Definition

GET  https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/All/{SupplierCode}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/All/{SupplierCode}
require 'net/http'

uri = URI('https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/All/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

allocations = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/All/{SupplierCode}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>

import requests

url = 'https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/All/{SupplierCode}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/All/{SupplierCode}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Supply/v1/Surveys/SupplierAllocations/All/{SupplierCode}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetSupplierAllocationsAll successful."
  ],
  "ResultCount": 1,
  "SupplierAllocationSurveys": [
    {
      "SurveyName": "IT Developers Survey",
      "SurveyNumber": 143479,
      "SurveySID": "4C2B4533-0EA1-364A-212B-345B38C6AF57",
      "AccountName": "Sample Company",
      "CountryLanguageID": 9,
      "LengthOfInterview": 2,
      "BidIncidence": 8,
      "Conversion": 1,
      "FieldBeginDate": "/Date(1429160400000-0500)/",
      "FieldEndDate": "/Date(1429848000000-0500)/",
      "IndustryID": 3,
      "StudyTypeID": 1,
      "Priority": 2,
      "SurveyGroup": null,
      "SurveyGroupID": null,
      "SurveyGroupExists": 0,
      "BidLengthOfInterview": 15,
      "TerminationLengthOfInterview": 5,
      "SurveyQuotaCalcTypeID": 1,
      "IsTrueSample": false,
      "SurveyMobileConversion": 0,
      "SampleTypeID": null,
      "CollectsPII": null
    }
  ]
}

Returns a list of all live survey opportunities for which you have an allocation or entry link.

Arguments

Property Type Required Description
SupplierCode string true Unique code associated with a supplier account.

GET Show an Allocated Survey

Definition

GET  https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/BySurveyNumber/{SurveyNumber}/{SupplierCode}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/BySurveyNumber/{SurveyNumber}/{SupplierCode}
require 'net/http'

uri = URI('https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/BySurveyNumber/{SurveyNumber}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/BySurveyNumber/{SurveyNumber}/{SupplierCode}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/BySurveyNumber/{SurveyNumber}/{SupplierCode}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/BySurveyNumber/{SurveyNumber}/{SupplierCode}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Supply/v1/Surveys/SupplierAllocations/BySurveyNumber/{SurveyNumber}/{SupplierCode}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetSupplierAllocationsBySurveyNumber successful."
  ],
  "ResultCount": 1,
  "SupplierAllocationSurvey": {
    "SurveyName": "Pet Owner Survey",
    "SurveyNumber": 17381,
    "SurveySID": "03B4B292-0EA1-212B-02C1-345B38C6AF57",
    "AccountName": "Sample Company",
    "CountryLanguageID": 9,
    "LengthOfInterview": 16,
    "BidIncidence": 20,
    "Conversion": 13,
    "FieldBeginDate": "/Date(1400562000000-0500)/",
    "FieldEndDate": "/Date(1401854400000-0500)/",
    "IndustryID": 18,
    "StudyTypeID": 1,
    "Priority": 1,
    "SupplierAllocations": [],
    "OfferwallTotalRemaining": 47,
    "OfferwallAllocations": [
      {
        "SupplierCode": "0050",
        "SupplierName": "Monetization Company",
        "OfferwallCompletes": 403,
        "AllocationRemaining": 47,
        "HedgeRemaining": 0,
        "TargetModel": {
          "SupplierLinkType": 18,
          "LiveSupplierLink": "https://samplicio.us/s/default.aspx?SID=da94c7f8-0dcf-4fcc-80d4-6e2beafc3ff4&PID=",
          "SupplierLinkSID": "da94c7f8-0dcf-4fcc-80d4-6e2beafc3ff4",
          "TargetCCPI": 3
        }
      }
    ],
    "SurveyGroup": null,
    "SurveyGroupID": null,
    "SurveyGroupExists": 1,
    "BidLengthOfInterview": 15,
    "TerminationLengthOfInterview": 3,
    "SurveyQuotaCalcTypeID": 1,
    "IsTrueSample": false,
    "SurveyMobileConversion": 0,
    "SampleTypeID": null,
    "CollectsPII": null,
    "IsOnlySupplierInGroup": false
  }
}

Returns any allocation(s) given to you for a particular survey.

Arguments

Property Type Required Description
SupplierCode string false Unique code associated with a supplier account.
SurveyNumber int true Unique number associated with the survey.

GET List Allocated Surveys by Date

Definition

GET  https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByDate/{Date}/{SupplierCode}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByDate/{Date}/{SupplierCode}
require 'net/http'

uri = URI('https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByDate/{Date}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByDate/{Date}/{SupplierCode}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByDate/{Date}/{SupplierCode}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByDate/{Date}/{SupplierCode}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Supply/v1/Surveys/SupplierAllocations/ByDate/{Date}/{SupplierCode}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetSupplierAllocationsByDate successful."
  ],
  "ResultCount": 1,
  "SupplierAllocationSurveys": [
        {
            "SurveyName": "IT Developers Survey",
            "SurveyNumber": 143479,
            "SurveySID": "4C2B4533-0EA1-364A-212B-345B38C6AF57",
            "AccountName": "Sample Company",
            "CountryLanguageID": 9,
            "LengthOfInterview": 2,
            "BidIncidence": 8,
            "Conversion": 1,
            "FieldBeginDate": "/Date(1431666000000-0500)/",
            "FieldEndDate": "/Date(1432353600000-0500)/",
            "IndustryID": 30,
            "StudyTypeID": 1,
            "Priority": 2,
            "SurveyGroup": null,
            "SurveyGroupID": null,
            "SurveyGroupExists": 0,
            "BidLengthOfInterview": 15,
            "TerminationLengthOfInterview": 5,
            "SurveyQuotaCalcTypeID": 1,
            "IsTrueSample": false,
            "SurveyMobileConversion": 0,
            "SampleTypeID": null,
            "CollectsPII": null
        }
    ]
}

Returns a list of all live survey opportunities for which you have an allocation or entry link and the TotalQuota has changed since a specified date.

Arguments

Property Type Required Description
Date string true Must follow the format YYYY-MM-DD
SupplierCode string true Unique code associated with a supplier account.

GET List Allocated Surveys By CountryLanguage

Definition

GET  https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByCountryLanguage/{CountryLanguageID}/{SupplierCode}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByCountryLanguage/{CountryLanguageID}/{SupplierCode}
require 'net/http'

uri = URI('https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByCountryLanguage/{CountryLanguageID}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByCountryLanguage/{CountryLanguageID}/{SupplierCode}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByCountryLanguage/{CountryLanguageID}/{SupplierCode}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByCountryLanguage/{CountryLanguageID}/{SupplierCode}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Supply/v1/Surveys/SupplierAllocations/ByCountryLanguage/{CountryLanguageID}/{SupplierCode}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetSupplierAllocationsByCountryLanguage successful."
  ],
  "ResultCount": 1,
  "SupplierAllocationSurveys": [
        {
            "SurveyName": "IT Developers Survey",
            "SurveyNumber": 143479,
            "SurveySID": "4C2B4533-0EA1-364A-212B-345B38C6AF57",
            "AccountName": "Sample Company",
            "CountryLanguageID": 9,
            "LengthOfInterview": 2,
            "BidIncidence": 8,
            "Conversion": 1,
            "FieldBeginDate": "/Date(1431666000000-0500)/",
            "FieldEndDate": "/Date(1432353600000-0500)/",
            "IndustryID": 30,
            "StudyTypeID": 1,
            "Priority": 2,
            "SurveyGroup": null,
            "SurveyGroupID": null,
            "SurveyGroupExists": 0,
            "BidLengthOfInterview": 15,
            "TerminationLengthOfInterview": 5,
            "SurveyQuotaCalcTypeID": 1,
            "IsTrueSample": false,
            "SurveyMobileConversion": 0,
            "SampleTypeID": null,
            "CollectsPII": null
        }
    ]
}

Returns a list of all live survey opportunities for which you have an allocation or entry link in the selected Country Language.

Arguments

Property Type Required Description
CountryLanguageID int true Country Language ID to filter with
SupplierCode string true Unique code associated with a supplier account.

GET List Allocated Surveys By CountryLanguage and Date

Definition

GET  https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByCountryLanguage/{CountryLanguageID}/ByDate/{Date}/{SupplierCode}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByCountryLanguage/{CountryLanguageID}/ByDate/{Date}/{SupplierCode}
require 'net/http'

uri = URI('https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByCountryLanguage/{CountryLanguageID}/ByDate/{Date}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByCountryLanguage/{CountryLanguageID}/ByDate/{Date}/{SupplierCode}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByCountryLanguage/{CountryLanguageID}/ByDate/{Date}/{SupplierCode}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/Surveys/SupplierAllocations/ByCountryLanguage/{CountryLanguageID}/ByDate/{Date}/{SupplierCode}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Supply/v1/Surveys/SupplierAllocations/ByCountryLanguage/{CountryLanguageID}/ByDate/{Date}/{SupplierCode}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetSupplierAllocationsByCountryLanguageAndDate successful."
  ],
  "ResultCount": 1,
  "SupplierAllocationSurveys": [
        {
            "SurveyName": "IT Developers Survey",
            "SurveyNumber": 143479,
            "SurveySID": "4C2B4533-0EA1-364A-212B-345B38C6AF57",
            "AccountName": "Sample Company",
            "CountryLanguageID": 9,
            "LengthOfInterview": 2,
            "BidIncidence": 8,
            "Conversion": 1,
            "FieldBeginDate": "/Date(1431666000000-0500)/",
            "FieldEndDate": "/Date(1432353600000-0500)/",
            "IndustryID": 30,
            "StudyTypeID": 1,
            "Priority": 2,
            "SurveyGroup": null,
            "SurveyGroupID": null,
            "SurveyGroupExists": 0,
            "BidLengthOfInterview": 15,
            "TerminationLengthOfInterview": 5,
            "SurveyQuotaCalcTypeID": 1,
            "IsTrueSample": false,
            "SurveyMobileConversion": 0,
            "SampleTypeID": null,
            "CollectsPII": null
        }
    ]
}

Returns a list of all live survey opportunities for which you have an allocation or entry link in the selected Country Language and the TotalQuota has changed since a specified date.

Arguments

Property Type Required Description
CountryLanguageID int true Country Language ID to filter with
Date string true Must follow the format YYYY-MM-DD
SupplierCode string true Unique code associated with a supplier account.

Survey Groups

The Survey Groups resource will return survey group details for a particular survey number. This information can be used to track survey groups to avoid sending a respondent to a survey which is in a survey group with a survey they have already been sent to.

The Surveys/AllOfferwall and SupplierAllocations/BySurveyNumber calls return a SurveyGroupExists property which will indicate if the survey is in a survey group. The Surveys/SurveyGroups call can then be made to identify and track survey group details. You will need to continue to check the survey number and do not send the same respondent to any survey in that survey group until the original survey number sent to returns "SurveyGroupExists": 0 from any of the Supplier Allocations calls.

Survey Groups Model

Property Type Description
SurveyGroup string Name associated with the survey group. Maximum length of 200.
SurveyGroupID int Unique ID associated with a survey group
SurveyGroupSurveys array List of all survey numbers in the survey group

GET List a Survey’s Groups

Definition

GET  https://api.samplicio.us/Supply/v1/Surveys/SurveyGroups/BySurveyNumber/{SurveyNumber}/{SupplierCode}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Supply/v1/Surveys/SurveyGroups/BySurveyNumber/{SurveyNumber}/{SupplierCode}
require 'net/http'

uri = URI('https://api.samplicio.us/Supply/v1/Surveys/SurveyGroups/BySurveyNumber/{SurveyNumber}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Supply/v1/Surveys/SurveyGroups/BySurveyNumber/{SurveyNumber}/{SupplierCode}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Supply/v1/Surveys/SurveyGroups/BySurveyNumber/{SurveyNumber}/{SupplierCode}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/Surveys/SurveyGroups/BySurveyNumber/{SurveyNumber}/{SupplierCode}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Supply/v1/Surveys/SurveyGroups/BySurveyNumber/{SurveyNumber}/{SupplierCode}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetSurveyGroups successful."
  ],
  "ResultCount": 2,
  "SurveyGroups": [
    {
      "SurveyGroup": "",
      "SurveyGroupID": 12259,
      "SurveyGroupSurveys": [
          590043,
          600432,
          583920,
          601834,
          598282
      ]
    },
    {
      "SurveyGroup": "",
      "SurveyGroupID": 12274,
      "SurveyGroupSurveys": [
          600432,
          601834,
          601943
      ]
    }
  ]
}

Returns information on the survey group used by the specified survey.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
SupplierCode string true Unique code associated with a supplier account.

Qualifications

The Qualification resource contains the questions and corresponding conditions associated with a survey. These qualifications make up the Marketplace prescreener and define the overall survey targeting criteria for suppliers.

Survey Qualification Model

Property Type Description
SurveyNumber int Unique number associated with the survey.
Questions array Contains an array of Question models.

Questions Model

Property Type Description
QuestionID int Unique number associated with the question.
LogicalOperator string Defines the logical operation applied to the conditions.
PreCodes array Qualification answer option identifier.

GET Show Qualifications

Definition

GET  https://api.samplicio.us/Supply/v1/SurveyQualifications/BySurveyNumberForOfferwall/{SurveyNumber}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Supply/v1/SurveyQualifications/BySurveyNumberForOfferwall/{SurveyNumber}
require 'net/http'

uri = URI('https://api.samplicio.us/Supply/v1/SurveyQualifications/BySurveyNumberForOfferwall/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Supply/v1/SurveyQualifications/BySurveyNumberForOfferwall/{SurveyNumber}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Supply/v1/SurveyQualifications/BySurveyNumberForOfferwall/{SurveyNumber}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/SurveyQualifications/BySurveyNumberForOfferwall/{SurveyNumber}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Supply/v1/SurveyQualifications/BySurveyNumberForOfferwall/{SurveyNumber}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetOfferwallQualificationsBySurveyNumber successful."
  ],
  "ResultCount": 10,
  "SurveyQualification": {
    "SurveyNumber": 254256,
    "Questions": [
      {
        "QuestionID": 42,
        "LogicalOperator": "Or",
        "PreCodes": [
          "18",
          "19",
          "20",
          "21",
          "22",
          "23",
          "24",
          "25"
        ]
      },
      {
        "QuestionID": 43,
        "LogicalOperator": "Or",
        "PreCodes": [
          "1",
          "2"
        ]
      }
    ]
  }
}

Returns a list of all standard and exposed custom qualifications associated with a survey.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.

Quotas

The quotas resource returns the number of completes available to you for each demographic cell in a survey. Quotas can be built on any qualification(s).

Response Properties

Property Type Description
SurveyNumber int Unique number associated with the survey.
SurveyQuotas array Contains an array of Survey Quotas models.
SurveyStatusCode string Code associated with the current status of the survey. See List Global Definitions for a map of survey status codes.
SurveyStillLive boolean A simple check to determine whether a survey is open to respondents. This can be used interchangeably with SurveyStatusCode.

Survey Quotas Model

Property Type Description
SurveyQuotaID int Unique number associated with the quota.
SurveyQuotaType string Represents the function of the quota.
The Total quota represents the maximum number of completes available on the survey and will always be present.
Client quotas are any subquotas on the survey. They are independent of the total quota and may be overlapping with one another.
QuotaCPI double We recommend using Show an Allocated Survey and TargetCCPI to retrieve survey CPI. Gross payout per complete. This value is before any applicable commissions or fees.
Conversion int Percentage of respondents who complete the survey after qualifying for that quota.
NumberOfRespondents int Number of completes available in that quota group.
Questions array Contains an array of Question models.

Questions Model

Property Type Description
QuestionID int Unique number associated with the question.
LogicalOperator string Defines the logical operation applied to the conditions.
PreCodes array Qualification answer option identifier.

GET Show Quotas

Definition

GET  https://api.samplicio.us/Supply/v1/SurveyQuotas/BySurveyNumber/{SurveyNumber}/{SupplierCode}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Supply/v1/SurveyQuotas/BySurveyNumber/{SurveyNumber}/{SupplierCode}
require 'net/http'

uri = URI('https://api.samplicio.us/Supply/v1/SurveyQuotas/BySurveyNumber/{SurveyNumber}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$URL = "https://api.samplicio.us/Supply/v1/SurveyQuotas/BySurveyNumber/{SurveyNumber}/{SupplierCode}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Supply/v1/SurveyQuotas/BySurveyNumber/{SurveyNumber}/{SupplierCode}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/SurveyQuotas/BySurveyNumber/{SurveyNumber}/{SupplierCode}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Supply/v1/SurveyQuotas/BySurveyNumber/{SurveyNumber}/{SupplierCode}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetSurveyQuotasBySurveyNumberAndSupplierCode successful."
  ],
  "ResultCount": 3,
  "SurveyNumber": 254256,
  "SurveyQuotas": [
    {
      "SurveyQuotaID": 1564722,
      "SurveyQuotaType": "Total",
      "QuotaCPI": 0,
      "Conversion": 0,
      "NumberOfRespondents": 20,
      "Questions": null
    },
    {
      "SurveyQuotaID": 1781601,
      "SurveyQuotaType": "Client",
      "QuotaCPI": 0,
      "Conversion": 0,
      "NumberOfRespondents": 10,
      "Questions": [
        {
          "QuestionID": 43,
          "LogicalOperator": "OR",
          "PreCodes": [
            "1"
          ]
        }
      ]
    },
    {
      "SurveyQuotaID": 1781602,
      "SurveyQuotaType": "Client",
      "QuotaCPI": 0,
      "Conversion": 0,
      "NumberOfRespondents": 10,
      "Questions": [
        {
          "QuestionID": 43,
          "LogicalOperator": "OR",
          "PreCodes": [
            "2"
          ]
        }
      ]
    }
  ],
  "SurveyStatusCode": "02",
  "SurveyStillLive": false
}

Returns the total quota and client quotas associated with a survey.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
SupplierCode string true Unique code associated with supplier account.

Entry Links

The Entry Links resource enables suppliers to create, update, and retrieve supplier survey entry links as well as specify supplier link and tracking types. The entry links can then be used to send a respondent to a particular survey, and attaching important information in a query string, such as the unique panelist ID (PID), unique session ID (MID) or respondent’s profile data.

Property Type Description
SupplierLinkTypeCode string Defines the type of buyer-supplier engagement and the respondent’s path in Lucid Marketplace.
TrackingTypeCode string Defines how the Marketplace should communicate back to the supplier’s system at the end of a session. The options are:
NONE (Default and recommended, physically redirects the respondent back to the supplier system)
PIXEL (pixel tracking)
S2S (server to server postback)
DefaultLink string Tracking code or link used if none of the below apply. (Limit 2999 characters)
SuccessLink string Tracking code or link used after a completion. (Limit 2999 characters)
FailureLink string Tracking code or link used after a termination. (Limit 2999 characters)
OverQuotaLink string Tracking code or link used after an overquota. (Limit 2999 characters)
QualityTerminationLink string Tracking code or link used after a quality (security) termination. (Limit 2999 characters)
LiveLink string Live supplier-specific respondent entry link generated by Lucid Marketplace.
TestLink string Test supplier-specific respondent entry link generated by Lucid Marketplace.
CPI double Gross payout per complete. This value is before any applicable commissions or fees.

POST Create a Link

Definition

POST  https://api.samplicio.us/Supply/v1/SupplierLinks/Create/{SurveyNumber}/{SupplierCode}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X POST --data '{"SupplierLinkTypeCode": "OWS", "TrackingTypeCode": "NONE"}' https://api.samplicio.us/Supply/v1/SupplierLinks/Create/{SurveyNumber}/{SupplierCode}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Supply/v1/SupplierLinks/Create/{SurveyNumber}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Post.new(uri.path, initheader = {'Content-Type' =>'application/json'})

request.body = {SupplierLinkTypeCode:"OWS",TrackingTypeCode:"NONE"}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

supplierLink = http.request(request)
<?php
$curl = curl_init();

$params = '{"SupplierLinkTypeCode": "OWS","TrackingTypeCode": "NONE"}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Supply/v1/SupplierLinks/Create/{SurveyNumber}/{SupplierCode}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>

import requests, json

url = 'https://api.samplicio.us/Supply/v1/SupplierLinks/Create/{SurveyNumber}/{SupplierCode}'
params = {'SupplierLinkTypeCode':'OWS','TrackingTypeCode':'NONE'}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.post(url, data=data, headers=headers)
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/SupplierLinks/Create/{SurveyNumber}/{SupplierCode}");

string args = @"{
                  ""SupplierLinkTypeCode"":""OWS"",
                  ""TrackingTypeCode"":""NONE""
                }";

request.Method = "POST";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "POST",
  "hostname": "api.samplicio.us",
  "port": 443,
  "path": "/Supply/v1/SupplierLinks/Create/{SurveyNumber}/{SupplierCode}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {
    "SupplierLinkTypeCode":"OWS",
    "TrackingTypeCode":"NONE"
};

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: CreateSupplierLinkFromModel successful."
  ],
  "ResultCount": 1,
  "SupplierLink": {
    "SupplierLinkTypeCode": "OWS",
    "TrackingTypeCode": "NONE",
    "DefaultLink": "http:\/\/www.anon.com\/surveys?v=lucid&fs=1&uid=[%MID%]",
    "SuccessLink": "http:\/\/www.anon.com\/surveys?v=lucid&fs=2&uid=[%MID%]&COST=[%COST%]",
    "FailureLink": "http:\/\/www.anon.com\/surveys?v=lucid&fs=1&uid=[%MID%]",
    "OverQuotaLink": "http:\/\/www.anon.com\/surveys?v=lucid&fs=1&uid=[%MID%]",
    "QualityTerminationLink": "http:\/\/www.anon.com\/surveys?v=lucid&fs=1&uid=[%MID%]",
    "LiveLink": "http:\/\/samplicio.us\/s\/default.aspx?SID=52c975a7-15fb-804d-9bf2-3d5d553aa7af&PID=",
    "TestLink": "http:\/ \/samplicio.us\/s\/default.aspx?SID=a948gef7-3591-42c0-ce51-0e4jdf25582f&FIRID=MSDHONI7&SUMSTAT=1&PID=test",
    "CPI": 100
  }
}

Creates a supplier-specific respondent entry link for a survey. If no supplier redirects are included, the default supplier redirects will be used.

Arguments

Property Type Required Description
SupplierLinkTypeCode string true Defines the type of buyer-supplier engagement and the respondent’s path in Lucid Marketplace.
TrackingTypeCode string true Defines how the Marketplace should communicate back to the supplier’s system at the end of a session. The options are:
NONE (Default and recommended, physically redirects the respondent back to the supplier system)
PIXEL (pixel tracking)
S2S (server to server postback)
DefaultLink string false Tracking code or link used if none of the below apply. (Limit 2999 characters)
SuccessLink string false Tracking code or link used after a completion. (Limit 2999 characters)
FailureLink string false Tracking code or link used after a termination. (Limit 2999 characters)
OverQuotaLink string false Tracking code or link used after an overquota. (Limit 2999 characters)
QualityTerminationLink string false Tracking code or link used after a quality (security) termination. (Limit 2999 characters)

Definition

PUT  https://api.samplicio.us/Supply/v1/SupplierLinks/Update/{SurveyNumber}/{SupplierCode}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X PUT  --data '{"SupplierLinkTypeCode": "OWS", "TrackingTypeCode": "NONE", "DefaultLink":"","SuccessLink":"","FailureLink":"","OverQuotaLink":"","QualityTerminationLink":""}' https://api.samplicio.us/Supply/v1/SupplierLinks/Update/{SurveyNumber}/{SupplierCode}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Supply/v1/SupplierLinks/Update/{SurveyNumber}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Put.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request['Authorization'] = YOUR_API_KEY_HERE

request.body = {SupplierLinkTypeCode:"OWS",TrackingTypeCode:"NONE",DefaultLink:"",SuccessLink:"",FailureLink:"",OverQuotaLink:"",QualityTerminationLink:""}.to_json

response = http.request(request)
<?php
$curl = curl_init();

$params = '{"SupplierLinkTypeCode": "OWS","TrackingTypeCode": "NONE","DefaultLink": "","SuccessLink": "","FailureLink": "","OverQuotaLink": "","QualityTerminationLink": ""}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Supply/v1/SupplierLinks/Update/{SurveyNumber}/{SupplierCode}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>
import requests, json

url = 'https://api.samplicio.us/Supply/v1/SupplierLinks/Update/{SurveyNumber}/{SupplierCode}'
params = {'SupplierLinkTypeCode':'OWS','TrackingTypeCode':'NONE','DefaultLink':'','SuccessLink':'','FailureLink':'','OverQuotaLink':'','QualityTerminationLink':''}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.put(url, data=data, headers=headers)
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/SupplierLinks/Update/{SurveyNumber}/{SupplierCode}");

string args = @"{
                  ""SupplierLinkTypeCode"":""OWS"",
                  ""TrackingTypeCode"":""NONE"",
                  ""DefaultLink"":"""",
                  ""SuccessLink"":"""",
                  ""FailureLink"":"""",
                  ""OverQuotaLink"":"""",
                  ""QualityTerminationLink"":""""
                }";

request.Method = "PUT";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
        {
            streamWriter.Write(args);
            streamWriter.Flush();
            streamWriter.Close();
        }

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "PUT",
  "hostname": "api.samplicio.us",
  "port": 443,
  "path": "/Supply/v1/SupplierLinks/Update/{SurveyNumber}/{SupplierCode}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {
    "SupplierLinkTypeCode":"OWS",
    "TrackingTypeCode":"NONE",
    "DefaultLink":"",
    "SuccessLink":"",
    "FailureLink":"",
    "OverQuotaLink": "",
    "QualityTerminationLink":""
};

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: UpdateSupplierLinkFromModel successful."
  ],
  "ResultCount": 1,
  "SupplierLink": {
    "SupplierLinkTypeCode": "OWS",
    "TrackingTypeCode": "NONE",
    "DefaultLink": "",
    "SuccessLink": "",
    "FailureLink": "",
    "OverQuotaLink": "",
    "QualityTerminationLink": "",
    "LiveLink": "http:\/\/samplicio.us\/s\/default.aspx?SID=52c795a7-15fh-454d-9ap2-3d5d803aa7af&PID=",
    "TestLink": "http:\/\/samplicio.us\/s\/default.aspx?SID=a348dif7- 3491-42v0-be51-0e4fdf25582f&FIRID=MSDHQNI7&SUMSTAT=8&PID=test",
    "CPI": 100
  }
}

Update an existing entry link for a study.

Arguments

Property Type Required Description
SupplierLinkTypeCode string true Defines the type of buyer-supplier engagement and the respondent’s path in Lucid Marketplace.
TrackingTypeCode string true Defines how Marketplace should communicate back to the supplier’s system at the end of a session. The options are:
NONE (Default and recommended, physically redirects the respondent back to the supplier system)
PIXEL (pixel tracking)
S2S (server to server postback)
DefaultLink string true Tracking code or link used if none of the below apply. (Limit 2999 characters)
SuccessLink string true Tracking code or link used after a completion. (Limit 2999 characters)
FailureLink string true Tracking code or link used after a termination. (Limit 2999 characters)
OverQuotaLink string true Tracking code or link used after an overquota. (Limit 2999 characters)
QualityTerminationLink string true Tracking code or link used after a quality (security) termination. (Limit 2999 characters)

Definition

GET  https://api.samplicio.us/Supply/v1/SupplierLinks/BySurveyNumber/{SurveyNumber}/{SupplierCode}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Supply/v1/SupplierLinks/BySurveyNumber/{SurveyNumber}/{SupplierCode}
require 'net/http'

uri = URI('https://api.samplicio.us/Supply/v1/SupplierLinks/BySurveyNumber/{SurveyNumber}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Supply/v1/SupplierLinks/BySurveyNumber/{SurveyNumber}/{SupplierCode}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Supply/v1/SupplierLinks/BySurveyNumber/{SurveyNumber}/{SupplierCode}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/SupplierLinks/BySurveyNumber/{SurveyNumber}/{SupplierCode}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Supply/v1/SupplierLinks/BySurveyNumber/{SurveyNumber}/{SupplierCode}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetSupplierLinkBySurveyNumberAndSupplierCode successful."
  ],
  "ResultCount": 1,
  "SupplierLink": {
    "SupplierLinkTypeCode": "OWS",
    "TrackingTypeCode": "NONE",
    "DefaultLink": "http:\/\/www.anon.com\/surveys?v=1&fs=1&uid=[%MID%]",
    "SuccessLink": "http:\/\/www.anon.com\/surveys?v=1&fs=2&uid=[%MID%]&COST=[%COST%]",
    "FailureLink": "http:\/\/www.anon.com\/surveys?v=1&fs=1&uid=[%MID%]",
    "OverQuotaLink": "http:\/\/www.anon.com\/surveys?v=1&fs=1&uid=[%MID%]",
    "QualityTerminationLink": "http:\/\/www.anon.com\/surveys?v=1&fs=1&uid=[%MID%]",
    "LiveLink": "http:\/\/samplicio.us\/s\/default.aspx?SID=52c975a7-15fb-804d-9bd2-3d5d553aa7af&PID=",
    "TestLink": "http:\/ \/samplicio.us\/s\/default.aspx?SID=a948gef7-3591-42c0-ce51-0e4xdf25582f&FIRID=MSDHONI7&SUMSTAT=1&PID=test",
    "CPI": 100
  }
}

Returns link details for a survey.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
SupplierCode string true Unique code associated with supplier account.

Statistics

The Survey Statistics resource returns valuable survey performance statistics based on scope and timeframe. This resource is an important part of Yield Management which is the process of implementing business and API processes rank and order surveys to ensure high earnings-per-click (EPC) studies receive the most traffic and low EPC studies are removed from sample send.

Global Trailing Model

Property Type Description
EffectiveEPC float Global Effective EPC given the trailing conversion rate and current CPI of survey (TrailingConversion*CPI)
LengthOfInterview int Global Trailing LOI. Median time for a respondent to complete the survey excluding the Marketplace prescreener in minutes.
SystemConversion float Global trailing conversion rate (# Completes / # System Entrants)

Supplier Lifetime Model

Property Type Description
EPC float Lifetime EPC
SystemConversion float Lifetime conversion rate

Supplier Trailing Model

Property Type Description
SystemConversion float Trailing conversion rate

GET Show Statistics

Definition

GET  https://api.samplicio.us/Supply/v1/SurveyStatistics/BySurveyNumber/{SurveyNumber}/{SupplierCode}/{Scope}/{Timespan}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Supply/v1/SurveyStatistics/BySurveyNumber/{SurveyNumber}/{SupplierCode}/{Scope}/{Timespan}
require 'net/http'

uri = URI('https://api.samplicio.us/Supply/v1/SurveyStatistics/BySurveyNumber/{SurveyNumber}/{SupplierCode}/{Scope}/{Timespan}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$URL = "https://api.samplicio.us/Supply/v1/SurveyStatistics/BySurveyNumber/{SurveyNumber}/{SupplierCode}/{Scope}/{Timespan}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Supply/v1/SurveyStatistics/BySurveyNumber/{SurveyNumber}/{SupplierCode}/{Scope}/{Timespan}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/SurveyStatistics/BySurveyNumber/{SurveyNumber}/{SupplierCode}/{Scope}/{Timespan}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Supply/v1/SurveyStatistics/BySurveyNumber/{SurveyNumber}/{SupplierCode}/{Scope}/{Timespan}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetGlobalTrailingStatisticsBySurveyNumber successful."
  ],
  "ResultCount": 1,
  "SurveyStatistics": {
    "EffectiveEPC": 2.73,
    "LengthOfInterview": 5,
    "SystemConversion": 0.28
  }
}

Returns Marketplace conversion information (as a percentage) for a live study based on the Scope and Timespan.

Arguments

Property Type Required Description
Survey Number int true Unique ID associated with the study.
SupplierCode string true Your unique supplier code.
Scope string true Either “Global” or “Supplier”.
Timespan string true Either “Trailing” or “Lifetime”. Trailing returns data from the last 12 hours.

GET List Statistics

Definition

GET  https://api.samplicio.us/Supply/v1/SurveyStatistics/All/{SupplierCode}/{Scope}/{Timespan}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Supply/v1/SurveyStatistics/All/{SupplierCode}/{Scope}/{Timespan}
require 'net/http'

uri = URI('https://api.samplicio.us/Supply/v1/SurveyStatistics/All/{SupplierCode}/{Scope}/{Timespan}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$URL = "https://api.samplicio.us/Supply/v1/SurveyStatistics/All/{SupplierCode}/{Scope}/{Timespan}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Supply/v1/SurveyStatistics/All/{SupplierCode}/{Scope}/{Timespan}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/SurveyStatistics/All/{SupplierCode}/{Scope}/{Timespan}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Supply/v1/SurveyStatistics/All/{SupplierCode}/{Scope}/{Timespan}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetAllGlobalTrailingStatistics successful."
  ],
  "ResultCount": 2,
  "SurveyStatistics": [
    {
      "SurveyNumber": 999,
      "SystemConversion": 0.42
    },
    {
      "SurveyNumber": 999,
      "SystemConversion": 0.07
    },
  ]
}    

Returns Marketplace conversion information (as a percentage) based on the Scope and Timespan, for all live surveys which have received an entrant in the last 12 hours.

Arguments

Property Type Required Description
Scope string true Either “Global” or “Supplier”.
Timespan string true Either “Trailing” or “Lifetime”. Trailing returns the last 12 hours.
SupplierCode string true Your unique supplier code.

Recruit

Buyers will use the Marketplace to recruit new respondents to their panel or community. The MarketingInformation resource allows suppliers to retrieve campaign marketing information when the study type is either Recruit – Panel or Community Build which can be presented to respondents.

Marketing Information Survey Model

Property Type Description
MarketingHeadline string A headline that describes the recruit offer
MarketingText string Marketing text that describes the benefits the recruit offer
MarketingImageLargeUrl string A company logo or image that represents the recruit offer
MarketingImageSmallUrl string EA thumbnail image, usually company logo, that represents the recruit offer

GET Show Marketing Info

Definition

GET  https://api.samplicio.us/Supply/v1/Surveys/MarketingInformation/BySurveyNumber/{SurveyNumber}/{SupplierCode}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Supply/v1/Surveys/MarketingInformation/BySurveyNumber/{SurveyNumber}/{SupplierCode}
require 'net/http'

uri = URI('https://api.samplicio.us/Supply/v1/Surveys/MarketingInformation/BySurveyNumber/{SurveyNumber}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Supply/v1/Surveys/MarketingInformation/BySurveyNumber/{SurveyNumber}/{SupplierCode}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Supply/v1/Surveys/MarketingInformation/BySurveyNumber/{SurveyNumber}/{SupplierCode}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/Surveys/MarketingInformation/BySurveyNumber/{SurveyNumber}/{SupplierCode}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Supply/v1/Surveys/MarketingInformation/BySurveyNumber/{SurveyNumber}/{SupplierCode}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetMarketingInformationBySurveyNumber successful."
  ],
  "ResultCount": 1,
  "MarketingInformation": {
    "MarketingHeadline": "All the headlines",
    "MarketingText": "Come one, come all!",
    "MarketingImageLargeUrl": "images.google.com/image_large.jpg",
    "MarketingImageSmallUrl": "images.google.com/image_small.jpg"
  }
}

Returns marketing information for a specific survey when study type is either Recruit – Panel or Community Build.

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
SupplierCode string true Unique code associated with the supplier performing the call.

Recontact

Recontacts allow buyers to collect a follow-up impression on a respondent they have already interacted with or already have knowledge of.

SurveyQualifiedRespondents Model

Property Type Description
IsActive boolean Indicates whether a respondent qualifies for the recontact.
PID string A supplier’s unique respondent identifier.

GET List Qualified Respondents

Definition

GET  https://api.samplicio.us/Supply/v1/SurveyQualifiedRespondents/BySurveyNumberSupplierCode/{SurveyNumber}/{SupplierCode}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Supply/v1/SurveyQualifiedRespondents/BySurveyNumberSupplierCode/{SurveyNumber}/{SupplierCode}
require 'net/http'

uri = URI('https://api.samplicio.us/Supply/v1/SurveyQualifiedRespondents/BySurveyNumberSupplierCode/{SurveyNumber}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Supply/v1/SurveyQualifiedRespondents/BySurveyNumberSupplierCode/{SurveyNumber}/{SupplierCode}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Supply/v1/SurveyQualifiedRespondents/BySurveyNumberSupplierCode/{SurveyNumber}/{SupplierCode}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Supply/v1/SurveyQualifiedRespondents/BySurveyNumberSupplierCode/{SurveyNumber}/{SupplierCode}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Supply/v1/SurveyQualifiedRespondents/BySurveyNumberSupplierCode/{SurveyNumber}/{SupplierCode}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: SurveyQualifiedRespondentsBySurveyNumberSupplierCode successful."
  ],
  "ResultCount": 4,
  "SurveyQualifiedRespondents": [
    {
      "PID": "1111110",
      "IsActive": true
    },
    {
      "PID": "1111101",
      "IsActive": true
    },
    {
      "PID": "1111001",
      "IsActive": true
    },
    {
      "PID": "1110001",
      "IsActive": true
    }
  ]
}

Returns the list of PIDs by supplier for a specific Marketplace survey when study type is Recontact.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
SupplierCode string true Unique code associated with the supplier performing the call.

Marketplace Integration

Surveys

The Surveys resource allows the buyer to create new surveys, update existing surveys, and retrieve survey details in Marketplace.

Survey Model

Property Type Description
AccountID int Unique account identifier.
SurveyStatusCode string Code associated with the current status of the survey. See List Global Definitions for a map of survey status codes.
SurveyPriority int Survey priority from 1-11 (1 being the highest). Priority only applies to routed sample.
SurveyNumber int Unique number associated with the survey.
SurveyName string External name of the survey. This name may be exposed to respondents. This value is not unique across surveys. Maximum length of 128.
CountryLanguageID int Unique id associated with a country-language pair.
IndustryID int Industry associated with the survey’s topic.
StudyTypeID int Indicates the survey’s format and purpose (i.e. adhoc, recruit, etc).
ClientCPI double Revenue per complete used to calculate internal margin or savings.
QuotaCPI double Gross payout per complete. This value is before any applicable commissions or fees.
ClientSurveyLiveURL string Link to client survey. We don’t recommend exceeding 2000 characters.
TestRedirectURL string Link to client survey for testing purposes. All studies should include a working test link.
IsActive boolean Indicates if a survey is active or inactive in Lucid Marketplace database. We recommend keeping all surveys in an active status.
Quota int Total number of completes needed.
FulcrumExchangeAllocation double Percentage of total completes allocated only to Lucid Marketplace. Must be between 0 and 100%.
FulcrumExchangeHedgeAccess boolean true gives the Marketplace access to any unallocated completes.
IsVerifyCallBack boolean true enables Verify CallBack security which requires the correct [%RSFN%] variable to be included on the “complete” client callback for verification.
UniquePID boolean true enables PID deduplication on a survey preventing a respondent with the same PID from entering more than once. Recommended on all surveys.
UniqueIPAddress boolean true enables IP deduplication on a survey preventing a respondent with the same IP address from entering more than once. Recommended on all surveys.
IsRelevantID boolean true enables RelevantID security. RelevantID is a third-party security feature. There is an additional cost for RelevantID.
IsDedupe boolean true enables Relevant ID dedupe security. Should always be enabled when using RelevantID
IsGeoIP boolean true enables RelevantID GeoIP security to determine respondent geographical location. Should always be enabled when using RelevantID.
IsFraudProfile boolean true enables RelevantID Fraud Profile security. Should always be enabled when using RelevantID.
FraudProfileThreshold int Sets the RelevantID Fraud Profile Threshold between 0-100. The lower the number the more aggressive the security. We recommend 11.
IsTrueSample boolean Property is returned but is nonfunctional. TrueSample functionality is now included within IsRelevantID.
QuotaCalculationTypeID int Sets the quota calculation method. Either 1 for ”Completes” (quotas determined by completes) or 2=”Prescreens” (quotas determined when leaving Lucid Marketplace).
SurveyPlatformID int Sets the external platform ID. This should be hardcoded to 1 which represents “none”.
BidLengthOfInterview int Estimated time for a respondent to complete the survey excluding the Marketplace prescreener in minutes as provided by the buyer.
BusinessUnitID int Sets the account business unit.
SampleTypeID int Sets the type of sample the survey is open to (i.e. consumer, business-to-business, etc). See Sample Types
SurveySID string Unique hash value (GUID) associated with the survey.
BidIncidence int Estimated incidence rate for the survey.
CollectsPII boolean true indicates that the survey will collect PII.

POST Create a Survey

Definition

POST  https://api.samplicio.us/Demand/v1/Surveys/Create

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X POST --data '{"SurveyStatusCode": "01","SurveyPriority": 11,"SurveyName": "Example API Survey","CountryLanguageID": 9,"IndustryID": 30,"StudyTypeID": 1,"ClientCPI": 1,"QuotaCPI": 2,"ClientSurveyLiveURL": "https://www.surveyURL.com?rid=[%RID%]","TestRedirectURL": "https://www.surveyURL.com?rid=[%RID%]","IsActive": true,"Quota": 1000,"FulcrumExchangeAllocation": 0,"FulcrumExchangeHedgeAccess": true,"IsVerifyCallBack": true,"UniquePID": true,"UniqueIPAddress": true,"IsRelevantID": false,"IsDedupe": false,"IsGeoIP": false,"IsFraudProfile": false,"FraudProfileThreshold": 0,"IsTrueSample": false,"QuotaCalculationTypeID": 1,"SurveyPlatformID": 1,"BidLengthOfInterview": 10,"BusinessUnitID": 9,"SampleTypeID": 100,"BidIncidence": 20,"CollectsPII": null}' https://api.samplicio.us/Demand/v1/Surveys/Create
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/Surveys/Create')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Post.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {
    "SurveyStatusCode"=> "01",
    "SurveyPriority"=> 11,
    "SurveyName"=> "Example API Survey",
    "CountryLanguageID": 9,
    "IndustryID"=> 30,
    "StudyTypeID"=> 1,
    "ClientCPI"=> 1,
    "QuotaCPI"=> 2,
    "ClientSurveyLiveURL"=> "https://www.surveyURL.com?rid=[%RID%]",
    "TestRedirectURL"=> "https://www.surveyURL.com?rid=[%RID%]",
    "IsActive"=> true,
    "Quota"=> 1000,
    "FulcrumExchangeAllocation"=> 0,
    "FulcrumExchangeHedgeAccess"=> true,
    "IsVerifyCallBack"=> true,
    "UniquePID"=> true,
    "UniqueIPAddress"=> true,
    "IsRelevantID"=> false,
    "IsDedupe"=> false,
    "IsGeoIP"=> false,
    "IsFraudProfile"=> false,
    "FraudProfileThreshold"=> 0,
    "IsTrueSample"=> false,
    "QuotaCalculationTypeID"=> 1,
    "SurveyPlatformID"=> 1,
    "BidLengthOfInterview"=> 10,
    "BusinessUnitID"=> 9,
    "SampleTypeID"=> 100,
    "BidIncidence"=> 20,
    "CollectsPII"=> nil
 }.to_json

 request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{
    "SurveyStatusCode": "01",
    "SurveyPriority": 11,
    "SurveyName": "Example API Survey",
    "CountryLanguageID": 9,
    "IndustryID": 30,
    "StudyTypeID": 1,
    "ClientCPI": 1,
    "QuotaCPI": 2,
    "ClientSurveyLiveURL": "https://www.surveyURL.com?rid=[%RID%]",
    "TestRedirectURL": "https://www.surveyURL.com?rid=[%RID%]",
    "IsActive": true,
    "Quota": 1000,
    "FulcrumExchangeAllocation": 0,
    "FulcrumExchangeHedgeAccess": true,
    "IsVerifyCallBack": true,
    "UniquePID": true,
    "UniqueIPAddress": true,
    "IsRelevantID": false,
    "IsDedupe": false,
    "IsGeoIP": false,
    "IsFraudProfile": false,
    "FraudProfileThreshold": 0,
    "IsTrueSample": false,
    "QuotaCalculationTypeID": 1,
    "SurveyPlatformID": 1,
    "BidLengthOfInterview": 10,
    "BusinessUnitID": 9,
    "SampleTypeID": 100,
    "BidIncidence": 20,
    "CollectsPII": null
 }';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/Surveys/Create",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>

import requests, json

url = 'https://api.samplicio.us/Demand/v1/Surveys/Create'
params = {
    "SurveyStatusCode": "01",
    "SurveyPriority": 11,
    "SurveyName": "Example API Survey",
    "CountryLanguageID": 9,
    "IndustryID": 30,
    "StudyTypeID": 1,
    "ClientCPI": 1,
    "QuotaCPI": 2,
    "ClientSurveyLiveURL": "https://www.surveyURL.com?rid=[%RID%]",
    "TestRedirectURL": "https://www.surveyURL.com?rid=[%RID%]",
    "IsActive": True,
    "Quota": 1000,
    "FulcrumExchangeAllocation": 0,
    "FulcrumExchangeHedgeAccess": True,
    "IsVerifyCallBack": True,
    "UniquePID": True,
    "UniqueIPAddress": True,
    "IsRelevantID": False,
    "IsDedupe": False,
    "IsGeoIP": False,
    "IsFraudProfile": False,
    "FraudProfileThreshold": 0,
    "IsTrueSample": False,
    "QuotaCalculationTypeID": 1,
    "SurveyPlatformID": 1,
    "BidLengthOfInterview": 10,
    "BusinessUnitID": 9,
    "SampleTypeID": 100,
    "BidIncidence": 20,
    "CollectsPII": None
 }
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.post(url, data=data, headers=headers)
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/Surveys/Create");

string args = @"{
                    ""SurveyStatusCode"": ""01"",
                    ""SurveyPriority"": 11,
                    ""SurveyName"": ""Example API Survey"",
                    ""CountryLanguageID"": 9,
                    ""IndustryID"": 30,
                    ""StudyTypeID"": 1,
                    ""ClientCPI"": 1,
                    ""QuotaCPI"": 2,
                    ""ClientSurveyLiveURL"": ""https://www.surveyURL.com?rid=[%RID%]"",
                    ""TestRedirectURL"": ""https://www.surveyURL.com?rid=[%RID%]"",
                    ""IsActive"": true,
                    ""Quota"": 1000,
                    ""FulcrumExchangeAllocation"": 0,
                    ""FulcrumExchangeHedgeAccess"": true,
                    ""IsVerifyCallBack"": true,
                    ""UniquePID"": true,
                    ""UniqueIPAddress"": true,
                    ""IsRelevantID"": false,
                    ""IsDedupe"": false,
                    ""IsGeoIP"": false,
                    ""IsFraudProfile"": false,
                    ""FraudProfileThreshold"": 0,
                    ""IsTrueSample"": false,
                    ""QuotaCalculationTypeID"": 1,
                    ""SurveyPlatformID"": 1,
                    ""BidLengthOfInterview"": 10,
                    ""BusinessUnitID"": 9,
                    ""SampleTypeID"": 100,
                    ""BidIncidence"": 20,
                    ""CollectsPII"": null
                }";

request.Method = "POST";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "POST",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/Surveys/Create",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {
    "SurveyStatusCode": "01",
    "SurveyPriority": 11,
    "SurveyName": "Example API Survey",
    "CountryLanguageID": 9,
    "IndustryID": 30,
    "StudyTypeID": 1,
    "ClientCPI": 1,
    "QuotaCPI": 2,
    "ClientSurveyLiveURL": "https://www.surveyURL.com?rid=[%RID%]",
    "TestRedirectURL": "https://www.surveyURL.com?rid=[%RID%]",
    "IsActive": true,
    "Quota": 1000,
    "FulcrumExchangeAllocation": 0,
    "FulcrumExchangeHedgeAccess": true,
    "IsVerifyCallBack": true,
    "UniquePID": true,
    "UniqueIPAddress": true,
    "IsRelevantID": false,
    "IsDedupe": false,
    "IsGeoIP": false,
    "IsFraudProfile": false,
    "FraudProfileThreshold": 0,
    "IsTrueSample": false,
    "QuotaCalculationTypeID": 1,
    "SurveyPlatformID": 1,
    "BidLengthOfInterview": 10,
    "BusinessUnitID": 9,
    "SampleTypeID": 100,
    "BidIncidence": 20,
    "CollectsPII": null
 };

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: CreateSurveyFromModel successful."
  ],
  "ResultCount": 1,
  "Survey": {
    "AccountID": 1,
    "SurveyStatusCode": "01",
    "SurveyPriority": 11,
    "SurveyNumber": 12345,
    "SurveyName": "Example API Survey",
    "CountryLanguageID": 9,
    "IndustryID": 30,
    "StudyTypeID": 1,
    "ClientCPI": 1,
    "QuotaCPI": 2,
    "ClientSurveyLiveURL": "https://www.surveyURL.com?rid=[%RID%]",
    "TestRedirectURL": "https://www.surveyURL.com?rid=[%RID%]",
    "IsActive": true,
    "Quota": 1000,
    "FulcrumExchangeAllocation": 0,
    "FulcrumExchangeHedgeAccess": true,
    "IsVerifyCallBack": true,
    "UniquePID": true,
    "UniqueIPAddress": true,
    "IsRelevantID": false,
    "IsDedupe": false,
    "IsGeoIP": false,
    "IsFraudProfile": false,
    "FraudProfileThreshold": 0,
    "IsTrueSample": false,
    "QuotaCalculationTypeID": 1,
    "SurveyPlatformID": 1,
    "BidLengthOfInterview": 10,
    "BusinessUnitID": 9,
    "SampleTypeID": 100,
    "SurveySID": "E75CDFE2-7221-4FAC-8561-78EE1B1D6ECF",
    "BidIncidence": 20,
    "CollectsPII": null
  }
}

Creates a Marketplace survey.

Arguments

Property Type Required Description
AccountID int false Unique account identifier.
SurveyStatusCode string false Code associated with the current status of the survey. See List Global Definitions for a map of survey status codes.
SurveyPriority int false Survey priority from 1-11 (1 being the highest). Priority only applies to routed sample.
SurveyName string true External name of the survey. This name may be exposed to respondents. This value is not unique across surveys. Maximum 128 characters.
CountryLanguageID int true Unique id associated with a country-language pair.
IndustryID int false Industry associated with the survey’s topic.
StudyTypeID int false Indicates the survey’s format and purpose (i.e. adhoc, recruit, etc).
ClientCPI double false Revenue per complete used to calculate internal margin or savings.
QuotaCPI double false Gross payout per complete. This value is before any applicable commissions or fees.
ClientSurveyLiveURL string true Link to client survey. Max URL length is 3000 characters.
TestRedirectURL string false Link to client survey for testing purposes. All studies should include a working test link. Max URL length is 3000 characters.
IsActive boolean false Indicates if a survey is active or inactive in Lucid Marketplace. We recommend keeping any surveys that have prescreens or completes in active status.
Quota int false Total number of completes needed.
FulcrumExchangeAllocation double false Percentage of total completes allocated only to Lucid Marketplace. Must be between 0 and 100%.
FulcrumExchangeHedgeAccess boolean false true gives the Marketplace access to any unallocated completes.
IsVerifyCallBack boolean false true enables Verify CallBack security which requires the correct [%RSFN%] variable to be included on the “complete” client callback for verification.
UniquePID boolean false true enables PID deduplication on a survey preventing a respondent with the same PID from entering more than once. Recommended on all surveys.
UniqueIPAddress boolean false true enables IP deduplication on a survey preventing a respondent with the same IP address from entering more than once. Recommended on all surveys.
IsRelevantID boolean false true enables RelevantID security. RelevantID is a third-party security feature. There is an additional cost for RelevantID.
IsDedupe boolean false true enables Relevant ID dedupe security. Should always be enabled when using RelevantID.
IsGeoIP boolean false true enables RelevantID GeoIP security to determine respondent geographical location. Should always be enabled when using RelevantID.
IsFraudProfile boolean false true enables RelevantID Fraud Profile security. Should always be enabled when using RelevantID.
FraudProfileThreshold int false Sets the RelevantID Fraud Profile Threshold between 0-100. The lower the number the more aggressive the security. We recommend 11.
IsTrueSample boolean false Property is returned but is nonfunctional. TrueSample functionality is now included within IsRelevantID.
QuotaCalculationTypeID int false Sets the quota calculation method. Either 1 for ”Completes” (quotas determined by completes) or 2=”Prescreens” (quotas determined when leaving Lucid Marketplace).
SurveyPlatformID int false Sets the external platform ID. This should be hardcoded to 1 which represents “none”.
BidLengthOfInterview int false Estimated time for a respondent to complete the survey excluding the Marketplace prescreener in minutes as provided by the buyer.
BusinessUnitID int false Sets the account business unit.
SampleTypeID int false Sets the type of sample the survey is open to (i.e. consumer, business-to-business, etc). See Sample Types.
BidIncidence int false Estimated incidence rate for the survey.
CollectsPII boolean false true indicates that the survey will collect PII.

PUT Update a Survey

Definition

PUT  https://api.samplicio.us/Demand/v1/Surveys/Update/{SurveyNumber}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X PUT --data '{"SurveyStatusCode": "01","SurveyPriority": 11,"SurveyNumber": 12345,"SurveyName": "Example API Survey","CountryLanguageID": 9,"IndustryID": 30,"StudyTypeID": 1,"ClientCPI": 1,"QuotaCPI": 2,"ClientSurveyLiveURL": "https://www.surveyURL.com?rid=[%RID%]","TestRedirectURL": "https://www.surveyURL.com?rid=[%RID%]","IsActive": true,"Quota": 100,"FulcrumExchangeAllocation": 0,"FulcrumExchangeHedgeAccess": true,"IsVerifyCallBack": true,"UniquePID": true,"UniqueIPAddress": true,"IsRelevantID": false,"IsDedupe": false,"IsGeoIP": false,"IsFraudProfile": false,"FraudProfileThreshold": 0,"IsTrueSample": false,"QuotaCalculationTypeID": 1,"SurveyPlatformID": 1,"BidLengthOfInterview": 10,"BusinessUnitID": 9,"SampleTypeID": 100,"CollectsPII": null}' https://api.samplicio.us/Demand/v1/Surveys/Update/{SurveyNumber}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/Surveys/Update/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Put.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {
    SurveyStatusCode: "01",
    SurveyPriority: 11,
    SurveyNumber: 12345,
    SurveyName: "Example API Survey",
    CountryLanguageID: 9,
    IndustryID: 30,
    StudyTypeID: 1,
    ClientCPI: 1,
    QuotaCPI: 2,
    ClientSurveyLiveURL: "https://www.surveyURL.com?rid=[%RID%]",
    TestRedirectURL: "https://www.surveyURL.com?rid=[%RID%]",
    IsActive: true,
    Quota: 100,
    FulcrumExchangeAllocation: 0,
    FulcrumExchangeHedgeAccess: true,
    IsVerifyCallBack: true,
    UniquePID: true,
    UniqueIPAddress: true,
    IsRelevantID: false,
    IsDedupe: false,
    IsGeoIP: false,
    IsFraudProfile: false,
    FraudProfileThreshold: 0,
    IsTrueSample: false,
    QuotaCalculationTypeID: 1,
    SurveyPlatformID: 1,
    BidLengthOfInterview: 10,
    BusinessUnitID: 9,
    SampleTypeID: 100,
    BidIncidence: 20,
    CollectsPII: nil
 }.to_json

 request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{
    "SurveyStatusCode": "01",
    "SurveyPriority": 11,
    "SurveyNumber": 12345,
    "SurveyName": "Example API Survey",
    "CountryLanguageID": 9,
    "IndustryID": 30,
    "StudyTypeID": 1,
    "ClientCPI": 1,
    "QuotaCPI": 2,
    "ClientSurveyLiveURL": "https://www.surveyURL.com?rid=[%RID%]",
    "TestRedirectURL": "https://www.surveyURL.com?rid=[%RID%]",
    "IsActive": true,
    "Quota": 100,
    "FulcrumExchangeAllocation": 0,
    "FulcrumExchangeHedgeAccess": true,
    "IsVerifyCallBack": true,
    "UniquePID": true,
    "UniqueIPAddress": true,
    "IsRelevantID": false,
    "IsDedupe": false,
    "IsGeoIP": false,
    "IsFraudProfile": false,
    "FraudProfileThreshold": 0,
    "IsTrueSample": false,
    "QuotaCalculationTypeID": 1,
    "SurveyPlatformID": 1,
    "BidLengthOfInterview": 10,
    "BusinessUnitID": 9,
    "SampleTypeID": 100,
    "BidIncidence": 20,
    "CollectsPII": null
 }';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/Surveys/Update/{SurveyNumber}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>

import requests, json

url = 'https://api.samplicio.us/Demand/v1/Surveys/Update/{SurveyNumber}'
params = {
    "SurveyStatusCode": "01",
    "SurveyPriority": 11,
    "SurveyNumber": 12345,
    "SurveyName": "Example API Survey",
    "CountryLanguageID": 9,
    "IndustryID": 30,
    "StudyTypeID": 1,
    "ClientCPI": 1,
    "QuotaCPI": 2,
    "ClientSurveyLiveURL": "https://www.surveyURL.com?rid=[%RID%]",
    "TestRedirectURL": "https://www.surveyURL.com?rid=[%RID%]",
    "IsActive": True,
    "Quota": 100,
    "FulcrumExchangeAllocation": 0,
    "FulcrumExchangeHedgeAccess": True,
    "IsVerifyCallBack": True,
    "UniquePID": True,
    "UniqueIPAddress": True,
    "IsRelevantID": False,
    "IsDedupe": False,
    "IsGeoIP": False,
    "IsFraudProfile": False,
    "FraudProfileThreshold": 0,
    "IsTrueSample": False,
    "QuotaCalculationTypeID": 1,
    "SurveyPlatformID": 1,
    "BidLengthOfInterview": 10,
    "BusinessUnitID": 9,
    "SampleTypeID": 100,
    "BidIncidence": 20,
    "CollectsPII": None
 }
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.put(url, data=data, headers=headers)
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/Surveys/Update/{SurveyNumber}");

string args = @"{
                    ""SurveyStatusCode"": ""01"",
                    ""SurveyPriority"": 11,
                    ""SurveyNumber"": 12345,
                    ""SurveyName"": ""Example API Survey"",
                    ""CountryLanguageID"": 9,
                    ""IndustryID"": 30,
                    ""StudyTypeID"": 1,
                    ""ClientCPI"": 1,
                    ""QuotaCPI"": 2,
                    ""ClientSurveyLiveURL"": ""https://www.surveyURL.com?rid=[%RID%]"",
                    ""TestRedirectURL"": ""https://www.surveyURL.com?rid=[%RID%]"",
                    ""IsActive"": true,
                    ""Quota"": 100,
                    ""FulcrumExchangeAllocation"": 0,
                    ""FulcrumExchangeHedgeAccess"": true,
                    ""IsVerifyCallBack"": true,
                    ""UniquePID"": true,
                    ""UniqueIPAddress"": true,
                    ""IsRelevantID"": false,
                    ""IsDedupe"": false,
                    ""IsGeoIP"": false,
                    ""IsFraudProfile"": false,
                    ""FraudProfileThreshold"": 0,
                    ""IsTrueSample"": false,
                    ""QuotaCalculationTypeID"": 1,
                    ""SurveyPlatformID"": 1,
                    ""BidLengthOfInterview"": 10,
                    ""BusinessUnitID"": 9,
                    ""SampleTypeID"": 100,
                    ""BidIncidence"": 20,
                    ""CollectsPII"": null
                }";

request.Method = "PUT";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "PUT",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/Surveys/Update",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {
    "SurveyStatusCode": "01",
    "SurveyPriority": 11,
    "SurveyNumber": 12345,
    "SurveyName": "Example API Survey",
    "CountryLanguageID": 9,
    "IndustryID": 30,
    "StudyTypeID": 1,
    "ClientCPI": 1,
    "QuotaCPI": 2,
    "ClientSurveyLiveURL": "https://www.surveyURL.com?rid=[%RID%]",
    "TestRedirectURL": "https://www.surveyURL.com?rid=[%RID%]",
    "IsActive": true,
    "Quota": 100,
    "FulcrumExchangeAllocation": 0,
    "FulcrumExchangeHedgeAccess": true,
    "IsVerifyCallBack": true,
    "UniquePID": true,
    "UniqueIPAddress": true,
    "IsRelevantID": false,
    "IsDedupe": false,
    "IsGeoIP": false,
    "IsFraudProfile": false,
    "FraudProfileThreshold": 0,
    "IsTrueSample": false,
    "QuotaCalculationTypeID": 1,
    "SurveyPlatformID": 1,
    "BidLengthOfInterview": 10,
    "BusinessUnitID": 9,
    "SampleTypeID": 100,
    "BidIncidence": 20,
    "CollectsPII": null
 };

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: UpdateSurveyFromModel successful."
  ],
  "ResultCount": 1,
  "Survey": {
    "SurveyStatusCode": "01",
    "SurveyPriority": 11,
    "SurveyNumber": 12345,
    "SurveyName": "Example API Survey",
    "CountryLanguageID": 9,
    "IndustryID": 30,
    "StudyTypeID": 1,
    "ClientCPI": 1,
    "QuotaCPI": 2,
    "ClientSurveyLiveURL": "https://www.surveyURL.com?rid=[%RID%]",
    "TestRedirectURL": "https://www.surveyURL.com?rid=[%RID%]",
    "IsActive": true,
    "Quota": 100,
    "FulcrumExchangeAllocation": 0,
    "FulcrumExchangeHedgeAccess": true,
    "IsVerifyCallBack": true,
    "UniquePID": true,
    "UniqueIPAddress": true,
    "IsRelevantID": false,
    "IsDedupe": false,
    "IsGeoIP": false,
    "IsFraudProfile": false,
    "FraudProfileThreshold": 0,
    "IsTrueSample": false,
    "QuotaCalculationTypeID": 1,
    "SurveyPlatformID": 1,
    "BidLengthOfInterview": 10,
    "BusinessUnitID": 9,
    "SampleTypeID": 100,
    "SurveySID": "E75CDFE2-7221-4FAC-8561-78EE1B1D6ECF",
    "BidIncidence": 20,
    "CollectsPII": null
  }
}

Update an existing Marketplacesurvey.

Arguments

Property Type Required Description
AccountID int true Unique account identifier.
SurveyStatusCode string true Code associated with the current status of the survey. See List Global Definitions for a map of survey status codes.
SurveyPriority int true Survey priority from 1-11 (1 being the highest). Priority only applies to routed sample.
SurveyName string true External name of the survey. This name may be exposed to respondents. This value is not unique across surveys.
SurveyNumber int true Unique number associated with the survey.
CountryLanguageID int true Unique id associated with a country-language pair.
IndustryID int true Industry associated with the survey’s topic.
StudyTypeID int true Indicates the survey’s format and purpose (i.e. adhoc, recruit, etc).
ClientCPI double true Revenue per complete used to calculate internal margin or savings.
QuotaCPI double true Gross payout per complete. This value is before any applicable commissions or fees.
ClientSurveyLiveURL string true Link to client survey. Max URL length is 3000 characters.
TestRedirectURL string true Link to client survey for testing purposes. All studies should include a working test link. Max URL length is 3000 characters.
IsActive boolean true Indicates if a survey is active or inactive in Marketplace database.
Quota int true Total number of completes needed.
FulcrumExchangeAllocation double true Percentage of total completes allocated only to Lucid Marketplace. Must be between 0 and 100%.
FulcrumExchangeHedgeAccess boolean true true gives the Marketplace access to any unallocated completes.
IsVerifyCallBack boolean true true enables Verify CallBack security which requires the correct [%RSFN%] variable to be included on the “complete” client callback for verification.
UniquePID boolean true true enables PID deduplication on a survey preventing a respondent with the same PID from entering more than once. Recommended on all surveys.
UniqueIPAddress boolean true true enables IP deduplication on a survey preventing a respondent with the same IP address from entering more than once. Recommended on all surveys.
IsRelevantID boolean true true enables RelevantID security. RelevantID is a third-party security feature. There is an additional cost associated.
IsDedupe boolean true true enables Relevant ID dedupe security. Should always be enabled when using RelevantID.
IsGeoIP boolean true true enables RelevantID GeoIP security to determine respondent geographical location. Should always be enabled when using RelevantID.
IsFraudProfile boolean true true enables RelevantID Fraud Profile security. Should always be enabled when using RelevantID.
FraudProfileThreshold int true Set’s the RelevantID Fraud Profile Threshold between 0-100. The lower the number the more aggressive the security. We recommend 11.
IsTrueSample boolean false Property is returned but is nonfunctional. TrueSample functionality is now included within IsRelevantID.
QuotaCalculationTypeID int true Sets the quota calculation method. Either 1 for ”Completes” (quotas counted using completes) or 2=”Prescreens” (quotas counted when leaving Marketplace for the survey).
SurveyPlatformID int true Sets the external platform ID. This should be hardcoded to 1 which represents “none”.
BidLengthOfInterview int true Estimated time for a respondent to complete the survey excluding the Marketplace prescreener in minutes as provided by the buyer.
BusinessUnitID int true Sets the account business unit.
SampleTypeID int false Sets the type of sample the survey is open to (i.e. consumer, business-to-business, etc). See Sample Types.
BidIncidence int false Estimated incidence rate for the survey.
CollectsPII boolean false true indicates that the survey will collect PII.

GET Show a Survey

Definition

GET  https://api.samplicio.us/Demand/v1/Surveys/BySurveyNumber/{SurveyNumber}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Demand/v1/Surveys/BySurveyNumber/{SurveyNumber}
require 'net/http'

uri = URI('https://api.samplicio.us/Demand/v1/Surveys/BySurveyNumber/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$URL = "https://api.samplicio.us/Demand/v1/Surveys/BySurveyNumber/{SurveyNumber}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Demand/v1/Surveys/BySurveyNumber/{SurveyNumber}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/Surveys/BySurveyNumber/{SurveyNumber}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/Surveys/BySurveyNumber/{SurveyNumber}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetSurveyBySurveyNumber successful."
  ],
  "ResultCount": 1,
  "Survey": {
    "AccountID": 1,
    "SurveyStatusCode": "01",
    "SurveyPriority": 11,
    "SurveyNumber": 12345,
    "SurveyName": "Example API Survey",
    "CountryLanguageID": 9,
    "IndustryID": 30,
    "StudyTypeID": 1,
    "ClientCPI": 1,
    "QuotaCPI": 2,
    "ClientSurveyLiveURL": "https://www.surveyURL.com?rid=[%RID%]",
    "TestRedirectURL": "https://www.surveyURL.com?rid=[%RID%]",
    "IsActive": true,
    "Quota": 100,
    "FulcrumExchangeAllocation": 0,
    "FulcrumExchangeHedgeAccess": true,
    "IsVerifyCallBack": true,
    "UniquePID": true,
    "UniqueIPAddress": true,
    "IsRelevantID": true,
    "IsDedupe": true,
    "IsGeoIP": false,
    "IsFraudProfile": false,
    "FraudProfileThreshold": 0,
    "IsTrueSample": false,
    "QuotaCalculationTypeID": 1,
    "SurveyPlatformID": 1,
    "BidLengthOfInterview": 10,
    "BusinessUnitID": 9,
    "SampleTypeID": 100,
    "SurveySID": "E75CDFE2-7221-4FAC-8561-78EE1B1D6ECF",
    "BidIncidence": 20,
    "CollectsPII": null
  }
}

Returns the details of a specific Marketplace survey.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.

GET List Surveys By Status

Definition

GET  https://api.samplicio.us/Demand/v1/Surveys/BySurveyStatus/{SurveyStatus}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Demand/v1/Surveys/BySurveyStatus/{SurveyStatus}
require 'net/http'

uri = URI('https://api.samplicio.us/Demand/v1/Surveys/BySurveyStatus/{SurveyStatus}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$URL = "https://api.samplicio.us/Demand/v1/Surveys/BySurveyStatus/{SurveyStatus}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Demand/v1/Surveys/BySurveyStatus/{SurveyStatus}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/Surveys/BySurveyStatus/{SurveyStatus}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "https://api.samplicio.us/Demand/v1/Surveys/BySurveyStatus/{SurveyStatus}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetSurveysBySurveyStatus successful."
  ],
  "ResultCount": 1,
  "Surveys": [
    {
      "AccountID": 1,
      "SurveyStatusCode": "01",
      "SurveyPriority": 11,
      "SurveyNumber": 12345,
      "SurveyName": "Example API Survey",
      "CountryLanguageID": 9,
      "IndustryID": 30,
      "StudyTypeID": 1,
      "ClientCPI": 1,
      "QuotaCPI": 2,
      "ClientSurveyLiveURL": "https://www.surveyURL.com?rid=[%RID%]",
      "TestRedirectURL": "https://www.surveyURL.com?rid=[%RID%]",
      "IsActive": true,
      "Quota": 100,
      "FulcrumExchangeAllocation": 0,
      "FulcrumExchangeHedgeAccess": true,
      "IsVerifyCallBack": true,
      "UniquePID": true,
      "UniqueIPAddress": true,
      "IsRelevantID": true,
      "IsDedupe": true,
      "IsGeoIP": false,
      "IsFraudProfile": false,
      "FraudProfileThreshold": 0,
      "IsTrueSample": false,
      "QuotaCalculationTypeID": 1,
      "SurveyPlatformID": 1,
      "BidLengthOfInterview": 10,
      "BusinessUnitID": 9,
      "SampleTypeID": 100,
      "SurveySID": "E75CDFE2-7221-4FAC-8561-78EE1B1D6ECF",
      "BidIncidence": 20,
      "CollectsPII": null
    }
  ]
}

Returns an index of all surveys by status such as Pending, Live, and Completed.

Arguments

Property Type Required Description
SurveyStatus int true Code associated with the current status of the survey. See List Global Definitions for a map, of survey status codes.

POST Reconcile a Survey

Definition

POST https://api.samplicio.us/Demand/v1/Surveys/Reconcile/{SurveyNumber}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X POST --data '{"ResponseIDs" : ["9AF8B134-9E9F-E611-813Z-121EAE80731D", "1ADX57D4-9A9F-E711-813E-121DAC84731P"]}' https://api.samplicio.us/Demand/v1/Surveys/Reconcile/123456
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/Surveys/Reconcile/123456')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Post.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {ResponseIDs: [
    "9AF8B134-9E9F-E611-813Z-121EAE80731D",
    "1ADX57D4-9A9F-E711-813E-121DAC84731P"
  ]
 }.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{"ResponseIDs": [
    "9AF8B134-9E9F-E611-813Z-121EAE80731D",
    "1ADX57D4-9A9F-E711-813E-121DAC84731P"
  ]
 }';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/Surveys/Reconcile/123456",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>

import requests, json

url = 'https://api.samplicio.us/Demand/v1/Surveys/Reconcile/123456'
params = {"ResponseIDs": [
    "9AF8B134-9E9F-E611-813Z-121EAE80731D",
    "1ADX57D4-9A9F-E711-813E-121DAC84731P"
  ]
 }

data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.post(url, data=data, headers=headers)
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/Surveys/Reconcile/123456");

string args = @"{
                  ""ResponseIDs"" : [
                    9AF8B134-9E9F-E611-813Z-121EAE80731D,
                    1ADX57D4-9A9F-E711-813E-121DAC84731P
                  ]
                }";

request.Method = "POST";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "POST",
  "hostname": "api.samplicio.us",
  "port": 443,
  "path": "/Demand/v1/Surveys/Reconcile/123456",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {"ResponseIDs": [
    "9AF8B134-9E9F-E611-813Z-121EAE80731D",
    "1ADX57D4-9A9F-E711-813E-121DAC84731P"
  ]
 };

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
    "AccountCode": "AA",
    "AccountType": 2,
    "ApiAccount": "Anon",
    "ApiAccountStatus": 1,
    "ApiMessages": [
        "API Message: Response initialized.",
        "API Message: Reconciliation in-progress"
    ],
    "ApiResult": 0,
    "ApiResultCode": 0,
    "ResultCount": 0,
    "reconciliation": {
        "ResponseIDs": [
          "9AF8B134-9E9F-E611-813Z-121EAE80731D",
          "1ADX57D4-9A9F-E711-813E-121DAC84731P"
        ]
    }
}

Reconciles the list of respondents in this call with the list of completes in Marketplace. Any RID not included will be removed from Marketplace completes, and any valid RID included but not already registered as a complete on Marketplace will be changed to a complete. Reconciliation will not take place immediately, and can take some time to take effect. This call can be done multiple times, with the latest call overriding the previous reconciliations.

Please note that a survey must be in Complete Status in order to Reconcile. (SurveyStatusCode: 04)

Arguments

Property Type Required Description
ResponseIDs array true A list of all RIDs that should be completes. Any RIDs omitted from this list will be changed to a terminate.

Qualifications

The Qualifications resource allows the buyer to create new qualifications on an existing survey, update existing qualifications, and retrieve survey qualifications. These qualifications make up the Marketplaceprescreener and define the overall survey targeting criteria for suppliers.

Qualifications Model

Property Type Description
Qualifications array Contains an array of elements described below.
Name string Name of the qualification. Maximum length of 3000. Visible as the “Description” field in the UI.
QuestionID int Unique number associated with the question.
LogicalOperator string Defines the logical operation applied to the conditions (OR, AND, or NOT).
NumberOfRequiredConditions int Indicates the number of conditions that must be selected by the respondent to proceed.
IsActive boolean false if the qualification has effectively been deleted.
PreCodes array of strings Qualification answer option identifiers.

POST Create a Qualification

Definition

POST  https://api.samplicio.us/Demand/v1/SurveyQualifications/Create/{SurveyNumber}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X POST --data '{"Name": "STANDARD_RELATIONSHIP","QuestionID": 632,"LogicalOperator": "OR","NumberOfRequiredConditions": 1,"IsActive": true,"PreCodes": ["1"], "Order": 7}' https://api.samplicio.us/Demand/v1/SurveyQualifications/Create/{SurveyNumber}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SurveyQualifications/Create/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Post.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {
    Name: "STANDARD_RELATIONSHIP",
    QuestionI: 632,
    LogicalOperator: "OR",
    NumberOfRequiredConditions: 1,
    IsActive: true,
    PreCodes: [
        "1"
    ],
    Order: 7
}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{
    "Name": "STANDARD_RELATIONSHIP",
    "QuestionID": 632,
    "LogicalOperator": "OR",
    "NumberOfRequiredConditions": 1,
    "IsActive": true,
    "PreCodes": [
        "1"
    ],
    "Order": 7
}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SurveyQualifications/Create/{SurveyNumber}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>

import requests, json

url = 'https://api.samplicio.us/Demand/v1/SurveyQualifications/Create/{SurveyNumber}'
params = {
    "Name": "STANDARD_RELATIONSHIP",
    "QuestionID": 632,
    "LogicalOperator": "OR",
    "NumberOfRequiredConditions": 1,
    "IsActive": True,
    "PreCodes": [
        "1"
    ],
    "Order": 7
}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.post(url, data=data, headers=headers)
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SurveyQualifications/Create/{SurveyNumber}");

string args = @"{
                  ""Name"": ""STANDARD_RELATIONSHIP"",
                  ""QuestionID"": 632,
                  ""LogicalOperator"": ""OR"",
                  ""NumberOfRequiredConditions"": 1,
                  ""IsActive"": true,
                  ""PreCodes"": [""1""],
                  ""Order"": 7
                }";

request.Method = "POST";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "POST",
  "hostname": "api.samplicio.us",
  "port": 443,
  "path": "/Demand/v1/SurveyQualifications/Create/{SurveyNumber}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
    }
};

var json = {
    "Name": "STANDARD_RELATIONSHIP",
    "QuestionID": 632,
    "LogicalOperator": "OR",
    "NumberOfRequiredConditions": 1,
    "IsActive": true,
    "PreCodes": [
        "1"
    ],
    "Order": 7
};

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: CreateSurveyQualificationFromModel successful."
  ],
  "ResultCount": 7,
  "Qualifications": [
    {
      "Name": "AGE",
      "QuestionID": 42,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 1,
      "IsActive": true,
      "Order": 1,
      "PreCodes": [
        "18",
        "19",
        "20",
        "21",
        "22",
        "23",
        "24",
        "25"
      ]
    },
    {
      "Name": "GENDER",
      "QuestionID": 43,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 0,
      "IsActive": true,
      "Order": 3,
      "PreCodes": [
        "1",
        "2"
      ]
    },
    {
      "Name": "ZIP",
      "QuestionID": 45,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 0,
      "IsActive": true,
      "Order": 2,
      "PreCodes": []
    },
    {
      "Name": "HISPANIC",
      "QuestionID": 47,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 1,
      "IsActive": true,
      "Order": 4,
      "PreCodes": [
        "1",
        "10",
        "11",
        "12",
        "13",
        "14",
        "2",
        "3",
        "4",
        "5",
        "6",
        "7",
        "8",
        "9"
      ]
    },
    {
      "Name": "ETHNICITY",
      "QuestionID": 113,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 1,
      "IsActive": true,
      "Order": 5,
      "PreCodes": [
        "1",
        "2",
        "3"
      ]
    },
    {
      "Name": "STANDARD_RELATIONSHIP",
      "QuestionID": 632,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 1,
      "IsActive": true,
      "Order": 7,
      "PreCodes": [
        "1"
      ]
    },
    {
      "Name": "STANDARD_HHI",
      "QuestionID": 61076,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 0,
      "IsActive": true,
      "Order": 6,
      "PreCodes": [
        "1",
        "10",
        "11",
        "12",
        "13",
        "14",
        "15",
        "16",
        "17",
        "18",
        "19",
        "2",
        "20",
        "21",
        "22",
        "23",
        "24",
        "25",
        "26",
        "27",
        "3",
        "4",
        "5",
        "6",
        "7",
        "8",
        "9"
      ]
    }
  ]
}

Creates qualification and conditions for an existing Marketplace survey.

Arguments

Property Type Description
SurveyNumber int Unique number associated with the survey.
Name string Name of the qualification. Maximum 32 characters.
QuestionID int Unique number associated with the question.
LogicalOperator string Defines the logical operation applied to the conditions.
NumberOfRequiredConditions int Indicates the number of conditions that must be selected by the respondent to proceed.
IsActive boolean Indicates if the qualification is active or inactive. Inactive effectively is the same as deleted.
PreCodes array of strings Qualification answer option identifiers.
Order int Determines qualification order in the prescreener

PUT Update a Qualification

Definition

PUT  https://api.samplicio.us/Demand/v1/SurveyQualifications/Update/{SurveyNumber}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X PUT --data '{"Name": "STANDARD_RELATIONSHIP","QuestionID": 632,"LogicalOperator": "OR",NumberOfRequiredConditions": 1,"IsActive": true,"PreCodes": ["2"],"Order": 7}' https://api.samplicio.us/Demand/v1/SurveyQualifications/Update/{SurveyNumber}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SurveyQualifications/Update/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Put.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {
    Name: "STANDARD_RELATIONSHIP",
    QuestionID: 632,
    LogicalOperator: "OR",
    NumberOfRequiredConditions: 1,
    IsActive: true,
    PreCodes: [
        "2"
    ],
    Order: 7
}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{
    "Name": "STANDARD_RELATIONSHIP",
    "QuestionID": 632,
    "LogicalOperator": "OR",
    "NumberOfRequiredConditions": 1,
    "IsActive": true,
    "PreCodes": [
        "2"
    ],
    "Order": 7
}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SurveyQualifications/Update/{SurveyNumber}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>

import requests, json

url = 'https://api.samplicio.us/Demand/v1/SurveyQualifications/Update/{SurveyNumber}'
params = {
    "Name": "STANDARD_RELATIONSHIP",
    "QuestionID": 632,
    "LogicalOperator": "OR",
    "NumberOfRequiredConditions": 1,
    "IsActive": True,
    "PreCodes": [
        "2"
    ],
    "Order": 7
}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.put(url, data=data, headers=headers)
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SurveyQualifications/Update/{SurveyNumber}");

string args = @"{
                    ""Name"": ""STANDARD_RELATIONSHIP"",
                    ""QuestionID"": 632,
                    ""LogicalOperator"": ""OR"",
                    ""NumberOfRequiredConditions"": 1,
                    ""IsActive"": true,
                    ""PreCodes"": [""2""],
                    ""Order"": 7
                }";

request.Method = "PUT";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "PUT",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SurveyQualifications/Update/{SurveyNumber}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
    }
};

var json = {
    "Name": "STANDARD_RELATIONSHIP",
    "QuestionID": 632,
    "LogicalOperator": "OR",
    "NumberOfRequiredConditions": 1,
    "IsActive": true,
    "PreCodes": [
        "2"
    ],
    "Order": 7
};

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: UpdateSurveyQualificationFromModel successful."
  ],
  "ResultCount": 7,
  "Qualifications": [
    {
      "Name": "AGE",
      "QuestionID": 42,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 1,
      "IsActive": true,
      "Order": 1,
      "PreCodes": [
        "18",
        "19",
        "20",
        "21",
        "22",
        "23",
        "24",
        "25"
      ]
    },
    {
      "Name": "GENDER",
      "QuestionID": 43,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 0,
      "IsActive": true,
      "Order": 3,
      "PreCodes": [
        "1",
        "2"
      ]
    },
    {
      "Name": "ZIP",
      "QuestionID": 45,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 0,
      "IsActive": true,
      "Order": 2,
      "PreCodes": []
    },
    {
      "Name": "HISPANIC",
      "QuestionID": 47,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 1,
      "IsActive": true,
      "Order": 4,
      "PreCodes": [
        "1",
        "10",
        "11",
        "12",
        "13",
        "14",
        "2",
        "3",
        "4",
        "5",
        "6",
        "7",
        "8",
        "9"
      ]
    },
    {
      "Name": "ETHNICITY",
      "QuestionID": 113,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 1,
      "IsActive": true,
      "Order": 5,
      "PreCodes": [
        "1",
        "2",
        "3"
      ]
    },
    {
      "Name": "STANDARD_RELATIONSHIP",
      "QuestionID": 632,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 1,
      "IsActive": true,
      "Order": 7,
      "PreCodes": [
        "2"
      ]
    },
    {
      "Name": "STANDARD_HHI",
      "QuestionID": 61076,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 0,
      "IsActive": true,
      "Order": 6,
      "PreCodes": [
        "1",
        "10",
        "11",
        "12",
        "13",
        "14",
        "15",
        "16",
        "17",
        "18",
        "19",
        "2",
        "20",
        "21",
        "22",
        "23",
        "24",
        "25",
        "26",
        "27",
        "3",
        "4",
        "5",
        "6",
        "7",
        "8",
        "9"
      ]
    }
  ]
}

Updates existing qualifications for a Marketplace survey.

Arguments

Property Type Description
SurveyNumber int Unique number associated with the survey.
Name string Name of the qualification. Maximum 32 characters.
QuestionID int Unique number associated with the question.
LogicalOperator string Defines the logical operation applied to the conditions.
NumberOfRequiredConditions int Indicates the number of conditions that must be selected by the respondent to proceed.
IsActive boolean Indicates if the qualification is active or inactive. Inactive effectively is the same as deleted.
PreCodes array of strings Qualification answer option identifiers.
Order int Determines qualification order in the prescreener

GET List Qualifications

Definition

GET  https://api.samplicio.us/Demand/v1/SurveyQualifications/BySurveyNumber/{SurveyNumber}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Demand/v1/SurveyQualifications/BySurveyNumber/{SurveyNumber}
require 'net/http'

uri = URI('https://api.samplicio.us/Demand/v1/SurveyQualifications/BySurveyNumber/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Demand/v1/SurveyQualifications/BySurveyNumber/{SurveyNumber}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Demand/v1/SurveyQualifications/BySurveyNumber/{SurveyNumber}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SurveyQualifications/BySurveyNumber/{SurveyNumber}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SurveyQualifications/BySurveyNumber/{SurveyNumber}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetSurveyQualificationsBySurveyNumber successful."
  ],
  "ResultCount": 6,
  "Qualifications": [
    {
      "Name": "AGE",
      "QuestionID": 42,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 1,
      "IsActive": true,
      "Order": 1,
      "PreCodes": [
        "18",
        "19",
        "20",
        "21",
        "22",
        "23",
        "24",
        "25"
      ]
    },
    {
      "Name": "GENDER",
      "QuestionID": 43,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 0,
      "IsActive": true,
      "Order": 3,
      "PreCodes": [
        "1",
        "2"
      ]
    },
    {
      "Name": "ZIP",
      "QuestionID": 45,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 0,
      "IsActive": true,
      "Order": 2,
      "PreCodes": []
    },
    {
      "Name": "HISPANIC",
      "QuestionID": 47,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 1,
      "IsActive": true,
      "Order": 4,
      "PreCodes": [
        "1",
        "10",
        "11",
        "12",
        "13",
        "14",
        "2",
        "3",
        "4",
        "5",
        "6",
        "7",
        "8",
        "9"
      ]
    },
    {
      "Name": "ETHNICITY",
      "QuestionID": 113,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 1,
      "IsActive": true,
      "Order": 5,
      "PreCodes": [
        "1",
        "2",
        "3"
      ]
    },
    {
      "Name": "STANDARD_HHI",
      "QuestionID": 61076,
      "LogicalOperator": "OR",
      "NumberOfRequiredConditions": 0,
      "IsActive": true,
      "Order": 6,
      "PreCodes": [
        "1",
        "10",
        "11",
        "12",
        "13",
        "14",
        "15",
        "16",
        "17",
        "18",
        "19",
        "2",
        "20",
        "21",
        "22",
        "23",
        "24",
        "25",
        "26",
        "27",
        "3",
        "4",
        "5",
        "6",
        "7",
        "8",
        "9"
      ]
    }
  ]
}

Returns a list of all qualifications associated with a survey.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.

Quotas

Quotas are used to specify how many respondents of a desired demographic type are allowed to complete the survey. Quotas must be built off of qualifications.

There is a limit of 1,000 Quotas per survey, which can be checked by using the “ResultCount” parameter on the List Quotas call. This is a combination of one Total Quota and up to 999 subquotas. The Total Quota is set using the “Quota” parameter in the Surveys model.

Quotas Model

Property Type Description
SurveyQuotaID int Unique ID associated with the quota.
Name string Name associated with the quota. Maximum length of 64.
FieldTarget int Field Target associated with the quota.
Quota int Quota number for the specified quota.
Prescreens int Number of prescreens achieved. A prescreen is a respondent who enters the client survey.
Completes int Number of completes achieved.
IsActive boolean Indicates if the quotas is active or inactive. Should the quota be enforced on this project?
Conditions array Contains an array of Conditions models described below

Conditions Model

Note that each quota may only contain up to 100,000 precodes spread across all its conditions.

Property Type Description
QuestionID int QuestionID(s) that the quota is based upon
PreCodes array of strings Qualification answer option precodes defined by the API Standard

POST Create a Quota

Definition

POST https://api.samplicio.us/Demand/v1/SurveyQuotas/Create/{SurveyNumber}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X POST --data '{"Name": "Quota Name", "Quota": 50, "IsActive":true, "Conditions":[{"QuestionID":42, "PreCodes": ["18","19","20","21","22"] }]}' https://api.samplicio.us/Demand/v1/SurveyQuotas/Create/{SurveyNumber}
require 'net/http'
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SurveyQuotas/Create/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Post.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {Name: "Quota Name", Quota: 50, IsActive:true, Conditions:[{QuestionID:42, PreCodes: ["18","19","20","21","22"] }]}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{"Name": "Quota Name", "Quota": 50, "IsActive":true, "Conditions":[{"QuestionID":42, "PreCodes": ["18","19","20","21","22"] }]}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SurveyQuotas/Create/{SurveyNumber}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>
import requests, json

url = 'https://api.samplicio.us/Demand/v1/SurveyQuotas/Create/{SurveyNumber}'
params = {'Name': 'Quota Name', 'Quota': 50, 'IsActive': True, 'Conditions':[{'QuestionID':42, 'PreCodes': ['18','19','20','21','22'] }]}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.post(url, data=data, headers=headers)
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SurveyQuotas/Create/{SurveyNumber}");

string args = @"{
                ""Name"": ""Quota Name"",
                 ""Quota"": 50,
                 ""IsActive"": true,
                 ""Conditions"":[{
                                  ""QuestionID"":42,
                                  ""PreCodes"": [""18"",""19"",""20"",""21"",""22""]
                                }]
              }";

request.Method = "POST";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "POST",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SurveyQuotas/Create/{SurveyNumber}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'}
};

var json = {
  "Name": "Quota Name",
  "Quota": 50,
  "IsActive": true,
  "Conditions":
  [
    {
      "QuestionID": 42,
      "PreCodes": [
        "18",
        "19",
        "20",
        "21",
        "22",
      ]
    }
  ]
};


var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: CreateSurveyQuotaFromModel successful."
  ],
  "ResultCount": 2,
  "Quotas": [
    {
      "SurveyQuotaID": 0001100,
      "Name": "Total",
      "SurveyQuotaType": "Total",
      "FieldTarget": 100,
      "Quota": 100,
      "Prescreens": 0,
      "Completes": 0,
      "IsActive": true,
      "Conditions": null
    },
    {
      "SurveyQuotaID": 1000110,
      "Name": "Quota Name",
      "SurveyQuotaType": "Client",
      "FieldTarget": 50,
      "Quota": 50,
      "Prescreens": 0,
      "Completes": 0,
      "IsActive": true,
      "Conditions": [
        {
          "QuestionID": 42,
          "PreCodes": [
            "18",
            "19",
            "20",
            "21",
            "22",
          ]
        },

      ]
    }
  ]
}

Creates Quota based on specified questionIDs.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
Name string true Name associated with the quota. Maximum 64 characters.
FieldTarget int true Field Target associated with the quota.
Quota int true Quota number for the specified quota.
IsActive boolean true Should the quota be enforced on this project?
SurveyQuotaType string false Indicates quota type (Client or Total).
Conditions array true Indicates conditions associated with quota (by questionID and precodes).

PUT Update a Quota

Definition

PUT  https://api.samplicio.us/Demand/v1/SurveyQuotas/Update/{SurveyNumber}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X PUT  --data '{"SurveyQuotaID": 1000110,"Name": "Quota Name", "FieldTarget":1000, "Quota": 50, "IsActive":true, "Conditions":[{"QuestionID":42, "Precodes": ["18","19","20","21","22"] }]}'  https://api.samplicio.us/Demand/v1/SurveyQuotas/Update/{SurveyNumber}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SurveyQuotas/Update/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Put.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {SurveyQuotaID: 1000110, Name: "Quota Name", FieldTarget:1000, Quota: 50, IsActive:true, Conditions:[{QuestionID:42, PreCodes: [18, 19, 20, 21, 22] }]}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{"SurveyQuotaID": 1000110, "Name": "Quota Name", "FieldTarget":1000, "Quota": 50, "IsActive":true, "Conditions":[{"QuestionID":42, "PreCodes": ["18","19","20","21","22"] }]}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SurveyQuotas/Update/{SurveyNumber}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>
import requests, json

url = 'https://api.samplicio.us/Demand/v1/SurveyQuotas/Update/{SurveyNumber}'
params = {'SurveyQuotaID': 1000110, 'Name': "Quota Name", 'FieldTarget':1000, 'Quota': 50, 'IsActive': True, 'Conditions':[{'QuestionID':42, 'PreCodes': ['18','19','20','21','22'] }]}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

updateQuotas = requests.put(url, data=data, headers=headers)
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SurveyQuotas/Update/{SurveyNumber}");

string args = @"{
                ""SurveyQuotaID"": 1000110,
                 ""Name"": ""Quota Name"",
                 ""FieldTarget"":1000,
                 ""Quota"": 50,
                 ""IsActive"": true,
                 ""Conditions"":[{
                                  ""QuestionID"":42,
                                  ""PreCodes"": [""18"",""19"",""20"",""21"",""22""]
                                }]
               }";

request.Method = "PUT";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "PUT",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SurveyQuotas/Update/{SurveyNumber}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {
  "SurveyQuotaID": 0001100,
  "Name": "Quota Name",
  "FieldTarget": 50,
  "Quota": 50,
  "IsActive": true,
  "Conditions": [
    {
      "QuestionID": 42,
      "PreCodes": [
        "18",
        "19"
      ]
    },
  ]
};

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: CreateSurveyQuotaFromModel successful."
  ],
  "ResultCount": 2,
  "Quotas": [
    {
      "SurveyQuotaID": 0001100,
      "Name": "Total",
      "SurveyQuotaType": "Total",
      "FieldTarget": 100,
      "Quota": 100,
      "Prescreens": 0,
      "Completes": 0,
      "IsActive": true,
      "Conditions": null
    },
    {
      "SurveyQuotaID": 1000110,
      "Name": "Quota Name",
      "SurveyQuotaType": "Client",
      "FieldTarget": 50,
      "Quota": 50,
      "Prescreens": 0,
      "Completes": 0,
      "IsActive": true,
      "Conditions": [
        {
          "QuestionID": 42,
          "PreCodes": [
            "18",
            "19",
            "20",
            "21",
            "22",
          ]
        },
      ]
    }
  ]
}

Updates a quota’s size, conditions, and other parameters.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
Name string true Name associated with the quota. Maximum length of 64.
SurveyQuotaID int true Unique ID associated with the quota.
FieldTarget int true Field Target associated with the quota.
Quota int true Quota number for the specified quota.
IsActive boolean true Should the quota be enforced on this project?
SurveyQuotaType string false Indicates quota type (Client or Total).
Conditions array true Indicates conditions associated with quota (by questionID and precodes).

GET List Quotas

Definition

GET  https://api.samplicio.us/Demand/v1/SurveyQuotas/BySurveyNumber/{SurveyNumber}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Demand/v1/SurveyQuotas/BySurveyNumber/{SurveyNumber}
require 'net/http'

uri = URI('https://api.samplicio.us/Demand/v1/SurveyQuotas/BySurveyNumber/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Demand/v1/SurveyQuotas/BySurveyNumber/{SurveyNumber}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Demand/v1/SurveyQuotas/BySurveyNumber/{SurveyNumber}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SurveyQuotas/BySurveyNumber/{SurveyNumber}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SurveyQuotas/BySurveyNumber/{SurveyNumber}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: SurveyQualifiedRespondentsBySurveyNumberSupplierCode successful."
  ],
 "ResultCount": 2,
  "Quotas": [
    {
      "SurveyQuotaID": 0001000,
      "Name": "Total",
      "SurveyQuotaType": "Total",
      "FieldTarget": 100,
      "Quota": 100,
      "Prescreens": 0,
      "Completes": 0,
      "IsActive": true,
      "Conditions": null
    },
    {
      "SurveyQuotaID": 0101010,
      "Name": "Age Quota",
      "SurveyQuotaType": "Client",
      "FieldTarget": 40,
      "Quota": 40,
      "Prescreens": 0,
      "Completes": 0,
      "IsActive": true,
      "Conditions": [
        {
          "QuestionID": 42,
          "PreCodes": [
            "18",
            "19",
            "20",
            "24",
            "25"
          ]
        }
      ]
    }

Returns the list of quotas associated with the specified survey.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.

Marketplace Templates

The Marketplace Templates resource returns all Marketplace Templates associated with an existing account as well as apply an existing Marketplace template to a survey. An Marketplace Template must first be created in the Marketplace UI. A Marketplace Template allows a buyer to quickly add a commonly used Monetization blend.

Marketplace Templates Model

Property Type Description
ID int ID associated with the Marketplace Template.
AccountID int Unique account identifier.
Name string Marketplace Template Name. Maximum length of 255.
ExchangeAllocationPercentage double Percentage of total completes allocated only to the Exchange, expressed as a decimal from 0 to 1.
ExchangeIsHedgeAccess boolean true gives the Lucid Marketplace access to any unallocated completes. true is recommended when using Lucid Marketplace.
IsGlobalTemplate boolean Should always return false indicating the template is only available to the buyers account.

Supplier Groups Model

Property Type Description
ID int ID associated with the Marketplace Template.
Name string Marketplace Template Name. Maximum length of 255.
SupplierGroupDisplayTypeID int Indicates if the group is the “blocked” group or not. 1 = unblocked. 2 = blocked.
Completes int Number of completes gained by the group.
Screens int Number of prescreens gained by the group.
AllocationPercentage double Percentage of total completes allocated only to the Marketplace group, expressed as a decimal from 0 to 1.
IsHedgeAccess boolean true gives the Marketplace group access to any unallocated completes.
CPI int Will return null as CPI can’t be set via an Marketplace Template.
Suppliers array Contains array of elements described below.

Suppliers Model

Property Type Description
SupplierID int ID associated with the supplier account.
Completes int Number of completes gained by the supplier.
Screens string Number of prescreens gained by the supplier.

GET List Marketplace Templates

Definition

GET  https://api.samplicio.us/Demand/v1/ExchangeTemplates/GetAll

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Demand/v1/ExchangeTemplates/GetAll
require 'net/http'

uri = URI('https://api.samplicio.us/Demand/v1/ExchangeTemplates/GetAll')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Demand/v1/ExchangeTemplates/GetAll";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Demand/v1/ExchangeTemplates/GetAll'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/ExchangeTemplates/GetAll");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/ExchangeTemplates/GetAll",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetAllExchangeTemplates successful."
  ],
  "ResultCount": 2,
  "ExchangeTemplates": [
  {
      "ID": 1,
      "AccountID": 1,
      "Name": "ExchangeTemplate1",
      "ExchangeAllocationPercentage": 0,
      "ExchangeIsHedgeAccess": true,
      "IsGlobalTemplate": true
    },
    {
      "ID": 2,
      "AccountID": 1,
      "Name": "ExchangeTemplate2",
      "ExchangeAllocationPercentage": 0.4,
      "ExchangeIsHedgeAccess": true,
      "IsGlobalTemplate": false
    }
  ]
}

Returns all Marketplace templates associated with an existing account.

POST Apply a Marketplace Template

Definition

POST  https://api.samplicio.us/Demand/v1/ExchangeTemplates/ApplyToSurvey/{SurveyNumber}/{ExchangeTemplateID}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X POST https://api.samplicio.us/Demand/v1/ExchangeTemplates/ApplyToSurvey/{SurveyNumber}/{ExchangeTemplateID}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/ExchangeTemplates/ApplyToSurvey/{SurveyNumber}/{ExchangeTemplateID}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Post.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/ExchangeTemplates/ApplyToSurvey/{SurveyNumber}/{ExchangeTemplateID}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
));

$response = curl_exec($curl);

curl_close($curl);
?>

import requests, json

url = 'https://api.samplicio.us/Demand/v1/ExchangeTemplates/ApplyToSurvey/{SurveyNumber}/{ExchangeTemplateID}'
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.post(url, headers=headers)
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/ExchangeTemplates/ApplyToSurvey/{SurveyNumber}/{ExchangeTemplateID}");

request.Method = "POST";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "POST",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/ExchangeTemplates/ApplyToSurvey/{SurveyNumber}/{ExchangeTemplateID}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: ApplyExchangeTemplateToSurvey successful."
  ],
  "ResultCount": 1,
  "SupplierGroups": [
    {
      "ID": 1234,
      "Name": "Group 1",
      "SupplierGroupDisplayTypeID": 1,
      "Completes": 0,
      "Screens": 0,
      "AllocationPercentage": 0,
      "IsHedgeAccess": false,
      "CPI": null,
      "Suppliers": [
        {
          "SupplierID": 1,
          "Completes": 0,
          "Screens": 0
        },
        {
          "SupplierID": 2,
          "Completes": 0,
          "Screens": 0
        },
        {
          "SupplierID": 3,
          "Completes": 0,
          "Screens": 0
        },
        {
          "SupplierID": 4,
          "Completes": 0,
          "Screens": 0
        }
      ]
    }
  ]
}

Applies the specified Marketplace Template to an existing survey.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
ID int true ID associated with the Marketplace Template.

Marketplace Groups

Marketplace Groups allow buyers to allocate completes to a specific group of suppliers. Marketplace Groups contain a hedge property, which allows suppliers from Marketplace Groups to also have access to unallocated completes.

POST Create a Group

Definition

POST  https://api.samplicio.us/Demand/v1/SupplierGroups/CreateWithSuppliers/{SurveyNumber}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X POST --data '{"SurveyNumber": 101100,"Name":"Top Supplier Group", "AllocationPercentage": 0.10,"IsHedgeAccess": true, "Suppliers": [{"SupplierCode":"0001"}]}' https://api.samplicio.us/Demand/v1/SupplierGroups/CreateWithSuppliers/{SurveyNumber}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SupplierGroups/CreateWithSuppliers/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Post.new(FullUriPath, initheader = {'Content-Type' => 'application/json'})

request.body = {SurveyNumber: 101100, Name:"Top Supplier Group", AllocationPercentage: 0.10, IsHedgeAccess: true, "Suppliers": [{"SupplierCode":"0001"}]}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$curl = curl_init();

$params = '{"SurveyNumber": 101100, "Name":"Top Supplier Group", "AllocationPercentage": 0.10, "IsHedgeAccess": true, "Suppliers": [{"SupplierCode":"0001"}]}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SupplierGroups/CreateWithSuppliers/{SurveyNumber}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>
import requests

url = 'https://api.samplicio.us/Demand/v1/SupplierGroups/CreateWithSuppliers/{SurveyNumber}'
params = {'SurveyNumber': 101100, 'Name':'Top Supplier Group', 'AllocationPercentage': 0.10, 'IsHedgeAccess': True, 'Suppliers': [{'SupplierCode':'1010'}]}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}
response = requests.post(url, data=data, headers=headers)

using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SupplierGroups/CreateWithSuppliers/{SurveyNumber}");

string args = @"{
                 ""SurveyNumber"": 101100,
                 ""Name"":""Top Supplier Group"",
                 ""AllocationPercentage"": 0.10,
                 ""IsHedgeAccess"": true,
                 ""Suppliers"": [{
                                  ""SupplierCode"":""1010""
                                }]
                }";

request.Method = "POST";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();

const https = require('https');

var options = {
  "method": "POST",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SupplierGroups/CreateWithSuppliers/{SurveyNumber}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {"SurveyNumber": 101100,
  "Name":"Top Supplier Group",
  "AllocationPercentage": 0.10,
  "IsHedgeAccess": true,
  "Suppliers": [
    {
    "SupplierCode":"1010"
    }
  ]
}

var params = JSON.stringify(json);

var request = https.request(options, function (createGroup) {
  var chunks = [];

  createGroup.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: CreateSupplierGroupFromModel successful."
  ],
  "ResultCount": 1,
  "SupplierGroup": {
    "ID": 201967,
    "Name": "Top Supplier Group",
    "Completes": 0,
    "Screens": 0,
    "AllocationPercentage": 0.1,
    "CPI": null,
    "IsHedgeAccess": true,
    "Suppliers": [
      {
        "SupplierCode": "1010",
        "Completes": 0,
        "Screens": 0
      }
    ]
  }
}

Creates a group with specific suppliers and allocation for that group.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
Name string true Supplier Group name. Maximum 64 characters.
AllocationPercentage double true Group reserved allocation, expressed as a decimal percentage from 0 to 1.
IsHedgeAccess boolean true Access to unallocated completes on Lucid Marketplace.
Suppliers array true An array of all supplier codes (strings).
CPI double false The payout per complete for the group (defaults to survey QCPI).

POST Create an Empty Group

Definition

POST  https://api.samplicio.us/Demand/v1/SupplierGroups/Create/{SurveyNumber}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X POST --data '{"SurveyNumber": 101100,"Name":"Top Supplier Group", "AllocationPercentage": 0.10,"IsHedgeAccess": true}' https://api.samplicio.us/Demand/v1/SupplierGroups/Create/{SurveyNumber}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SupplierGroups/Create/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Post.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {SurveyNumber: 101100, Name:"Top Supplier Group", AllocationPercentage: 0.10, IsHedgeAccess: true}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{"SurveyNumber": 101100,"Name":"Top Supplier Group", "AllocationPercentage": 0.10,"IsHedgeAccess": true}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SupplierGroups/Create/{SurveyNumber}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>
import requests, json

url = 'https://api.samplicio.us/Demand/v1/SupplierGroups/Create/{SurveyNumber}'
params = {'SurveyNumber': 101100,'Name':'Top Supplier Group', 'AllocationPercentage': 0.10,'IsHedgeAccess': True}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.post(url, data=data, headers=headers)

using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SupplierGroups/Create/{SurveyNumber}");

string args = @"{
                 ""SurveyNumber"": 101100,
                 ""Name"":""Top Supplier Group"",
                 ""AllocationPercentage"": 0.10,
                 ""IsHedgeAccess"": true
                }";

request.Method = "POST";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "POST",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SupplierGroups/Create/{SurveyNumber}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {"SurveyNumber": 101100,
  "Name":"Top Supplier Group",
  "AllocationPercentage": 0.10,
  "IsHedgeAccess": true,
  }

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: CreateSupplierGroupFromModel successful."
  ],
  "ResultCount": 1,
  "SupplierGroup": {
    "ID": 000110,
    "Name": "Top Supplier Group",
    "Completes": 0,
    "Screens": 0,
    "AllocationPercentage": 0,
    "CPI": null,
    "IsHedgeAccess": true,
    "Suppliers": []
  }
}

Creates an empty supplier group with a specific allocation and name.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
Name string true Supplier Group name. Maximum 64 characters.
AllocationPercentage double true Group reserved allocation, expressed as a decimal percentage from 0 to 1.
IsHedgeAccess boolean false Access to unallocated completes on Lucid Marketplace.
CPI double false The payout per complete for the group (defaults to survey QCPI).

PUT Update a Group

Definition

PUT  https://api.samplicio.us/Demand/v1/SupplierGroups/Update/{SurveyNumber}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X PUT --data '{"ID": 1234, "SurveyNumber": 001100,"Name":"Top Supplier Group", "AllocationPercentage": 0.10,"IsHedgeAccess": true}' https://api.samplicio.us/Demand/v1/SupplierGroups/Update/{SurveyNumber}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SupplierGroups/Update/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Put.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {ID: 1234, SurveyNumber: 101100, Name:"Top Supplier Group",AllocationPercentage: 0.10, IsHedgeAccess: true}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{"ID": 1234,"SurveyNumber": 101100,"Name":"Top Supplier Group", "AllocationPercentage": 0.10,"IsHedgeAccess": true}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SupplierGroups/Update/{SurveyNumber}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>
import requests, json

url = 'https://api.samplicio.us/Demand/v1/SupplierGroups/Update/{SurveyNumber}'
params = {'ID': 1234,'SurveyNumber': 101100,'Name':'Top Supplier Group', 'AllocationPercentage': 0.10,'IsHedgeAccess': True}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.put(url, data=data, headers=headers)

using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SupplierGroups/Update/{SurveyNumber}");

string args = @"{
                 ""ID"": 1234,
                 ""SurveyNumber"": 101100,
                 ""Name"":""Top Supplier Group"",
                 ""AllocationPercentage"": 0.10,
                 ""IsHedgeAccess"": true
                }";

request.Method = "PUT";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "PUT",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SupplierGroups/Create/{SurveyNumber}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {"ID": 1234,
  "SurveyNumber": 101100,
  "Name":"Top Supplier Group",
  "AllocationPercentage": 0.10,
  "IsHedgeAccess": true,
  }

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: UpdateSupplierGroupFromModel successful."
  ],
  "ResultCount": 1,
  "SupplierGroup": {
    "ID": 000001,
    "Name": "Top Supplier Group",
    "Completes": 0,
    "Screens": 0,
    "AllocationPercentage": 0.15,
    "CPI": null,
    "IsHedgeAccess": true,
    "Suppliers": []
  }
}

Updates a supplier group with the specified values.

Arguments

Property Type Required Description
ID int true Unique ID associated with the group.
SurveyNumber int true Unique number associated with the survey.
Name string true Supplier Group name. Maximum 64 characters.
AllocationPercentage double true Group reserved allocation, expressed as a decimal percentage from 0 to 1.
IsHedgeAccess boolean true Access to unallocated completes on Lucid Marketplace.
CPI double false The payout per complete for the group (defaults to survey QCPI).

DELETE Delete a Group

Definition

DELETE  https://api.samplicio.us/Demand/v1/SupplierGroups/Delete/{SurveyNumber}/{SupplierGroupID}

Example Request

curl  -H "Authorization: YOUR_API_KEY_HERE" -X DELETE https://api.samplicio.us/Demand/v1/SupplierGroups/Delete/{SurveyNumber}/{SupplierGroupID}
require 'net/http'

uri = URI('https://api.samplicio.us/Demand/v1/SupplierGroups/Delete/{SurveyNumber}/{SupplierGroupID}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Delete.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SupplierGroups/Delete/{SurveyNumber}/{SupplierGroupID}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_POSTFIELDS => "",
));

curl_exec($curl);
curl_close($curl);
?>
import requests

url = 'https://api.samplicio.us/Demand/v1/SupplierGroups/Delete/{SurveyNumber}/{SupplierGroupID}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.delete(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SupplierGroups/Delete/{SurveyNumber}/{SupplierGroupID}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

request.Method = "DELETE";

request.GetResponse();
const https = require('https');

var options = {
  "method": "DELETE",
  "hostname": "api.samplicio.us",
  "port": 443,
  "path": "/Demand/v1/SupplierGroups/Delete/{SurveyNumber}/{SupplierGroupID}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options);

request.end();

Deletes the specified supplier group.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
SupplierGroupID int true Unique ID for Supplier Group.

POST Add to a Group

Definition

POST  https://api.samplicio.us/Demand/v1/SupplierGroups/AddSuppliersToGroup/{SurveyNumber}/{SupplierGroupID}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X POST --data '{"SupplierCode":"0010"}' https://api.samplicio.us/Demand/v1/SupplierGroups/AddSuppliersToGroup/{SurveyNumber}/{SupplierGroupID}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SupplierGroups/AddSuppliersToGroup/{SurveyNumber}/{SupplierGroupID}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Post.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {SupplierCode: 1010}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{"SupplierCode": 1010}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SupplierGroups/AddSuppliersToGroup/{SurveyNumber}/{SupplierGroupID}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>
import requests, json

url = 'https://api.samplicio.us/Demand/v1/SupplierGroups/AddSuppliersToGroup/{SurveyNumber}/{SupplierGroupID}'
params = {'SupplierCode': 1010}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.post(url, data=data, headers=headers)

using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SupplierGroups/AddSuppliersToGroup/{SurveyNumber}/{SupplierGroupID}");

string args = @"{""SupplierCode"": 1010}";

request.Method = "POST";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "POST",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SupplierGroups/AddSuppliersToGroup/{SurveyNumber}/{SupplierGroupID}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {"SupplierCode": 1010}

var params = JSON.stringify(json);

var request = https.request(options, function (createGroupEmpty) {
  var chunks = [];

  createGroupEmpty.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: AddSupplierGroupSuppliersToSupplierGroup successful."
  ],
  "ResultCount": 1,
  "SupplierGroup": {
    "ID": 201967,
    "Name": "Top Supplier Group",
    "Completes": 0,
    "Screens": 0,
    "AllocationPercentage": 0.1,
    "CPI": null,
    "IsHedgeAccess": true,
    "Suppliers": [
      {
        "SupplierCode": "1010",
        "Completes": 0,
        "Screens": 0
      },
     ]
  }
}

Adds suppliers to the specified supplier group.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
SupplierGroupID int true Unique ID for Supplier Group.

GET Show a Group

Definition

GET  https://api.samplicio.us/Demand/v1/SupplierGroups/BySurveyNumber/{SurveyNumber}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Demand/v1/SupplierGroups/BySurveyNumber/{SurveyNumber}
require 'net/http'

uri = URI('https://api.samplicio.us/Demand/v1/SupplierGroups/BySurveyNumber/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Demand/v1/SupplierGroups/BySurveyNumber/{SurveyNumber}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Demand/v1/SupplierGroups/BySurveyNumber/{SurveyNumber}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SupplierGroups/BySurveyNumber/{SurveyNumber}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SupplierGroups/BySurveyNumber/{SurveyNumber}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetAllWithSuppliersBySurveyNumber successful."
  ],
  "ResultCount": 2,
  "SupplierGroups": [
    {
      "ID": 001100,
      "Name": "Top Supplier Group",
      "Completes": 0,
      "Screens": 0,
      "AllocationPercentage": 0.1,
      "CPI": null,
      "IsHedgeAccess": true,
      "Suppliers": [
        {
          "SupplierCode": "1010",
          "Completes": 0,
          "Screens": 0
        }
      ]
    },
    {
      "ID": 001001,
      "Name": "The Gremlins",
      "Completes": 0,
      "Screens": 0,
      "AllocationPercentage": 0.15,
      "CPI": null,
      "IsHedgeAccess": true,
      "Suppliers": [
      {
          "SupplierCode": "1010",
          "Completes": 0,
          "Screens": 0
        }
      ]
    }
  ]
}

Returns the supplier groups for the survey specified.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.

PUT Remove from a Group

Definition

PUT  https://api.samplicio.us/Demand/v1/SupplierGroups/RemoveSuppliersFromGroup/{SurveyNumber}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X PUT  --data '{"SupplierCode": "1010"}' https://api.samplicio.us/Demand/v1/SupplierGroups/RemoveSuppliersFromGroup/{SurveyNumber}

require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SupplierGroups/RemoveSuppliersFromGroup/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Put.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {SupplierCode: '1010'}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)



<?php

$curl = curl_init();

$params = '{"SupplierLinkTypeCode": "OWS","TrackingTypeCode": "NONE","DefaultLink": "","SuccessLink": "","FailureLink": "","OverQuotaLink": "","QualityTerminationLink": ""}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SupplierGroups/RemoveSuppliersFromGroup/{SurveyNumber}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>

import requests, json

url = 'https://api.samplicio.us/Demand/v1/SupplierGroups/RemoveSuppliersFromGroup/{SurveyNumber}'
params = {'SupplierCode': '1010'}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.put(url, data=data, headers=headers)
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SupplierGroups/RemoveSuppliersFromGroup/{SurveyNumber}");

string args = @"{""SupplierCode"": 1010}";

request.Method = "PUT";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
        {
            streamWriter.Write(args);
            streamWriter.Flush();
            streamWriter.Close();
        }

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "PUT",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SupplierGroups/RemoveSuppliersFromGroup/{SurveyNumber}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {
    "SupplierCode": "1010",
};

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response


{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: RemoveSupplierGroupSuppliersFromSupplierGroups successful."
  ],
  "ResultCount": 0,
  "SupplierGroup": {
    "ID": null,
    "Name": null,
    "Completes": null,
    "Screens": null,
    "AllocationPercentage": null,
    "CPI": null,
    "IsHedgeAccess": null,
    "Suppliers": null
  }
}

Removes specified suppliers from their supplier group.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
SupplierGroupID int true Unique ID for Supplier Group.

Non-Marketplace Allocations

Non-Marketplace Allocations allow you to add a specific supplier to your survey. These allocations are separate from the Lucid Marketplace and are sometimes referred to as Services. This resource allows you to create, update, delete, and retrieve a supplier allocation. You can also specify a TCPI (targeted CPI) and allocate a desired number of completes to each supplier.

Supplier Allocations Model

Property Type Description
SupplierCode int Unique code associated with a supplier account.
AllocationPercentage double Percentage of total completes allocated to supplier, expressed as a decimal from 0 to 1.
TCPI double Gross payout per targeted complete.
HedgeAccess boolean Enables or disables hedge access for the supplier.
BlockRouterTraffic boolean Enables or disables router traffic for the supplier.
SupplierSurveyID string Survey supplier ID (SSID).
Prescreens int Number of prescreens achieved by the supplier. A prescreen is a respondent who enters the client survey.
Completes int Number of completes achieved by the supplier.
AllocationRemaining int Number of completes allocated only to the supplier.
HedgeRemaining int Number of unallocated completes available to any suppliers with access to hedge.
TotalRemaining int Total number of completes available to the supplier (aggregate of allocation and hedge remaining
Target array Contains an array of elements described below

Target Model

Property Type Description
SupplierLinkTypeCode string Defines the type of buyer-supplier engagement and the respondent’s path in Lucid Marketplace. See List Global Definitions for a map of supplier link types.
TrackingTypeCode string Defines how Marketplace should communicate back to the supplier’s system at the end of a session. The options are:
NONE (Default and recommended, physically redirects the respondent back to the supplier system)
PIXEL (pixel tracking)
S2S (server to server postback)
DefaultLink string Tracking code or link used if none of the below apply. This will typically be the same as the FailureLink
SuccessLink string Tracking code or link used after a completion.
FailureLink string Tracking code or link used after a termination.
OverQuotaLink string Tracking code or link used after an overquota.
QualityTerminationLink string Tracking code or link used after a quality (security) termination.
LiveLink string Live supplier-specific respondent entry link generated by Lucid Marketplace.
TestLink string Test supplier-specific respondent entry link generated by Lucid Marketplace.

GET Show Allocations

Definition

GET  https://api.samplicio.us/Demand/v1/SupplierAllocations/BySurveyNumber/{SurveyNumber}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Demand/v1/SupplierAllocations/BySurveyNumber/{SurveyNumber}
require 'net/http'

uri = URI('https://api.samplicio.us/Demand/v1/SupplierAllocations/BySurveyNumber/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Demand/v1/SupplierAllocations/BySurveyNumber/{SurveyNumber}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Demand/v1/SupplierAllocations/BySurveyNumber/{SurveyNumber}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SupplierAllocations/BySurveyNumber/{SurveyNumber}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SupplierAllocations/BySurveyNumber/{SurveyNumber}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 1,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetAllSupplierAllocationsBySurveyNumber successful."
  ],
  "ResultCount": 1,
  "SupplierAllocations": [
    {
      "SupplierCode": "1010",
      "AllocationPercentage": 0,
      "TCPI": 11,
      "HedgeAccess": true,
      "BlockRouterTraffic": false,
      "SupplierSurveyID": null,
      "Prescreens": 183,
      "Completes": 4,
      "AllocationRemaining": 0,
      "HedgeRemaining": 695,
      "TotalRemaining": 695,
      "Target": null
    }
  ]
}

Returns the supplier allocations for the survey specified.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.

POST Create an Allocation

Definition

POST  https://api.samplicio.us/Demand/v1/SupplierAllocations/Create/{SurveyNumber}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X POST --data '{"SupplierCode": "1010", "AllocationPercentage": 0.1, "TCPI": 2, "HedgeAccess": true, "BlockRouterTraffic": false,}' https://api.samplicio.us/Demand/v1/SupplierAllocations/Create/{SurveyNumber}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SupplierAllocations/Create/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Post.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {SupplierCode: "1010", AllocationPercentage: 0.1, TCPI: 2, HedgeAccess: true, BlockRouterTraffic: false}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{"SupplierCode": "1010", "AllocationPercentage": 0.1, "TCPI": 2, "HedgeAccess": true, "BlockRouterTraffic": false}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SupplierAllocations/Create/{SurveyNumber}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>

import requests, json

url = 'https://api.samplicio.us/Demand/v1/SupplierAllocations/Create/{SurveyNumber}'
params = {'SupplierCode': '1010', 'AllocationPercentage': 0.1, 'TCPI': 2, 'HedgeAccess': True, 'BlockRouterTraffic': False}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.post(url, data=data, headers=headers)
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SupplierAllocations/Create/{SurveyNumber}");

string args = @"{
                   ""SupplierCode"": ""1010"",
                   ""AllocationPercentage"": 0.1,
                   ""TCPI"": 2,
                   ""HedgeAccess"": true,
                   ""BlockRouterTraffic"": false
                 }";

request.Method = "POST";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "POST",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SupplierAllocations/Create/{SurveyNumber}/{SupplierCode}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {
  "SupplierCode": "1010",
    "AllocationPercentage": 0.1,
    "TCPI": 2,
    "HedgeAccess": true,
    "BlockRouterTraffic": false
};

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
    "ApiResult": 0,
    "ApiResultCode": 0,
    "ApiAccount": "Anon",
    "AccountType": 1,
    "ApiAccountStatus": 1,
    "AccountCode": "AA",
    "ApiMessages": [
        "API Message: Response initialized.",
        "API Message: CreateSupplierAllocationFromModel successful."
    ],
    "ResultCount": 1,
    "SupplierAllocation": {
        "SupplierCode": "1010",
        "AllocationPercentage": 0.1,
        "TCPI": 2,
        "HedgeAccess": true,
        "BlockRouterTraffic": false,
        "SupplierSurveyID": null,
        "Prescreens": null,
        "Completes": null,
        "AllocationRemaining": null,
        "HedgeRemaining": null,
        "TotalRemaining": null,
        "Target": null
    }
}

Creates supplier allocations for an existing Marketplacesurvey.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
SupplierCode string true Unique code associated with a supplier account.
AllocationPercentage double false Percentage of total completes allocated to supplier, expressed as a decimal from 0 to 1.
TCPI double true Over-the-counter cost per supplier complete.
HedgeAccess boolean false Indicates if hedge access is enabled for the supplier.
BlockRouterTraffic string false Indicates if router traffic is enabled for the supplier.

PUT Update an Allocation

Definition

PUT  https://api.samplicio.us/Demand/v1/SupplierAllocations/Update/{SurveyNumber}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X PUT --data '{"SupplierCode": "1010", "AllocationPercentage": 0.1, "TCPI": 2, "HedgeAccess": true, "BlockRouterTraffic": false,}' https://api.samplicio.us/Demand/v1/SupplierAllocations/Update/{SurveyNumber}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SupplierAllocations/Update/{SurveyNumber}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Put.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {SupplierCode: "1010", AllocationPercentage: 0.1, TCPI: 2, HedgeAccess: true, BlockRouterTraffic: false}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{"SupplierCode": "1010", "AllocationPercentage": 0.1, "TCPI": 2, "HedgeAccess": true, "BlockRouterTraffic": false}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SupplierAllocations/Update/{SurveyNumber}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>

import requests, json

url = 'https://api.samplicio.us/Demand/v1/SupplierAllocations/Update/{SurveyNumber}'
params = {'SupplierCode': '1010', 'AllocationPercentage': 0.1, 'TCPI': 2, 'HedgeAccess': True, 'BlockRouterTraffic': False}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

supplierLink = requests.put(url, data=data, headers=headers)
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SupplierAllocations/Update/{SurveyNumber}");

string args = @"{
                   ""SupplierCode"": ""1010"",
                   ""AllocationPercentage"": 0.1,
                   ""TCPI"": 2,
                   ""HedgeAccess"": true,
                   ""BlockRouterTraffic"": false
                 }";

request.Method = "PUT";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "PUT",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SupplierAllocations/Update/{SurveyNumber}/{SupplierCode}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {
  "SupplierCode": "1010",
    "AllocationPercentage": 0.1,
    "TCPI": 2,
    "HedgeAccess": true,
    "BlockRouterTraffic": false
};

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 1,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: UpdateSupplierAllocationFromModel successful."
  ],
  "ResultCount": 1,
  "SupplierAllocation": {
    "SupplierCode": "1010",
    "AllocationPercentage": 0.1,
    "TCPI": 2,
    "HedgeAccess": true,
    "BlockRouterTraffic": false,
    "SupplierSurveyID": null,
    "Prescreens": 0,
    "Completes": 0,
    "AllocationRemaining": 1,
    "HedgeRemaining": 2,
    "TotalRemaining": 3,
    "Target": null
  }
}

Creates supplier allocations for an existing Marketplacesurvey.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
SupplierCode string true Unique code associated with a supplier account.
AllocationPercentage double false Percentage of total completes allocated to supplier, expressed as a decimal from 0 to 1.
TCPI double true Over-the-counter cost per supplier complete.
HedgeAccess boolean false Indicates if hedge access is enabled for the supplier.
BlockRouterTraffic string false Indicates if router traffic is enabled for the supplier.

DELETE Delete an Allocation

Definition

DELETE  https://api.samplicio.us/Demand/v1/SupplierAllocations/Delete/{SurveyNumber}/{SupplierCode}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" -X DELETE https://api.samplicio.us/Demand/v1/SupplierAllocations/Delete/{SurveyNumber}/{SupplierCode}
require 'net/http'

uri = URI('https://api.samplicio.us/Demand/v1/SupplierAllocations/Delete/{SurveyNumber}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Delete.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

http.request(request)
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SupplierAllocations/Delete/{SurveyNumber}/{SupplierCode}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
    CURLOPT_HTTPHEADER => array('Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_POSTFIELDS => "",
));

curl_exec($curl);
curl_close($curl);
?>
import requests

url = 'https://api.samplicio.us/Demand/v1/SupplierAllocations/Delete/{SurveyNumber}/{SupplierCode}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.delete(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SupplierAllocations/Delete/{SurveyNumber}/{SupplierCode}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

request.Method = "DELETE";

request.GetResponse();
const https = require('https');

var options = {
  "method": "DELETE",
  "hostname": "stg-api.samplicio.us",
  "path": "/Demand/v1/SupplierAllocations/Delete/{SurveyNumber}/{SupplierCode}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options);

request.end();

Deletes a supplier allocation for an existing Marketplacesurvey.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
SupplierCode string true Unique code associated with a supplier account.

Non-Marketplace Entry Links

The Non-Marketplace Entry Link resource allows the buyer to create, update, and delete supplier links (targets) on non-marketplace allocations.

Supplier Allocation Model

Property Type Description
SupplierCode string Unique code associated with a supplier account.
AllocationPercentage double Percentage of total completes allocated to supplier, expressed as a decimal from 0 to 1.
TCPI double Over-the-counter cost per supplier complete.
HedgeAccess string Indicates if hedge access is enabled for the supplier (true, false).
BlockRouterTraffic string Indicates if router traffic is enabled for the supplier (true, false).
SupplierSurveyID int 36 digit hex GUID that identifies a supplier.
Prescreens int Number of prescreens achieved by the supplier. A prescreen is a respondent who enters the client survey.
Completes int Number of completes achieved by the supplier.
AllocationRemaining int Number of completes allocated only to the supplier.
HedgeRemaining int Number of unallocated completes available to any suppliers with access to hedge.
TotalRemaining int Total number of completes available to the supplier (aggregate of allocation and hedge remaining properties).
Target array Contains array of elements described below.

Target Model

Property Type Description
SupplierLinkTypeCode string Defines the type of buyer-supplier engagement and the respondent’s path in Lucid Marketplace.
TrackingTypeCode string Defines how Lucid Marketplace should communicate back to the supplier’s system at the end of a session.
NONE (Default and recommended, physically redirects the respondent back to the supplier system)
PIXEL (pixel tracking)
S2S (server to server postback)
DefaultLink string Tracking code or link used if none of the below apply.
SuccessLink string Tracking code or link used after a completion.
FailureLink string Tracking code or link used after a termination.
OverQuotaLink string Tracking code or link used after an overquota.
QualityTerminationLink string Tracking code or link used after a quality (security) termination.
LiveLink string Live supplier-specific respondent entry link generated by Lucid Marketplace.
TestLink string Test supplier-specific respondent entry link generated by Lucid Marketplace.

POST Create a Link

Definition

POST  https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Create/{SurveyNumber}/{SupplierCode}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X POST --data '{"SupplierLinkTypeCode": "TS", "TrackingTypeCode": "NONE"}' https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Create/{SurveyNumber}/{SupplierCode}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Create/{SurveyNumber}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Post.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {SupplierLinkTypeCode:"TS",TrackingTypeCode:"NONE"}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{"SupplierLinkTypeCode": "TS","TrackingTypeCode": "NONE"}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Create/{SurveyNumber}/{SupplierCode}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>

import requests, json

url = 'https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Create/{SurveyNumber}/{SupplierCode}'
params = {'SupplierLinkTypeCode':'TS','TrackingTypeCode':'NONE'}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.post(url, data=data, headers=headers)
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Create/{SurveyNumber}/{SupplierCode}");

string args = @"{
                  ""SupplierLinkTypeCode"":""TS"",
                  ""TrackingTypeCode"":""NONE""
                }";

request.Method = "POST";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "POST",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SupplierAllocations/Targets/Create/{SurveyNumber}/{SupplierCode}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {
    "SupplierLinkTypeCode":"TS",
    "TrackingTypeCode":"NONE"
};

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });
});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: CreateSupplierAllocationTargetFromModel successful."
  ],
  "ResultCount": 1,
  "SupplierAllocation": {
    "SupplierCode": "1010",
    "AllocationPercentage": 0,
    "TCPI": 5,
    "HedgeAccess": true,
    "BlockRouterTraffic": false,
    "SupplierSurveyID": "",
    "Prescreens": 0,
    "Completes": 0,
    "AllocationRemaining": 0,
    "HedgeRemaining": 15,
    "TotalRemaining": 15,
    "Target": {
      "SupplierLinkTypeCode": "TS",
      "TrackingTypeCode": "NONE",
      "DefaultLink": "http:\/\/www.anon.com\/surveys?v=1&fs=1&uid=[%MID%]",
      "SuccessLink": "http:\/\/www.anon.com\/surveys?v=1&fs=2&uid=[%MID%]&COST=[%COST%]",
      "FailureLink": "http:\/\/www.anon.com\/surveys?v=1&fs=1&uid=[%MID%]",
      "OverQuotaLink": "http:\/\/www.anon.com\/surveys?v=1&fs=1&uid=[%MID%]",
      "QualityTerminationLink": "http:\/\/www.anon.com\/surveys?v=1&fs=1&uid=[%MID%]",
      "LiveLink": "http:\/\/samplicio.us\/s\/default.aspx?SID=52c975a7-15fb-804d-9bd2-3d5d553aa7af&PID=",
      "TestLink": "http:\/ \/samplicio.us\/s\/default.aspx?SID=a948gef7-3591-42c0-ce51-0e4xdf25582f&FIRID=MSDHONI7&SUMSTAT=1&PID=test"
    }
  }
}

Creates target links for suppliers with an allocation for a Marketplacesurvey.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
SupplierCode string true Unique code associated with a supplier account.
SupplierLinkTypeCode int true Defines the type of buyer-supplier engagement and the respondent’s path in Lucid Marketplace.
TrackingTypeCode int true Defines how Marketplace should communicate back to the supplier’s system at the end of a session. The options are:
NONE (Default and recommended, physically redirects the respondent back to the supplier system)
PIXEL (pixel tracking)
S2S (server to server postback)

Definition

PUT  https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Update/{SurveyNumber}/{SupplierCode}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X PUT  --data '{"SupplierLinkTypeCode": "TS", "TrackingTypeCode": "NONE", "DefaultLink":"","SuccessLink":"","FailureLink":"","OverQuotaLink":"","QualityTerminationLink":""}' https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Update/{SurveyNumber}/{SupplierCode}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Update/{SurveyNumber}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Put.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {SupplierLinkTypeCode:"TS",TrackingTypeCode:"NONE",DefaultLink:"",SuccessLink:"",FailureLink:"",OverQuotaLink:"",QualityTerminationLink:""}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{"SupplierLinkTypeCode": "TS","TrackingTypeCode": "NONE","DefaultLink": "","SuccessLink": "","FailureLink": "","OverQuotaLink": "","QualityTerminationLink": ""}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Update/{SurveyNumber}/{SupplierCode}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>
import requests, json

url = 'https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Update/{SurveyNumber}/{SupplierCode}'
params = {'SupplierLinkTypeCode':'TS','TrackingTypeCode':'NONE','DefaultLink':'','SuccessLink':'','FailureLink':'','OverQuotaLink':'','QualityTerminationLink':''}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.put(url, data=data, headers=headers)
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Update/{SurveyNumber}/{SupplierCode}");

string args = @"{
                  ""SupplierLinkTypeCode"":""TS"",
                  ""TrackingTypeCode"":""NONE"",
                  ""DefaultLink"":"""",
                  ""SuccessLink"":"""",
                  ""FailureLink"":"""",
                  ""OverQuotaLink"":"""",
                  ""QualityTerminationLink"":""""
                }";

request.Method = "PUT";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
        {
            streamWriter.Write(args);
            streamWriter.Flush();
            streamWriter.Close();
        }

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "PUT",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SupplierAllocations/Targets/Update/{SurveyNumber}/{SupplierCode}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {
    "SupplierLinkTypeCode":"TS",
    "TrackingTypeCode":"NONE",
    "DefaultLink":"",
    "SuccessLink":"",
    "FailureLink":"",
    "OverQuotaLink": "",
    "QualityTerminationLink":""
};

var params = JSON.stringify(json);

var request = https.request(options, function (updatedSupplierLink) {
  var chunks = [];

  updatedSupplierLink.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Updates existing supplier target links.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
SupplierCode string true Unique code associated with a supplier account.
SupplierLinkTypeCode string true Defines the type of buyer-supplier engagement and the respondent’s path in Lucid Marketplace.
TrackingTypeCode int true Defines how Marketplace should communicate back to the supplier’s system at the end of a session. The options are:
NONE (Default and recommended, physically redirects the respondent back to the supplier system)
PIXEL (pixel tracking)
S2S (server to server postback)
DefaultLink string true Tracking code or link used if none of the below apply.
SuccessLink string true Tracking code or link used after a completion.
FailureLink string true Tracking code or link used after a termination.
OverQuotaLink string true Tracking code or link used after an overquota.
QualityTerminationLink string true Tracking code or link used after a quality (security) termination.

Definition

DELETE  https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Delete/{SurveyNumber}/{SupplierCode}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" -X DELETE https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Delete/{SurveyNumber}/{SupplierCode}
require 'net/http'

uri = URI('https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Delete/{SurveyNumber}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Delete.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

http.request(request)
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Delete/{SurveyNumber}/{SupplierCode}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_POSTFIELDS => "",
));

curl_exec($curl);
curl_close($curl);
?>
import requests

url = 'https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Delete/{SurveyNumber}/{SupplierCode}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.delete(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SupplierAllocations/Targets/Delete/{SurveyNumber}/{SupplierCode}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

request.Method = "DELETE";

request.GetResponse();
const https = require('https');

var options = {
  "method": "DELETE",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SupplierAllocations/Targets/Delete/{SurveyNumber}/{SupplierCode}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options);

request.end();

Deletes target links for a supplier allocated to a Marketplace survey.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
SupplierCode string true Unique code associated with a supplier account.

Recontact

Recontacts allow buyers to collect a follow-up impression on a respondent they have already interacted with or already have knowledge of.

SurveyQualifiedRespondents Model

Property Type Description
IsActive boolean Indicates whether a respondent qualifies for the recontact.
PID string A supplier’s unique respondent identifier.

GET List Qualified Respondents

Definition

GET  https://api.samplicio.us/Demand/v1/SurveyQualifiedRespondents/BySurveyNumberSupplierCode/{SurveyNumber}/{SupplierCode}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Demand/v1/SurveyQualifiedRespondents/BySurveyNumberSupplierCode/{SurveyNumber}/{SupplierCode}
require 'net/http'

uri = URI('https://api.samplicio.us/Demand/v1/SurveyQualifiedRespondents/BySurveyNumberSupplierCode/{SurveyNumber}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Demand/v1/SurveyQualifiedRespondents/BySurveyNumberSupplierCode/{SurveyNumber}/{SupplierCode}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Demand/v1/SurveyQualifiedRespondents/BySurveyNumberSupplierCode/{SurveyNumber}/{SupplierCode}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SurveyQualifiedRespondents/BySurveyNumberSupplierCode/{SurveyNumber}/{SupplierCode}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SurveyQualifiedRespondents/BySurveyNumberSupplierCode/{SurveyNumber}/{SupplierCode}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 1,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: SurveyQualifiedRespondentsBySurveyNumberSupplierCode successful."
  ],
  "ResultCount": 2,
  "SurveyQualifiedRespondents": [
    {
      "PID": "1110111",
      "IsActive": true
    },
    {
      "PID": "1110110",
      "IsActive": true
    },
  ]
}

Returns a list of qualified respondents for a specified recontact study and supplier by PID.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
SupplierCode string true Unique code associated with a supplier account.

PUT Update Qualified Respondents

Definition

PUT  https://api.samplicio.us/Demand/v1/SurveyQualifiedRespondents/Update/{SurveyNumber}/{SupplierCode}

Example Request

curl -H "Content-Type: application/json"  -H "Authorization: YOUR_API_KEY_HERE" -X PUT  --data '{"SurveyQualifiedRespondents":[{"IsActive": true,"PID": "0001110"},]}' https://api.samplicio.us/Demand/v1/SurveyQualifiedRespondents/Update/{SurveyNumber}/{SupplierCode}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SurveyQualifiedRespondents/Update/{SurveyNumber}/{SupplierCode}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Put.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {
                  SurveyQualifiedRespondents:
                  [
                    {
                      IsActive: true,
                      PID: '0001110'
                    },
                  ]
                }.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{
              "SurveyQualifiedRespondents":
              [
                {
                  "IsActive": true,
                  "PID": "0001110"
                },
              ]
            }';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SurveyQualifiedRespondents/Update/{SurveyNumber}/{SupplierCode}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>
import requests, json

url = 'https://api.samplicio.us/Demand/v1/SurveyQualifiedRespondents/Update/{SurveyNumber}/{SupplierCode}'
params = {
            'SurveyQualifiedRespondents':
            [
              {
                'IsActive': True,
                'PID': '0001110'
              },
            ]
          }

data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.put(url, data=data, headers=headers)
using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SurveyQualifiedRespondents/Update/{SurveyNumber}/{SupplierCode}");

string args = @"{
                  ""SurveyQualifiedRespondents"":
                  [
                    {
                       ""IsActive"": true,
                       ""PID"": ""0001110""
                    },
                  ]
                }";

request.Method = "PUT";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "PUT",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SurveyQualifiedRespondents/Update/{SurveyNumber}/{SupplierCode}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {
              "SurveyQualifiedRespondents":
              [
                {
                  "IsActive": true,
                  "PID": "0001110"
                },
              ]
            };

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: UpdateSurveyQualifiedRespondentsBySurveyNumberSupplierCode successful."
  ],
  "ResultCount": 1,
  "SurveyQualifiedRespondents": [
    {
      "PID": "1234",
      "IsActive": true
    },
  ]
}

Updates the list of PIDs that qualify for a recontact survey.

Arguments

Property Type Required Description
SurveyNumber int true Unique number associated with the survey.
SupplierCode string true Unique code associated with a supplier account.
IsActive boolean true Should the respondent still qualify?
PID string true Persistent panelist identifier used by the supplier.

Survey Groups

Survey Groups Model

The Surveys Groups resource allows the buyer to list existing survey groups, see details of a survey group, create survey groups, add and remove surveys from a survey group.

Property Type Description
ID int Unique survey group identifier.
Name string Name of the survey group. This value is not unique across surveys. Maximum length of 200.
SurveyCount int Number of surveys in the survey group.

Survey Group Model

The Survey Group allows the buyer to view surveys in a survey group.

Property Type Description
SurveyIds array Unique IDs associated with the survey.

GET List Survey Groups

Definition

GET  https://api.samplicio.us/Demand/v1/SurveyGroups/

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Demand/v1/SurveyGroups/
require 'net/http'

uri = URI('https://api.samplicio.us/Demand/v1/SurveyGroups/')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php

$URL = "https://api.samplicio.us/Demand/v1/SurveyGroups/";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);

?>
import requests

url = 'https://api.samplicio.us/Demand/v1/SurveyGroups/'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)

using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SurveyGroups/");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SurveyGroups",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetSurveyGroups successful."
  ],
  "ResultCount": 2,
  "SurveyGroups": [
    {
      "ID": 10001,
      "Name": "Local Group",
      "SurveyCount": 38
    },
    {
      "ID": 10101,
      "Name": "Neighbor Group",
      "SurveyCount": 12
    }
  ]
}

Returns the survey groups, their IDs, and number of surveys within each. This endpoint must end in a trailing slash or it will redirect you to http due to a bug in an underlying framework.

GET Show a Survey Group

Definition

GET  https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}
require 'net/http'

uri = URI('https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)  
<?php
$URL = "https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}";

$aHTTP['http']['method']  = 'GET';

$aHTTP['http']['header']  = "Authorization: YOUR_API_KEY_HERE";

$context = stream_context_create($aHTTP);

$response = file_get_contents($URL, false, $context);
?>
import requests

url = 'https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}'

headers = {'Authorization' : YOUR_API_KEY_HERE}

response = requests.get(url, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}");

request.Headers.Add("Authorization", YOUR_API_KEY_HERE);

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SurveyGroups/{SurveyGroupID}",
  "headers": {'Authorization': YOUR_API_KEY_HERE}
};

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetSurveyGroupBySurveyGroupID successful."
  ],
  "ResultCount": 2,
  "SurveyIDs": [
    123456,
    654321
  ]
}

Returns the survey IDs for the survey group specified.

POST Create a Survey Group

Definition

POST  https://api.samplicio.us/Demand/v1/SurveyGroups

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X POST --data '{"Name": "Group 1"}' https://api.samplicio.us/Demand/v1/SurveyGroups/
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SurveyGroups/')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Post.new(FullUriPath, initheader = {'Content-Type' => 'application/json'})

request.body = {Name:"Group 1"}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

<?php
$curl = curl_init();

$params = '{"Name":"Group 1"}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SurveyGroups/",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>
import requests

url = 'https://api.samplicio.us/Demand/v1/SurveyGroups/'
params = {'Name':'Group 1'}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}
response = requests.post(url, data=data, headers=headers)

using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SurveyGroups/");

string args = @"{""Name"":""Group 1""}";

request.Method = "POST";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");


using(StreamWriter streamWriter = new StreamWriter(request.
RequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();

const https = require('https');

var options = {
  "method": "POST",
  "hostname": "api.samplicio.us",
  "path": "Demand/v1/SurveyGroups/",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {
  "Name":"Group 1"
}

var params = JSON.stringify(json);

var request = https.request(options, function (createGroup) {
  var chunks = [];

  createGroup.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: InsertSurveyGroup successful."
  ],
  "ResultCount": 0,
  "SurveyGroup": {
    "ID": 18096,
    "SID": "AA11AA22-A111-CCDD-5F66-123456D11",
    "Name": "Group 1",
    "Description": "",
    "LK_RecordStatusID": true,
    "LK_SurveyGroupTypeID": 1
  }
}

Creates an empty survey group.

Arguments

Property Type Required Description
Name string true Survey Group name. Maximum 200 characters.

POST Add to Survey Group

Definition

POST  https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X POST --data '{"SurveyIDs": ["101101"]}' https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Post.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {SurveyIDs: ["101101"]}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{"SurveyIDs": ["101101"]}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>
import requests, json

url = 'https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}'
params = {'SurveyIDs': 101101}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.post(url, data=data, headers=headers)

using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}");

string args = @"{""SurveyIDs"": ["101101"]}";

request.Method = "POST";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "POST",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SurveyGroups/{SurveyGroupID}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {"SurveyIDs": ["101101"]
  }

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: InsertSurveyGroupSurveys successful."
  ],
  "ResultCount": 1,
  "SurveyIDs": [
    101101
  ]
}

Adds a survey to the specified survey group.

Arguments

Property Type Required Description
SurveyIDs array true Unique ID associated with the survey.

PUT Update a Group

Definition

PUT  https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X PUT --data '{"SurveyIDs":["001100"]}' https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Put.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {"SurveyIDs":["001100"]}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{"SurveyIDs":["001100"]}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>
import requests, json

url = 'https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}'
params = {'SurveyIDs':['001100']}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.put(url, data=data, headers=headers)

using System.IO;
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}");

string args = @"{"SurveyIDs":["001100"]}";

request.Method = "PUT";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

WebResponse response = request.GetResponse();
const https = require('https');

var options = {
  "method": "PUT",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SurveyGroups/{SurveyGroupID}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {"SurveyIDs":["001100"]}

var params = JSON.stringify(json);

var request = https.request(options, function (response) {
  var chunks = [];

  response.on("data", function (chunk) {
    chunks.push(chunk);
  });

});

request.write(params);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: GetSurveyGroupBySurveyGroupID successful."
  ],
  "ResultCount": 1,
  "SurveyIDs": [
    001100
  ]
}

Updates a survey group with the specified surveys.

Arguments

Property Type Required Description
SurveyIDs array true Unique ID associated with the survey.

DELETE Remove from a Survey Group

Definition

DELETE  https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}

Example Request

curl -H "Authorization: YOUR_API_KEY_HERE" -X DELETE --data '{"SurveyIDs": ["101101"]}' https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

request = Net::HTTP::Delete.new(uri.request_uri)

request.body = {SurveyIDs: 101101}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php

$curl = curl_init();

$params = '{"SurveyIDs": ["101101"]}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_POSTFIELDS => "",
));

curl_exec($curl);
curl_close($curl);
?>
import requests

url = 'https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}'
params = {'SurveyIDs': 101101}
data = json.dumps(params)
headers = {'Content-type': 'application/json', 'Authorization' : 'YOUR_API_KEY_HERE', 'Accept': 'text/plain'}

response = requests.delete(url, data=data, headers=headers)
using System.Net;

WebRequest request = WebRequest.Create("https://api.samplicio.us/Demand/v1/SurveyGroups/{SurveyGroupID}");

string args = @"{""SurveyIDs"": [101101]}";

request.Method = "DELETE";
request.ContentType = "application/json";
request.Headers.Add("Authorization", "YOUR_API_KEY_HERE");

using(StreamWriter streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(args);
streamWriter.Flush();
streamWriter.Close();
}

request.GetResponse();
const https = require('https');

var options = {
  "method": "DELETE",
  "hostname": "api.samplicio.us",
  "path": "/Demand/v1/SurveyGroups/{SurveyGroupID}",
  "headers": {'Content-Type': 'application/json',
  'Authorization': 'YOUR_API_KEY_HERE'
  }
};

var json = {"SurveyIDs": ["101101"]
  }

var params = JSON.stringify(json);

var request = https.request(options);

request.end();

Example Response

{
  "ApiResult": 0,
  "ApiResultCode": 0,
  "ApiAccount": "Anon",
  "AccountType": 2,
  "ApiAccountStatus": 1,
  "AccountCode": "AA",
  "ApiMessages": [
    "API Message: Response initialized.",
    "API Message: DeleteSurveyGroupSurveys successful."
  ],
  "ResultCount": 0,
  "SurveyIDs": []
}

Deletes the surveyID from the specified survey group.

Arguments

Property Type Required Description
SurveyIDs array true Unique ID associated with the survey.

Beta - Marketplace Integration

The Beta collection can be easily imported into Postman by clicking the button below:

Run in Postman

Reach (beta)

The Reach pricing estimator tool allows you to specify a target audience and returns expected feasibility.

POST Audience Estimate (beta)

Definition

POST https://api.samplicio.us/demand/v2-beta/reach/audience-estimate

Example Request

curl -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_HERE" -X POST --data '{"qualifications": [{"question_id": 42, "condition": "18" },{"question_id": 42, "condition": "19" },{"question_id": 42, "condition": "20" },{"question_id": 42, "condition": "21" },{"question_id": 42, "condition": "22" },{"question_id": 42, "condition": "23" },{"question_id": 42, "condition": "24" },{"question_id": 42, "condition": "25" },{"question_id": 43, "condition": "2" }],"completes": 500,"days": 7,"length_of_interview": 10,"incidence_rate": 0.5,"price_ceiling": 1.5, "locale": "eng_us"}' https://api.samplicio.us/demand/v2-beta/reach/audience-estimate
require 'net/http'
require 'json'

uri = URI('https://api.samplicio.us/demand/v2-beta/reach/audience-estimate')

http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true

fullUriPath = uri.path + '?' + uri.query

request = Net::HTTP::Post.new(fullUriPath, initheader = {'Content-Type' =>'application/json'})

request.body = {
    "qualifications"=> [
        {
            "question_id"=> 42,
            "condition"=> "18"
        },
        {
            "question_id"=> 42,
            "condition"=> "19"
        },
        {
            "question_id"=> 42,
            "condition"=> "20"
        },
        {
            "question_id"=> 42,
            "condition"=> "21"
        },
        {
            "question_id"=> 42,
            "condition"=> "22"
        },
        {
            "question_id"=> 42,
            "condition"=> "23"
        },
        {
            "question_id"=> 42,
            "condition"=> "24"
        },
        {
            "question_id"=> 42,
            "condition"=> "25"
        },
        {
            "question_id"=> 43,
            "condition"=> "2"
        }
    ],
    "completes"=> 500,
    "days"=> 7,
    "length_of_interview"=> 10,
    "incidence_rate"=> 0.5,
    "price_ceiling"=> 1.5,
    "locale"=> "eng_us"
}.to_json

request['Authorization'] = YOUR_API_KEY_HERE

response = http.request(request)
<?php
$curl = curl_init();

$params = '{
    "qualifications": [
        {
            "question_id": 42,
            "condition": "18"
        },
        {
            "question_id": 42,
            "condition": "19"
        },
        {
            "question_id": 42,
            "condition": "20"
        },
        {
            "question_id": 42,
            "condition": "21"
        },
        {
            "question_id": 42,
            "condition": "22"
        },
        {
            "question_id": 42,
            "condition": "23"
        },
        {
            "question_id": 42,
            "condition": "24"
        },
        {
            "question_id": 42,
            "condition": "25"
        },
        {
            "question_id": 43,
            "condition": "2"
        }
    ],
    "completes": 500,
    "days": 7,
    "length_of_interview": 10,
    "incidence_rate": 0.5,
    "price_ceiling": 1.5,
    "locale": "eng_us"
}';

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.samplicio.us/demand/v2-beta/reach/audience-estimate",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Authorization: YOUR_API_KEY_HERE'),
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $params,
));

$response = curl_exec($curl);

curl_close($curl);
?>

import requests, json

url = 'https://api.samplicio.us/demand/v2-beta/reach/audience-estimate'
params = {
    "qualifications": [
        {
            "question_id": 42,
            "condition": "18"
        },
        {
            "question_id": 42,
            "condition": "19"
        },
        {
            "question_id": 42,
            "condition": "20"
        },
        {
            "question_id": 42,
            "condition": "21"
        },
        {
            "question_id": 42,
            "condition": "22"
        },
        {
            "question_id": 42,
            "condition": "23"
        },
        {
            "question_id": 42,
            "condition": "24"
        },
        {
            "question_id": 42,
            "condition": "25"
        },
        {
            "question_id": 43,
            "condition": "2"
        }
    ],
    "completes": 500,
    "days": 7,
    "length_of_interview": 10,
    "incidence_rate": 0.5,
    "price_ceiling": 1.5,
    "locale": "eng_us"
}
data = json.dumps(params)
headers = {'Content-type':