NAV Navbar
Logo
curl PHP Node.js

Supplier API

Innovate Supplier APIs provide a simple and quick way to pull down survey inventory available to supplier and match with user’s profile. With this, supplier will be able to get updated list of survey inventory, real time statistics for each survey and targeting questions to match with user’s profile.

Running in Postman

Postman Image

The entire Innovate 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. When making test calls, you should use the development environment.

Environments

Sandbox Endpoint

http://innovate-qa-1882932346.us-east-1.elb.amazonaws.com/api/v1/

Production Endpoint

https://supplier.innovatemr.net/api/v1/

Innovate has two environments—production and sandbox. The sandbox environment is used during development and for testing. There are no live respondents in this environment (although you may enter as a respondent). It is important to note that lookup libraries in the sandbox are different from those in production. Production should only be used once an application has been thoroughly tested in sandbox.

Lookup Question Library

Definition

GET http://<serverName>/api/v1/supply/getQuestionsByCategory/<CountryKey>

Example Request

curl -X GET -H "Content-Type: application/json" 
"x-access-token: YOUR_X-ACCESS-TOKEN_HERE"
"https://supplier.innovatemr.net/api/v1/supply/getQuestionsByCategory/US"
<?php
  $URL = "supplier.innovatemr.net/api/v1/supply/";

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

  $aHTTP['http']['header']  = "x-access-token: YOUR_X-ACCESS-TOKEN_HERE";

  $context = stream_context_create($aHTTP);

  $response = file_get_contents($URL, false, $context);
