SecondPrism Integrated Apps

JSON API Overview

	JSON Format Overview :						
	{ "response" : { 
			// Payload - This is where the charting data is
			// This contains a chartCollection
			"chartCollection" : [ 
			// This contains an ID, charts and a numericTitle
			{ "chartCollectionID" : 3509580,
            				"charts" : [ ... ], //
            "numericTitle" : 3, // This is used to display the response count- See UI below
            "title" : "QuestionPro : Newsletter" // Title show on the My Data page
          } ],
      "clientLicense" : [ { ...}, // license information
          { "key" : "service",
            "title" : "Service",
            "value" : "ServiceName"
          }
        ],
      "emailAddress" : "test@test.com",
      "id" : 974511
    },
  "status" : { // Status information should be at the same level as response 
   // see examples below
    }
}


How the JSON value are used in the My Data UI:



Sample Bar Chart JSON:


        "charts": [
          {
            "id": 26176443,
            "datapoints": [
              {
                "id": 122515133,
                " title": "Answer 1",
                "frequency": 5
              },
              {
                "id": 122515134,
                "title": "Answer 2",
                "frequency": 5
              },
              {
                "id": 122515135,
                "title": "Answer 3",
                "frequency": 1
              }
            ],
            "title": "Question Text",
            "type": "BarChart"
          }
        ],
        "title": "Multi-Lingual",
        "subtitle": "12/21/2011"
      }
  


