Create Survey Using the Decipher API Integration

If you use Decipher to program your surveys, you may utilize the PureSpectrum<>Decipher API integration to create and sync Decipher surveys within PureSpectrum.


In order to use this integration, you must have default mappings configured via the Buyer Settings page on PureSpectrum, otherwise none of the targeting will sync.

This API will return a response containing the PS Survey ID's, details, qualifications, and quotas of the draft surveys.  You will need to PATCH the status to LIVE for each survey ID to begin sampling.


One Decipher survey may correspond to more than one PureSpectrum survey (e.g. multi-country studies or surveys with tricky targeting).  As a result, the response may return more than one survey when variants are present in the Default mappings.

Create Survey


Request


POST $apihost/$basepath/decipherSurvey

($apihost is the environment against which you are testing, and $basepath is the base path with the api version. All Buy API calls will require access-token parameter in the header) 


Parameters: 

Body: 

{
  "decipherDirectory": "Demo Buyer", //if missing, will use the default directory
  "decipherPath": "/selfserve/abc/123", //required
  "categoryCode": 231, //if missing, will use the default category
  "localization": {"type":1,"value":"en_US"}, //required, type 1 - use the localization in "value".  type 2 - use the localization contained in decipher question id in value.
  "completesRequired": {"type":1, "value":"500"} //required, type 1 - use the quantity in "value".  type 2 - use the value contained in decipher question id in value.
  "expectedIr":50, //required
  "expectedLoi":15, //required
  "fieldTime":2, //required
  "offerPrice": 2.50, //optional
  "liveUrl": "https://v2.decipherinc.com/selfserve...." //optional, include if you have additional parameters
}

Result 


Response Code

201

Response Body

[
{
  "surveyTitle": "States Study 1",
  "decipherDirectory": "Demo Buyer",
  "decipherPath": "/selfserve/abc/123",
  "categoryCode": 231,
  "completesRequired": 1000,
  "liveUrl": "https://my.survey.com?survey_id=1234",
  "testUrl": "https://my.survey.com?survey_id=1234&test=1",
  "fieldTime": 10,
  "offerPrice": 2.50,
  "psSurveyStatus": 11,
  "expectedLoi": 15,
  "expectedIr": 50,
  "psSurveyId": 3432,
  "modOn": 1490013355547,
  "crtdOn": 1490011568138,
  "testPsSurveyEntryLink": "http://dev.spectrumsurveys.com:3500/startsurvey?survey_id=3432&ps_redirect_test=1&bsec=a70mx8&supplier_id=23",
  "surveyLocalization": "en_US",
  "qualifications": [
    {
      "condition_codes": [
        "36",
        "34",
        "6"
      ],
      "qualification_code": 225
    }
  ],
  "quotas": [
    {
      "buyer_quota_id": "/States/aKqY4",
      "ps_quota_id": "77f5d68a-9099-4add-94ae-acf08020b426",
      "required_count": 400,
      "criteria": [
        {
          "qualification_code": 225,
          "condition_codes": [
            "6"
          ]
        }
      ]
    },
    {
      "buyer_quota_id": "/States/a3h3h",
      "ps_quota_id": "57dcacae-7fd9-42a5-868b-a6b9fa40ce6e",
      "required_count": 400,
      "criteria": [
        {
          "qualification_code": 225,
          "condition_codes": [
            "36"
          ]
        }
      ]
    },
    {
      "buyer_quota_id": "/States/abc12",
      "ps_quota_id": "ed35857b-b40d-4c5e-990b-ff413674c480",
      "required_count": 200,
      "criteria": [
        {
          "qualification_code": 225,
          "condition_codes": [
            "34"
          ]
        }
      ]
    }
  ]
}
]

Notes