Query Project API

This API is used to query the description and status of the project.

Command

"client/queryProject/1"



Inputs

The following values are expected in the JSON body:

Name Type Required Description
command String

Must be "client/queryProject/1"

rfg_id String

Survey identifier. This is the identifier that you got as response after invoking our submitProject API.


Outputs

The JSON output will always contain the original command and a result. If the result > 0, an error has occurred (refer to Error Codes) and a message field will describe the error. If result = 0, the following is included in the response field:

Name Type Description
pid String

A unique identifier for your project.

name String

Internal name describing the survey.

title String

Text to be shown to the respondent describing the survey.

country String

2-letter ISO country code, e.g. US, GB, CA, etc.

state Integer

Project state:

  1. Pre-Launch
  2. In-Field
  3. Paused
  4. Closed - Waiting for IDs
  5. Closed - Ready for Billing
  6. Closed - Billed
  7. Closed - Dead
  8. Closed - Paid
  9. Closed - Zero

You will only receive respondents for projects in state 2.

ir Integer

Incidence Rate of the project as a percent.

lengthOfInterview Integer

Average number of minutes it takes a user to complete your survey.

SurveyURL String

http://the.link.to.the.survey/survey?sesskey={sesskey}

desiredCompletes Integer

Indicates the amount of completes that you want to accomplish on this project.

cpi String

Currency formatted string that indicates how much you will pay for each complete in USD.

collectsPII Boolean

Indicates if the project asks for personal identifiable information.

notificationEmail String

The email address to receive notifications, if a project was paused due to conversion rules.

endOfFieldDate Date

Date survey is meant to end (yyyy-MM-dd or yyyy-MM-dd'T'HH:mm:ss'Z' format). Only used to evaluate project performance. Client must pause and close project when appropriate.

customerId String

Your internal ID for your customer.

customerManager String

The name of the manager of your internal customer.

contact Object

Primary contact for this project.

duplicationKey String[]

Duplication keys used by this project. (This field will only be present if the project is part of a group)

filterMode Integer

Indicates how the respondent will be considered as a duplicate in a group (based on starts or based on completes):

  1. Starts
  2. Completes

(This field will only be present if the project is part of a group)

quotaLimitBy String

Indicates if the quota limits are set by completes or starts. The possible values are:

  • completes
  • starts

(This field will only be present if the project has quotas)

excludedNonMatching Boolean

Indicates if respondents not matching any quotas will be rejected. (This field will only be included if the project has quotas)

alertColor Integer

Values are:

  1. No alert
  2. Purple
  3. Red
  4. Blue
  5. Yellow
  6. Green
  7. Magenta
  8. Orange
alertReasoning String

Cause of the alert.

datapoints Object[]

Array of datapoints used by the project.

quotas Object[]

Array of quotas, which contains the detail description of quotas for the project. (This field will only be included if the project has quotas)

callbacks Object
{
     "complete":Callback to use for completes,
     "terminate": Callback to use for terminates,
     "quota": Callback to use for over quotas,
     "security": Callback to use for security concerns
}
phoneSupported Integer

Survey can be displayed on a phone. Defaults to Unknown.

  1. Unknown
  2. Yes
  3. No
tabletSupported Integer

Survey can be displayed on a tablet. Defaults to Unknown.

  1. Unknown
  2. Yes
  3. No

Example Command

{
     command": "client/queryProject/1",
     rfg_id": "RFG12345-001"
}

Example Response

response: {
     pid: "1234",
     name: "Internal Survey 123456",
     title: "We need your opinion on this!",
     country: "US",
     state: 2
     ir: 60,
     lengthOfInterview: 15,
     surveyURL: "http://survey.server.com/survey/x123456?sesskey={sesskey}",
     desiredCompletes: 200,
     cpi: "$9.00",
     collectsPII: false,
     contact:{
          first: "Bob",
          last: "Jones",
          phone: "800-234- 5678",
          email: bjones@researchforgood.com
     },
     datapoints:[
          {
               name:"Age",
               values:[{min:14, max:17}],
               askOnly: false
          },
          {
               name:"Ethnicity (US)",
               values:[1,5,6],
               askOnly: false
          },
          {
               name:"Gender",
               values:[1,2],
               askOnly: false
          },
          {
               name:"Television Movies_AC",
               values:[3,4],
               askOnly: true
          },
     ],
     quotas:[
          {
               "datapoints":[
                    {
                         name:"Gender",
                         values:[1]
                    },
                    {
                         name:"Ethnicity (US)",
                         values:[3]
                    }
               ],
               limit:11,
               id: "RFG12345-001- q1"
          },
          {
               datapoints:[
                    {
                         name:"Gender",
                         values:[2]
                    },
                    {
                         name:"Ethnicity (US)",
                         values:[1]
                    }
               ],
               limit:4,
               id: "RFG12345-001- q2
          }
     ],
     quotaLimitBy: "completes",
     excludeNonMatching: false,
     notificationEmail: "notify@somewhere.com",
     endOfFieldDate: "2016-12- 20",
     customerId: "Acme 123",
     customerManager: "Joe Blow",
     duplicationKey: ["RFG12345-001", "8999"],
     filterMode: 0,
     mobileOptimized: true,
     surveyCategory: 22,
     callbacks:{
          complete:"http://survey.saysoforgood.com/result?result=C&sesskey={sesskey}",
          terminate:"http://survey.saysoforgood.com/result?result=T&sesskey={sesskey}",
          quota:"http://survey.saysoforgood.com/result?result=Q&sesskey={sesskey}",
          security:"http://survey.saysoforgood.com/result?result=S&sesskey={sesskey}"
     }
}