Sample Pie Chart JSON:


           "charts": [
          {
            "id": 25733025,
            "datapoints": [
              {
                "id": 120388671,
                "title": "Yes",
                "frequency": 148
              },
              {
                "id": 120388672,
                "title": "No",
                "frequency": 116
              },
              {
                "id": 120388673,
                "title": "Prefer not to say",
                "frequency": 54
              }
            ],
            "title": "Do you have any children?",
            "type": "PieChart"
          }
  


Sample Line Chart JSON:


        "charts": [
          {
            "id": 25733050,
            "datapoints": [
              {
                "id": 120388790,
                "title": "Weekly",
                "frequency": 75
              },
              {
                "id": 120388791,
                "title": "Monthly",
                "frequency": 74
              },
              {
                "id": 120388792,
                "title": "Qu arterly",
                "frequency": 60
              },
              {
                "id": 120388793,
                "title": "Annually",
                "frequency": 44
              }
            ],
            "title": "How often do you  conduct surveys?",
            "type": "LineChart"
          }
  


Dashboard Chart with World Map JSON:

{ "response" : { "chartCollection" :
    [ { "chartCollectionID" : 3517823,
        "charts" : [
                {
                    "groupID" : "dashboardGroup",
                    "numberpoints" :
                    [ { "index" : "1",
                        "subtitle" : "Started",
                        "title" : 1,
                        "type" : "started"
                        },
                      { "index" : "2",
                        "subtitle" : "Completed",
                        "title" : 1,
                        "type" : "completed"
                        },
                      { "index" : "3",
                        "subtitle" : "Completion Rate",
                        "title" : "1000%",
                        "type" : "completion-rate"
                      },
                      { "index" : "4",
                    	"subtitle" : "Viewed",
                    	"title" : 1,
                    	"type" : "viewed"
                      },
                      { "index" : "5",
                    	"subtitle" : "Drop Out",
                    	"title" : 0,
                    	"type" : "dropout"
                      },
                      { "index" : "6",
                    	"subtitle" : "Avg. Time Taken",
                    	"title" : "8s",
                    	"type" : "time-taken"
                      }
                     ],
                      "title" : "0 Countries",
                      "type" : "Dashboard"
                      },
                      
                      {"datapoints":[
                                     {"title":"US",
                                      "subtitle":"United States",
                                      "frequency":1}],
                    	  "title":"Countries Surveyed",
                    	  "groupID":"countryGroup",
                    	  "type":"WorldMap"},
                      

                      { "datapoints" : [  ],
                      "title" : "Daily Responses",
                      "type" : "BarChart"
                      }
                  ],
          "filter" : { "filterpoints" : [  ] },
          "groups" : [ { "groupElements" : [ "dashboardGroup",
                                            "countryGroup"
                                             ],
                      "id" : "dashboardGroup",
                      "title" : "Dashboard"
                      } ],
                  "numericTitle" : 1,
                  "title" : "Contact Us"
                  }

                                    ],
    "clientLicense" : [ { "index" : 1,
                       "key" : "customerID",
                       "title" : "Customer ID",
                       "value" : 471096
                       },
                       { "key" : "service",
                       "title" : "Service",
                       "value" : "QuestionPro"
                       }
                       ],
    "emailAddress" : "test@gmail.com",
    "id" : 471096
},
"status" : { "id" : 200,
        "message" : "OK",
        "method" : "surveyanalytics.secondprism.getSurveysForFolder",
        "serverUTC" : 1369253817571,
        "url" : "/a/restApiII/surveyanalytics.secondprism.getSurveysForFolder"
    }
}


Example Dashboard UI:


Example JSON:

{
  "response": {
    "id": 1097380,
    "chartCollection": [
      {
        "charts": [
          {
            "id": 26176443,
            "datapoints": [
              {
                "id": 122515133,
                " title": "Answer 1",
                "frequency": 5
              },
              {
                "id": 122515134,
                "title": "Answer 2",
                "frequency": 5
              },
              {
                "id": 122515135,
                "ti tle": "Answer 3",
                "frequency": 1
              }
            ],
            "title": "Question Text",
            "type": "BarChart"
          }
        ],
        "title": "Multi-Lingual",
        "subtitle": "12/21/2011"
      },
      {
        "charts": [
          {
            "id": 25733025,
            "datapoints": [
              {
                "id": 120388671,
                "title": "Yes",
                "frequenc y": 148
              },
              {
                "id": 120388672,
                "title": "No",
                "frequency": 116
              },
              {
                "id": 120388673,
                "title": "Prefer not to say",
                "fre quency": 54
              }
            ],
            "title": "Do you have any children?",
            "type": "PieChart"
          },
          {
            "id": 24465091,
            "datapoints": [
              {
                "id": 113606419,
                "title": "Visa",
                "frequency": 187
              },
              {
                "id": 113606420,
                "title": "Mastercard",
                "frequency": 160
              },
              {
                "id": 113606421,
                "title": "American Express",
                "frequency": 95
              },
              {
                "id": 113606422,
                "title": "Discover",
                "frequency": 55
              },
              {
                "id": 113606423,
                "title": "Diners Club",
                "frequency": 47
              }
            ],
            "title": "What types of credit cards do you h ave (Select all that apply)?",
            "type": "BarChart"
          },
          {
            "id": 25733050,
            "datapoints": [
              {
                "id": 120388790,
                "title": "Weekly",
                "frequency": 75
              },
              {
                "id": 120388791,
                "title": "Monthly",
                "frequency": 74
              },
              {
                "id": 120388792,
                "title": "Qu arterly",
                "frequency": 60
              },
              {
                "id": 120388793,
                "title": "Annually",
                "frequency": 44
              }
            ],
            "title": "How often do you  conduct surveys?",
            "type": "LineChart"
          },
          {
            "id": 25733066,
            "datapoints": [
              {
                "id": 120388857,
                "title": "Very Unsa tisfied",
                "frequency": 17
              },
              {
                "id": 120388858,
                "title": "Unsatisfied",
                "frequency": 34
              },
              {
                "id": 120388859,
                "title": "Neutral",
                "frequency": 43
              },
              {
                "id": 120388860,
                "title": "Satisfied",
                "frequency": 24
              },
              {
                "id": 120388861,
                "title": "Very Satisfied",
                "frequency": 11
              }
            ],
            "title": "Website",
            "type": "BarChart"
          },
          {
            "id": 25733067,
            "datapoints": [
              {
                "id": 120388862,
                "title": "Very Unsatisfied",
                "frequency": 14
              },
              {
                "id": 120388863,
                "title": "Unsatisfied",
                "frequ ency": 21
              },
              {
                "id": 120388864,
                "title": "Neutral",
                "frequency": 41
              },
              {
                "id": 120388865,
                "title": "Satisfied",
                "frequ ency": 18
              },
              {
                "id": 120388866,
                "title": "Very Satisfied",
                "frequency": 18
              }
            ],
            "title": "Customer Service",
            "type": "BarChart"
          },
          {
            "id": 25733068,
            "datapoints": [
              {
                "id": 120388867,
                "title": "Very Unsatisfied",
                "frequency": 10
              },
              {
                " id": 120388868,
                "title": "Unsatisfied",
                "frequency": 28
              },
              {
                "id": 120388869,
                "title": "Neutral",
                "frequency": 23
              },
              {
                "id": 120388870,
                "title": "Satisfied",
                "frequency": 20
              },
              {
                "id": 120388871,
                "title": "Very Satisfied",
                "frequenc y": 12
              }
            ],
            "title": "Overall",
            "type": "BarChart"
          },
          {
            "id": 25733098,
            "datapoints": [
              {
                "id": 120389029,
                "title": "Ess entials (Gas, Grocery etc.)",
                "frequency": 5981
              },
              {
                "id": 120389030,
                "title": "Entertainment (Movies, Clubs e tc.)",
                "frequency": 3464
              },
              {
                "id": 120389031,
                "title": "Other",
                "frequency": 2728
              }
            ],
            "title": "Please allocate 10 0 points on how you spend your income:",
            "type": "BarChart"
          },
          {
            "id": 26286523,
            "datapoints": [
              {
                "id": 123083443,
                "title": "Wheat Norwegian Buhund",
                "frequency": 3
              },
              {
                "id": 123083444,
                "title": "Black Norwegian Buhund",
                "fr equency": 3
              }
            ],
            "title": "Which color of Norwegian Buhund do you prefer?",
            "type": "BarChart"
          },
          {
            "id": 26286525,
            "datapoints": [
              {
                "id": 123083451,
                "title": "Kitten in a frog hat",
                "frequency": 2
              },
              {
                "id": 123083452,
                "title": "Lion love",
                "frequency": 2
              },
              {
                "id": 123083453,
                "title": "Puppy kiss",
                "frequency": 4
              },
              {
                "id": 123083454,
                "title": "Cute puppies",
                "frequency": 1
              }
            ],
            "title": "What picture(s) do you think are cute (Select all that apply) ?",
            "type": "BarChart"
          }
        ],
        "title": "Application Demonstration",
        "subtitle": "07/28/2011",
        "numericTitle": 2
      }
    ],
    "emailAddress": "test@test.com",
    "clientLicense": [
      {
        "index": 1,
        "title": "Customer ID",
        "value": 1097380,
        "key": "customerID"
      },
      {
        "title": "Service",
        "value": "SurveyAnalytics",
        "key": "service"
      }
    ]
  },
  "status": {
    "message": "OK",
    "id": 200,
    "method": "surveyanalytics.secondprism.register",
    "serverUTC": 1326233141127,
    "url": "/a /api/surveyanalytics.secondprism.register",
    "apiKey": "2fb9f2d0-bacd-4bcf-87af-61680a5b1ef2"
  }
}