?>
var options = {
  "method": "GET",
  "hostname": "supplier.innovatemr.net",
  "path": "/api/v1/supply/getQuestionsByCategory/US",
  "headers": {
    "content-type": "application/json",
    "x-access-token": "YOUR_X-ACCESS-TOKEN_HERE",
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

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

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();

Example Response

{  
   "apiStatus":"success",
   "msg":"questions are successfully searched",
   "result":[  
      {  
         "_id":"56add7f8724a50667fb26992",
         "Category":"Red Herring",
         "QuestionText":"What is the color of Sky?",
         "QuestionType":"Single Punch",
         "QuestionKey":"RED_HERRING_12",
         "language":"ENGLISH"
      },
      {  
         "_id":"57908ce3efd424031efdf3ea",
         "Category":"Homeowner",
         "QuestionText":"In what year did you purchase your home?",
         "QuestionType":"Single Punch",
         "QuestionKey":"HOMEOWNER_123",
         "language":"ENGLISH"
      },
      {  
         "_id":"572731891f923856674832f6",
         "Category":"Testing Question",
         "QuestionText":"What is your Address?",
         "QuestionType":"Numeric Open Ended",
         "QuestionKey":"TESTING_QUESTION_2",
         "language":"ENGLISH"
      }
   ]
}


This API will allow supplier to pull down list of all questions associated with the specified country ( i.e. country passed in request). These questions are used as survey criteria and will be helpful to match user’s profile with survey criteria.

Query Parameters

Property Type Required Description
Country Key String Yes Country Key (like US)

Answer Lookup

Definition

GET http://<serverName>/api/v1/supply/getAnswersByQuesKey/<QuestionKey>

Example Request

curl -X GET -H "Content-Type: application/json" 
"x-access-token: YOUR_X-ACCESS-TOKEN_HERE"
"https://supplier.innovatemr.net/api/v1/supply/getAnswersByQuesKey/GENDER"
<?php
  $URL = "https://supplier.innovatemr.net/api/v1/supply/getAnswersByQuesKey/GENDER";

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

  $aHTTP['http']['header']  = "x-access-token: YOUR_X-ACCESS-TOKEN_HERE";

  $context = stream_context_create($aHTTP);

  $response = file_get_contents($URL, false, $context);
?>
var options = {
  "method": "GET",
  "hostname": "supplier.innovatemr.net",
  "path": "/api/v1/supply/getAnswersByQuesKey/GENDER",
  "headers": {
    "content-type": "application/json",
    "x-access-token": "YOUR_X-ACCESS-TOKEN_HERE",
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

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

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();

Example Response

{
  "apiStatus": "success",
  "msg": "Answers are successfully searched",
  "result": {
    "_id": "56adc7a616d95f226f2f2115",
    "QuestionText": "What is your gender?",
    "QuestionType": "Single Punch",
    "QuestionOptions": [
      {
        "OptionText": "Male",
        "id": 1
      },
      {
        "OptionText": "Female",
        "id": 2
      }
    ]
  }
}

API returns a list of all Answer options for the Question associated with the specified QuestionKey.

Query Parameters

Property Type Required Description
Question Key String Yes QuestionKey of the question (Example : GENDER)

Get Allocated Surveys (all live surveys)

Definition

GET http://<serverName>/api/v1/supply/getAllocatedSurveys

Example Request

curl -X GET -H "Content-Type: application/json" 
"x-access-token: YOUR_X-ACCESS-TOKEN_HERE"
"https://supplier.innovatemr.net/api/v1/supply/getAllocatedSurveys"
<?php
  $URL = "https://supplier.innovatemr.net/api/v1/supply/getAllocatedSurveys";

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

  $aHTTP['http']['header']  = "x-access-token: YOUR_X-ACCESS-TOKEN_HERE";

  $context = stream_context_create($aHTTP);

  $response = file_get_contents($URL, false, $context);
?>
var options = {
  "method": "GET",
  "hostname": "supplier.innovatemr.net",
  "path": "/api/v1/supply/getAllocatedSurveys",
  "headers": {
    "content-type": "application/json",
    "x-access-token": "YOUR_X-ACCESS-TOKEN_HERE",
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

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

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();

Example Response

{
  "apiStatus": "success",
  "msg": " All live groups are successfully searched",
  "result": [
    {
      "surveyId": 6545,
      "surveyName": "mail4",
      "N": 9,
      "isRevShr": true,
      "CPI": 3,
      "isQuota": false,
      "LOI": 1,
      "IR": 1,
      "Country": "United States",
      "Language": "ENGLISH",
      "jobCategory": "Beauty/Cosmetics",
      "groupType": "Consumer",
      "deviceType": "Desktop",
      "createdDate": "02/09/2017, 10:55:32 am PST",
      "modifiedDate": "02/09/2017, 10:55:32 am PST",
      "reContact": false,
      "entryLink": " http://localhost:3001/startSurvey?survNum=36mQWR6b&supCode=84&PID=[%%pid%%]",
      "testEntryLink": " http://localhost:3001/startSurvey?Test=1&NotLive=1&survNum=36mQWR6b&supCode=84&PID=[%%pid%%]",
      "targeting": [
        {
          "QuestionKey": "ZIPCODES",
          "QuestionText": "What is your zipcode?",
          "QuestionType": "Numeric Open Ended",
          "QuestionCategory":"Demographic",
          "Options": [
            {
              "OptionId": 1,
              "OptionText": "800235"
            }
          ]
        },
       {
           "QuestionKey":"AGE",
            "QuestionText":"What is your age?",
            "QuestionType":"Numeric Open Ended",
            "QuestionCategory":"Demographic",
             "Options":[
                {
                   "OptionId":1,
                   "ageStart":15,
                   "ageEnd":30
                }
             ]
         },
          {
               "QuestionKey":"GENDER",
               "QuestionText":"What is your gender?",
               "QuestionType":"Single Punch",
               "QuestionCategory":"Demographic",
               "Options":[
                  {
                     "OptionId":1,
                     "OptionText":"Male"
                  },
                  {
                     "OptionId":2,
                     "OptionText":"Female"
                  }
               ]
            },
      ]
    },
    {
      "surveyId": 6547,
      "surveyName": "tst 1",
      "N": 12,
      "isRevShr": true,
      "CPI": 0,
      "isQuota": false,
      "LOI": 5,
      "IR": 2,
      "Country": "United States",
      "Language": "ENGLISH",
      "jobCategory": "Automotive",
      "groupType": "",
      "deviceType": "Both",
      "createdDate": "02/25/2017, 10:55:32 am PST",
      "modifiedDate": "02/26/2017, 10:25:32 pm PST",
      "reContact": false,
      "entryLink": " http://localhost:3001/startSurvey?survNum=pvAB3RY3&supCode=84&PID=[%%pid%%]",
      "testEntryLink": " http://localhost:3001/startSurvey?Test=1&NotLive=1&survNum=pvAB3RY3&supCode=84&PID=[%%pid%%]",
      "targeting": []
    }
  ]
}

This API will allow supplier to pull down survey inventory associated with supplier’s account at Innovate. Survey list will be of only LIVE surveys.

Get Allocated Surveys By Date (live surveys only)

Definition

GET http://<serverName>/api/v1/supply/getAllocatedSurveysByDate/<Datetime>

Example Request

curl -X GET -H "Content-Type: application/json" 
"x-access-token: YOUR_X-ACCESS-TOKEN_HERE"
"https://supplier.innovatemr.net/api/v1/supply/getAllocatedSurveysByDate/2016-10-11T13:35:11.364Z"
<?php
  $URL = "https://supplier.innovatemr.net/api/v1/supply/getAllocatedSurveysByDate/2016-10-11T13:35:11.364Z";

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

  $aHTTP['http']['header']  = "x-access-token: YOUR_X-ACCESS-TOKEN_HERE";

  $context = stream_context_create($aHTTP);

  $response = file_get_contents($URL, false, $context);
?>
var options = {
  "method": "GET",
  "hostname": "supplier.innovatemr.net",
  "path": "/api/v1/supply/getAllocatedSurveysByDate/2016-10-11T13:35:11.364Z",
  "headers": {
    "content-type": "application/json",
    "x-access-token": "YOUR_X-ACCESS-TOKEN_HERE",
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

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

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();

Example Response

{
  "apiStatus": "success",
  "msg": " All live groups are successfully searched",
  "result": [
    {
      "surveyId": 6545,
      "surveyName": "mail4",
      "N": 9,
      "isRevShr": false,
      "CPI": 3,
      "LOI": 1,
      "IR": 1,
      "Country": "United States",
      "Language": "ENGLISH",
      "jobCategory": "Beauty/Cosmetics",
      "groupType": "Consumer",
      "deviceType": "Desktop",
      "createdDate": "03/20/2017, 10:15:20 am PST",
      "modifiedDate": "03/20/2017, 10:15:20am PST",
      "reContact": false,
      "entryLink": " http://localhost:3001/startSurvey?survNum=36mQWR6b&supCode=84&PID=[%%pid%%]",
      "testEntryLink": " http://localhost:3001/startSurvey?Test=1&NotLive=1&survNum=36mQWR6b&supCode=84&PID=[%%pid%%]",
      "targeting": [
        {
          "QuestionKey": "ZIPCODES",
          "QuestionText": "What is your zipcode?",
          "QuestionType": "Numeric Open Ended",
          "QuestionCategory": "Geographic",
          "Options": [
            {
              "OptionId": 1,
              "OptionText": "800235"
            }
          ]
        }
      ],
      "isQuota": false
    },
    {
      "surveyId": 6547,
      "surveyName": "tst 1",
      "N": 12,
      "isRevShr": false,
      "CPI": 0,
      "LOI": 5,
      "IR": 2,
      "Country": "United States",
      "Language": "ENGLISH",
      "jobCategory": "Automotive",
      "groupType": "",
      "deviceType": "Both",
      "createdDate": "03/25/2017, 12:15:20 am PST",
      "modifiedDate": "03/26/2017, 10:15:20 pm PST",
      "reContact": false,
      "entryLink": " http://localhost:3001/startSurvey?survNum=pvAB3RY3&supCode=84&PID=[%%pid%%]",
      "testEntryLink": " http://localhost:3001/startSurvey?Test=1&NotLive=1&survNum=pvAB3RY3&supCode=84&PID=[%%pid%%]",
      "targeting": [],
      "isQuota": false
    }
  ]
}

API returns a list of all LIVE surveys allocated to supplier’s account updated or created after certain datetime.

Query Parameters

Property Type Required Description
Date Time String Yes Date and time of the live surveys (Example : 2016-10-11T13:35:11.364Z)

Get Quota for Survey

Definition

GET http://<serverName>/api/v1/supply/getQuotaForSurvey/<surveyId>

Example Request

curl -X GET -H "Content-Type: application/json" 
"x-access-token: YOUR_X-ACCESS-TOKEN_HERE"
"https://supplier.innovatemr.net/api/v1/supply/getQuotaForSurvey/6299"
<?php
  $URL = "https://supplier.innovatemr.net/api/v1/supply/getQuotaForSurvey/6299";

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

  $aHTTP['http']['header']  = "x-access-token: YOUR_X-ACCESS-TOKEN_HERE";

  $context = stream_context_create($aHTTP);

  $response = file_get_contents($URL, false, $context);
?>
var options = {
  "method": "GET",
  "hostname": "supplier.innovatemr.net",
  "path": "/api/v1/supply/getQuotaForSurvey/6299",
  "headers": {
    "content-type": "application/json",
    "x-access-token": "YOUR_X-ACCESS-TOKEN_HERE",
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

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

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();

Example Response

{
  "apiStatus": "success",
  "msg": "Quotas are successfully searched",
  "result": [
    {
      "_id": "580dfcb9e71d69327b54b3e9",
      "quotaN": 22,
      "title": " White Black or African American & Cricket And Football",
      "hardStopType": 0,
      "cmp": 6,
      "clk": 10,
      "hardStop": 0,
      "quotaStatus": "Open",
      "RemainingN": 1,
      "targeting": {
        "STATE": [
          {
            "OptionText": "ALABAMA",
            "OptionId": 2
          }
        ]
      }
    },
    {
      "_id": "580dedb0e704944b5ef5a738",
      "quotaN": 11,
      "title": " 15 - 30 White Black or African American & Cricket And Football",
      "hardStopType": 0,
      "cmp": 6,
      "clk": 10,
      "hardStop": 1,
      "quotaStatus": "Open",
      "RemainingN": 1,
      "targeting": {
        "GENDER": [
          {
            "OptionId": 1,
            "OptionText": "Male"
          },
          {
            "OptionId": 2,
            "OptionText": "Female"
          }
        ],
        "ETHNICITY": [
          {
            "OptionId": 1,
            "OptionText": "White"
          },
          {
            "OptionId": 2,
            "OptionText": "Black or African American"
          },
          {
            "OptionId": 3,
            "OptionText": "American Indian or Alaska Native"
          },
          {
            "OptionId": 4,
            "OptionText": "Asian-Asian Indian"
          }
        ]
      }
    }
  ]
}

This API will allow supplier to get quotas associated with each survey. Each quota will be returned with sample size and targeting criteria.

Query Parameters

Property Type Required Description
Survey ID Integer Yes Survey Id of particular survey (like : 6299)

Set Redirect Method for Survey

Definition

PUT http://<serverName>/api/v1/supply/setRedirectionForSurvey/<surveyId>

Example Request

curl -X PUT -H "Content-Type: application/json" 
"x-access-token: YOUR_X-ACCESS-TOKEN_HERE"
"https://supplier.innovatemr.net/api/v1/supply/setRedirectionForSurvey/6544"
<?php
  $URL = "https://supplier.innovatemr.net/api/v1/supply/setRedirectionForSurvey/6544";

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

  $aHTTP['http']['header']  = "x-access-token: YOUR_X-ACCESS-TOKEN_HERE";

  $context = stream_context_create($aHTTP);

  $response = file_get_contents($URL, false, $context);
?>
var options = {
  "method": "PUT",
  "hostname": "supplier.innovatemr.net",
  "path": "/api/v1/supply/setRedirectionForSurvey/6544",
  "headers": {
    "content-type": "application/json",
    "x-access-token": "YOUR_X-ACCESS-TOKEN_HERE",
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

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

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();

Example Response

{
  "apiStatus": "success",
  "msg": "Redirection Methods updated successfully"
}

With this API, supplier should be able to update redirect URLs or Pixels for each survey. By default, supplier’s global redirect and URLs will be used for each survey associated with supplier’s account. This API allows supplier to update the same at survey level. Global redirect URLs and Pixels for supplier’s account will remain as it is.

Query Parameters

Property Type Required Description
sUrl String NO Survey Success Url
fUrl String NO Fail Survey Url
oUrl String NO Overquota Survey Url
qTUrl String NO Quality Termination Survey Url
pstbck String NO Success Postback
pstbck_fail String NO Postback Fail

Get PIDs for re-contact surveys (studies)

Definition

GET http://<serverName>/api/v1/supply/getPidsForRecontactSurvey/<surveyId>

Example Request

curl -X GET -H "Content-Type: application/json" 
"x-access-token: YOUR_X-ACCESS-TOKEN_HERE"
"https://supplier.innovatemr.net/api/v1/supply/getPidsForRecontactSurvey/6299"
<?php
  $URL = "https://supplier.innovatemr.net/api/v1/supply/getPidsForRecontactSurvey/6299";

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

  $aHTTP['http']['header']  = "x-access-token: YOUR_X-ACCESS-TOKEN_HERE";

  $context = stream_context_create($aHTTP);

  $response = file_get_contents($URL, false, $context);
?>
var options = {
  "method": "GET",
  "hostname": "supplier.innovatemr.net",
  "path": "/api/v1/supply/getPidsForRecontactSurvey/6299",
  "headers": {
    "content-type": "application/json",
    "x-access-token": "YOUR_X-ACCESS-TOKEN_HERE",
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

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

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();

Example Response

{
  "apiStatus": "success",
  "msg": "PIDs are successfully searched",
  "result": {
    "exclude": [
      "57974767f92c2ed94208a507",
      "57d7c450707c3d6220489230",
      "57ac5ae0707c3d095f4886eb"
    ],
    "include": [
      "57f255a5707c3d3a76410182",
      "572adfc1f92c2e971efb7678"
    ]
  }
}

This API allows suppliers to pull down list of PIDs (user Ids) for re-contact studies. When re-contact flag is True in Survey details, this API should be used to pull down user Ids associated with Supplier’s traffic.

Query Parameters

Property Type Required Description
Survey ID Integer Yes Survey Id of particular survey (like : 6299)

Get Closed Survey List (allocated to supplier only)

Definition

GET http://<surveyName>/api/v1/supply/getClosedSurveyListByDate/<Datetime>

Example Request

curl -X GET -H "Content-Type: application/json" 
"x-access-token: YOUR_X-ACCESS-TOKEN_HERE"
"https://supplier.innovatemr.net/api/v1/supply/getClosedSurveyListByDate/2016-10-11T13:35:11.364Z"
<?php
  $URL = "https://supplier.innovatemr.net/api/v1/supply/getClosedSurveyListByDate/2016-10-11T13:35:11.364Z";

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

  $aHTTP['http']['header']  = "x-access-token: YOUR_X-ACCESS-TOKEN_HERE";

  $context = stream_context_create($aHTTP);

  $response = file_get_contents($URL, false, $context);
?>
var options = {
  "method": "GET",
  "hostname": "supplier.innovatemr.net",
  "path": "/api/v1/supply/getClosedSurveyListByDate/2016-10-11T13:35:11.364Z",
  "headers": {
    "content-type": "application/json",
    "x-access-token": "YOUR_X-ACCESS-TOKEN_HERE",
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

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

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();

Example Response

{
  "apiStatus": "success",
  "msg": "closed Survey IDs are successfully searched",
  "result": [
         6304,
         6548,
         6547
   ]
}

This API returns list of all Closed survey Ids which were allocated to Supplier’s account. Closed surveys after certain date time will be returned in this list. Using this list, Supplier should be able to archive such closed surveys from list.

Query Parameters

Property Type Required Description
Date Time String Yes Date and time of the closed survey (Example : 2016-10-11T13:35:11.364Z)

Get survey stats

Definition

GET http://<severName>/api/v1/supply/getSurveyStats/<surveyKey>

Example Request

curl -X GET -H "Content-Type: application/json" 
"x-access-token: YOUR_X-ACCESS-TOKEN_HERE"
"https://supplier.innovatemr.net/api/v1/supply/getSurveyStats/6614"
<?php
  $URL = "https://supplier.innovatemr.net/api/v1/supply/getSurveyStats/6614";

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

  $aHTTP['http']['header']  = "x-access-token: YOUR_X-ACCESS-TOKEN_HERE";

  $context = stream_context_create($aHTTP);

  $response = file_get_contents($URL, false, $context);
?>
var options = {
  "method": "GET",
  "hostname": "supplier.innovatemr.net",
  "path": "/api/v1/supply/getSurveyStats/6614",
  "headers": {
    "content-type": "application/json",
    "x-access-token": "YOUR_X-ACCESS-TOKEN_HERE",
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

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

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();

Example Response

{
  "apiStatus": "success",
  "msg": "Survey Stats are successfully searched",
  "result": {
    "isVerified": true,
    "clicks": 4,
    "surveyStarts": 4,
    "completes": 4,
    "completesValid": 3,
    "completesInvalid": 1,
    "completesPending": 0,
    "fails": 0,
    "overQuota": 0,
    "qualityTerms": 0,
    "preSurveyTerminates": 0,
    "preSurveyOverQuota": 0,
    "preSurveyQualityTermination": 0,
    "averageLOI": "0.06",
    "revenue": 0.78,
    "Conversion": "75.00"
  }
}

This API allows suppliers to get real time statistics for allocated survey. This will return data like number of clicks, completes, fails, over quota, revenue etc. for supplier’s traffic.

Query Parameters

Property Type Required Description
Survey ID Integer Yes Survey Id of particular survey (like : 6614)

Get Survey Transactions data

Definition

GET http://<serverName>/api/v1/supply/getSurveyTransactions/<surveyId>?startDate=yyyy-mm-dd&endDate=yyyy-mm-dd

Example Request

curl -X GET -H "Content-Type: application/json" 
"x-access-token: YOUR_X-ACCESS-TOKEN_HERE"
"https://supplier.innovatemr.net/api/v1/supply/getSurveyTransactions/6299?startDate=2017-01-02&endDate=2017-02-10"
<?php
  $URL = "https://supplier.innovatemr.net/api/v1/supply/getSurveyTransactions/6299?startDate=2017-01-02&endDate=2017-02-10";

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

  $aHTTP['http']['header']  = "x-access-token: YOUR_X-ACCESS-TOKEN_HERE";

  $context = stream_context_create($aHTTP);

  $response = file_get_contents($URL, false, $context);
?>
var options = {
  "method": "GET",
  "hostname": "supplier.innovatemr.net",
  "path": "/api/v1/supply/getSurveyTransactions/6299?startDate=2017-01-02&endDate=2017-02-10",
  "headers": {
    "content-type": "application/json",
    "x-access-token": "YOUR_X-ACCESS-TOKEN_HERE",
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

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

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();

Example Response

{
  "apiStatus": "success",
  "msg": "Survey Transactions are successfully searched",
  "result": [
    {
      "ip": "::ffff:127.0.0.1",
      "verifyToken": "Valid",
      "termReason": "",
      "verifiedTknDt": "05/03/2017, 4:50:09 am PST",
      "CPI": "0.26",
      "PID": "test2",
      "token": "TryFHNHPkb",
      "surveyUrl":"http://demo2.ongraph.com/demo/onj/Survey/v1/survey-qa.php?tk=TryFHNHPkb&pid=test2",
      "st_date_time": "05/03/2017, 4:50:19 am PST",
      "clkDateTime": "05/03/2017, 4:50:00 am PST",
      "completeDateTime": "05/03/2017, 4:50:38 am PST",
      "status": "Completed"
    }
  ]
}

This API allows supplier to download transactional data for each survey with fields like PID (supplier user Id), survey transaction status, IP Address, survey start time, survey end time etc.

Query Parameters

Property Type Required Description
Survey ID Integer Yes Survey Id of particular survey (like : 6299)
Start Date String Yes - if End Date is present Start Date is beginning date (like : 2017-01-02)
End Date String Yes - if Start Date is present End Date is ending date (like :2017-02-10)

Get Survey Transactions data By PID and survey number

Definition

GET http://<serverName>/api/v1/supply/getSurveyTransactionsByCond/<surveyId>/<PID>

Example Request

curl -X GET -H "Content-Type: application/json" 
"x-access-token: YOUR_X-ACCESS-TOKEN_HERE"
"https://supplier.innovatemr.net/api/v1/supply/getSurveyTransactionsByCond/6555/9834540538942"
<?php
  $URL = "https://supplier.innovatemr.net/api/v1/supply/getSurveyTransactionsByCond/6555/9834540538942";

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

  $aHTTP['http']['header']  = "x-access-token: YOUR_X-ACCESS-TOKEN_HERE";

  $context = stream_context_create($aHTTP);

  $response = file_get_contents($URL, false, $context);
?>
var options = {
  "method": "GET",
  "hostname": "supplier.innovatemr.net",
  "path": "/api/v1/supply/getSurveyTransactionsByCond/6555/9834540538942",
  "headers": {
    "content-type": "application/json",
    "x-access-token": "YOUR_X-ACCESS-TOKEN_HERE",
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

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

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();

Example Response

{  
   "apiStatus":"success",
   "msg":"Survey Transactions are successfully searched",
   "result":[  
      {  
        "id": "TS10Najayb",
        "ip": "::ffff:127.0.0.1",
        "verifyToken": "Valid",
        "termReason": "",
        "verifiedTknDt": "05/08/2017, 1:51:04 am PST",
        "CPI": "0.26",
        "surveyUrl": "http://demo2.ongraph.com/demo/onj/Survey/v1/survey-qa.php?tk=TS10Najayb&pid=94~test1",
        "st_date_time": "05/08/2017, 1:37:27 am PST",
        "clkDateTime": "05/08/2017, 1:37:27 am PST",
        "completeDateTime": "05/08/2017, 1:37:43 am PST",
        "status": "Completed"
      }
   ]
}

This API allows suppliers to get specific survey transaction record associated with PID (supplier user Id) and survey Id.

Query Parameters

Property Type Required Description
Survey ID Integer Yes Survey Id of particular survey (like : 6555)
PID String Yes Panelist Id (like : 9834540538942)

Get Survey Transactions data By Date Range

Definition

GET http://<serverName>/api/v1/supply/getSurveyTransactionsByDateRange?startDate=yyyy-mm-dd&endDate=yyyy-mm-dd

Example Request

curl -X GET -H "Content-Type: application/json" 
"x-access-token: YOUR_X-ACCESS-TOKEN_HERE"
"https://supplier.innovatemr.net/api/v1/supply/getSurveyTransactionsByDateRange?startDate=2017-01-02&endDate=2017-02-10"
<?php
  $URL = "https://supplier.innovatemr.net/api/v1/supply/getSurveyTransactionsByDateRange?startDate=2017-01-02&endDate=2017-02-10";

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

  $aHTTP['http']['header']  = "x-access-token: YOUR_X-ACCESS-TOKEN_HERE";

  $context = stream_context_create($aHTTP);

  $response = file_get_contents($URL, false, $context);
?>
var options = {
  "method": "GET",
  "hostname": "supplier.innovatemr.net",
  "path": "/api/v1/supply/getSurveyTransactionsByDateRange?startDate=2017-01-02&endDate=2017-02-10",
  "headers": {
    "content-type": "application/json",
    "x-access-token": "YOUR_X-ACCESS-TOKEN_HERE",
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

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

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();

Example Response

{  
   "apiStatus":"success",
   "msg":"Survey Transactions are successfully searched",
   "result":[  
    {
      "id": "TSkFl1sWOg",
      "ip": "::ffff:127.0.0.1",
      "verifyToken": "Pending",
      "termReason": "",
      "grp": { } ,
      "CPI": 0,
      "PID": "feTestr",
      "surveyUrl":"http://demo2.ongraph.com/demo/onj/Survey/v1/survey-local.php?tk=TSkFl1sWOg&pid=248~feTestr",
      "st_date_time": "03/20/2017, 12:45:40 am PST",
      "clkDateTime": "03/20/2017, 12:45:39 am PST",
      "completeDateTime": "03/20/2017, 12:46:00 am PST",
      "surveyId": 6947,
      "status": "Completed"
    },
    {
     "id": "THJRt1s-ul",
     "ip": "::ffff:127.0.0.1",
     "verifyToken": "Valid",
     "termReason": "",
     "verifiedTknDt" : "05/01/2017, 4:53:00 am PST",
     "grp": { },
     "CPI": 0,
     "PID": "feTestr1",
     "surveyUrl": "http://demo2.ongraph.com/demo/onj/Survey/v1/survey-local.php?tk=THJRt1s-ul&pid=257~feTestr1",
     "st_date_time": "03/20/2017, 12:46:31 am PST",
     "clkDateTime": "03/20/2017, 12:46:31 am PST",
     "completeDateTime": "03/20/2017, 12:46:42 am PST",
     "surveyId": 6947,
     "status": "Completed"
    }
  ] 
}

This API allows suppliers to get survey transaction records associated within the specified date range.

Query Parameters

Property Type Required Description
Start Date String Yes Start Date is beginning date (like : 2017-01-02)
End Date String Yes End Date is ending date (like :2017-02-10)

HTTP Status Codes

Innovate uses 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 Fulcrum’s servers (these are rare).

Status Code Meaning
200 OK – The request has succeeded . Request include GET and POST
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.
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 Allowed – 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)
406 Not Acceptable – You requested a format that isn’t json
410 Gone – The kitten requested has been removed from our servers
418 I’m a teapot
429 Too Many Requests – You’re requesting too many kittens! Slow down!
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarially offline for maintanance. Please try again later.
504 Gateway Timeout – This error response is given when the server is acting as a gateway and cannot get a response in time.