Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Get Surveys - GET /surveys - http://api.spectrumsurveys.com/suppliers/v2/surveys/:survey_id

...

Warning

Targeting for age and gender of child { "qualification_code" : 220 & 230 } will only appear in the criteria for the quota. It will not appear in the qualifications array. This is because that the survey may target for the people who have children as well as for people who don't have children in the same survey.


If a survey is targeting for parents of a specific age and gender of a child , then a qualifications array will always contain qualification_code : 218 and condition_code:111. The Age and gender of the child will appear as a nested quota for qualification_code : 218, 220 and 230.


Please see examples below


Warning

In case targeting is present on either age of child or gender of child, a nested quota will be present containing age of child, gender of child, and parent qualification codes. (218.220,230). 


HEADER Parameters

Parameter

Type

Required

Description

access-token

string

Yes

Token used to identify the authenticity of the user.

...

Parameter

Type

Description

quota_id

integer

Quota ID

Criteria

Object

Contains Qualification codes and their corresponding condition codes

qualification_code

integer

218 for Children , 220 fro Kid's Gender and 230 for Kid's age.

condition_codesintegerFor 218, 111 stands for No children and 112 for having children.

- parent/not parent

220 - gender of child

230 - age of child

condition_codesarray of stringsContains the applicable answer choices for either 218 (has/doesn't have children) or 220 (gender of the child)
range_setsarray of objects

Contains range sets for the age of the child, nested within the criteria of a quota.

crtd_on

UTC Timestamp in milliseconds since Unix Epoch

Timestamp of when this quota id was created (milliseconds since Unix Epoch)

mod_on

UTC Timestamp in milliseconds since Unix Epoch

Timestamp of when this quota id was last modified. This would only change if the quota is locked/unlocked, or the quantity is changed. If a quota's criteria are modified, this quota is closed and a new one is created. (milliseconds since Unix Epoch)


Range Sets - Object Parameters

Parameter

Type

Description

from

integer

Quota ID

to 

integer

Contains Qualification codes and their corresponding condition codes

units

integer

311 - Years

312 - Months

Sample API Request

Code Block
GET /suppliers/v2/surveys/:survey_id
Host: api.spectrumsurveys.com
access-token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

...

This is a snippet from there response of GET /suppliers/v2/surveys/:survey_id

Code Block
Example 1: quota is looking for parents of 1 year old boy.

"quotas": [
{
          "quota_id": "c0013c3d-42e6-4a5f-9097-96c7eea4f155",
          "quantities":
                 {
                       "currently_open": 100,
                       "remaining": 100,
                       "achieved": 0
                  },
           "criteria": [
                  {
                        "qualification_code": 218,
                        "condition_codes": [
                              "111"
                          ]
                  },
                  {
                        "qualification_code": 220,
                        "condition_codes": [
                              "111"
                         ]
                  },
                  {
                        "qualification_code": 230,
                        "range_sets": [
                                 {
                                       "units": 311,
                                       "to": 1,
                                       "from": 1
                                 }
                         ]
                  }
                 ],
               "crtd_on": 1505724120171,
               "mod_on": 1505724120171
}
]

Example 2: quota is looking for people who are *not* parents

"quotas": [
{
          "quota_id": "c0013c3d-42e6-4a5f-9097-96c7eea4f155",
          "quantities":
                 {
                       "currently_open": 100,
                       "remaining": 100,
                       "achieved": 0
                  },
           "criteria": [
                  {
                        "qualification_code": 218,
                        "condition_codes": [
                              "112"
                          ]
                  }
                 ],
               "crtd_on": 1505724120171,
               "mod_on": 1505724120171
}
]

Example 2: quota is looking for people who are parents of boy or girl 3 months - 18 months

"quotas": [
{
          "quota_id": "c0013c3d-42e6-4a5f-9097-96c7eea4f155",
          "quantities":
                 {
                       "currently_open": 100,
                       "remaining": 100,
                       "achieved": 0
                  },
           "criteria": [
                  {
                        "qualification_code": 218,
                        "condition_codes": [
                              "111"
                          ]
                  },
                  {
                        "qualification_code": 220,
                        "condition_codes": [
                              "111",
							  "112"
                         ]
                  },
                  {
                        "qualification_code": 230,
                        "range_sets": [
                                 {
                                       "units": 312,
                                       "to": 18,
                                       "from": 3
                                 }
                         ]
                  }
                 ],
               "crtd_on": 1505724120171,
               "mod_on": 1505724120171
}
]

Example 3: quota is looking for people who are parents of child 3 months - 18 months

"quotas": [
{
          "quota_id": "c0013c3d-42e6-4a5f-9097-96c7eea4f155",
          "quantities":
                 {
                       "currently_open": 100,
                       "remaining": 100,
                       "achieved": 0
                  },
           "criteria": [
                  {
                        "qualification_code": 218,
                        "condition_codes": [
                              "111"
                          ]
                  },
                  {
                        "qualification_code": 220,
                        "condition_codes": [
                              "111"
                         ]
                  },
                  {
                        "qualification_code": 230,
                        "range_sets": [
                                 {
                                       "units": 312,
                                       "to": 18,
                                       "from": 3
                                 }
                         ]
                  }
                 ],
               "crtd_on": 1505724120171,
               "mod_on": 1505724120171
}
]

Example 4: quota is looking for people who are parents of a boy

"quotas": [
{
          "quota_id": "c0013c3d-42e6-4a5f-9097-96c7eea4f155",
          "quantities":
                 {
                       "currently_open": 100,
                       "remaining": 100,
                       "achieved": 0
                  },
           "criteria": [
                  {
                        "qualification_code": 218,
                        "condition_codes": [
                              "111"
                          ]
                  },
                  {
                        "qualification_code": 220,
                        "condition_codes": [
                              "111"
                         ]
                  },
                  {
                        "qualification_code": 230,
                        "range_sets": [
                                 {
                                       "units": 311,
                                       "to": 18,
                                       "from": 1
                                 }
                         ]
                  }
                 ],
               "crtd_on": 1505724120171,
               "mod_on": 1505724120171
}
]

...