{"_id":"58112e72ded0340f0085d043","parentDoc":null,"project":"551e85be610f400d00837db7","version":{"_id":"58112e71ded0340f0085d02a","project":"551e85be610f400d00837db7","__v":4,"createdAt":"2016-10-26T22:30:09.862Z","releaseDate":"2016-10-26T22:30:09.862Z","categories":["58112e72ded0340f0085d02b","58112e72ded0340f0085d02c","58112e72ded0340f0085d02d","58112e72ded0340f0085d02e","58112e72ded0340f0085d02f","58112e72ded0340f0085d030","58112e72ded0340f0085d031","58112e72ded0340f0085d032","58112e72ded0340f0085d033","58112e72ded0340f0085d034","581137cc604d3c230048b7e4","58dc367221742d0f00a73f98","590768e54669da0f00db5c0b"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"new designer","version_clean":"2.0.0","version":"2.0"},"category":{"_id":"58112e72ded0340f0085d032","project":"551e85be610f400d00837db7","__v":0,"version":"58112e71ded0340f0085d02a","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-17T19:28:09.961Z","from_sync":false,"order":7,"slug":"merchant-api-methods","title":"Merchant API Methods"},"user":"55694ec671f3960d00b1e754","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-09-20T23:40:28.831Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":7,"body":"The following methods operate on the [Product Survey Results data model](doc:product-survey-results).\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint list\\\">\\n  <span class=\\\"method get\\\">GET</span>\\n  <span class=\\\"uri\\\">\\n    http://api.cratejoy.com/v1/product_survey_results/\\n  </span>\\n</div>\"\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint list\\\">\\n  <span class=\\\"method get\\\">GET</span>\\n  <span class=\\\"uri\\\">\\n\\t\\thttps://api.cratejoy.com/v1/product_survey_results/{result_id}/\\n  </span>\\n</div>\"\n}\n[/block]\n# List product survey results\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint\\\">\\n  <span class=\\\"method get\\\">GET</span>\\n  <span class=\\\"uri\\\">\\n    http://api.cratejoy.com/v1/product_survey_results/\\n  </span>\\n</div>\\n\\n\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$.get('https://api.cratejoy.com/v1/product_survey_results/');\",\n      \"language\": \"javascript\",\n      \"name\": \"List\"\n    },\n    {\n      \"code\": \"$.get('https://api.cratejoy.com/v1/product_survey_results/?&limit=1&page=1&subscription_id=262294062');\",\n      \"language\": \"javascript\",\n      \"name\": \"Filtered list\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"count\\\": 1,\\n  \\\"next\\\": null,\\n  \\\"prev\\\": null,\\n  \\\"results\\\": [\\n    {\\n      \\\"answers\\\": [\\n        {\\n          \\\"field\\\": {\\n            \\\"id\\\": 262290128,\\n            \\\"survey\\\": {\\n              \\\"id\\\": 262290126,\\n              \\\"type\\\": \\\"product_survey\\\"\\n            },\\n            \\\"survey_id\\\": 262290126,\\n            \\\"type\\\": \\\"product_survey_field\\\"\\n          },\\n          \\\"field_id\\\": 262290128,\\n          \\\"id\\\": 262294081,\\n          \\\"value\\\": \\\"My favorite color is red.\\\"\\n        }\\n      ],\\n      \\\"created_at\\\": \\\"Thu, 14 Apr 2016 19:44:35 GMT\\\",\\n      \\\"id\\\": 262294080,\\n      \\\"subscription_id\\\": 262294062,\\n      \\\"type\\\": \\\"product_survey_result\\\",\\n      \\\"updated_at\\\": \\\"Thu, 14 Apr 2016 19:44:35 GMT\\\",\\n      \\\"url\\\": \\\"/v1/product_survey_results/262294080/\\\"\\n    }\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response: 200 OK\"\n    }\n  ]\n}\n[/block]\n_See [Product Survey Results](doc:product-survey-results) documentation for a complete list of filters and relationships._\n\n# Get product survey result\n[block:html]\n{\n  \"html\": \"<div class=\\\"endpoint\\\">\\n  <span class=\\\"method get\\\">GET</span>\\n  <span class=\\\"uri\\\">\\n\\t\\thttps://api.cratejoy.com/v1/product_survey_results/{result_id}/\\n  </span>\\n</div>\\n\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$.get('https://api.cratejoy.com/v1/product_survey_results/262294080/');\",\n      \"language\": \"javascript\",\n      \"name\": \"Example\"\n    }\n  ]\n}\n[/block]\nPulls the results with a given ID.\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"answers\\\": [\\n    {\\n      \\\"field\\\": {\\n        \\\"id\\\": 262290129,\\n        \\\"survey\\\": {\\n          \\\"id\\\": 262290126,\\n          \\\"type\\\": \\\"product_survey\\\"\\n        },\\n        \\\"survey_id\\\": 262290126,\\n        \\\"type\\\": \\\"product_survey_field\\\"\\n      },\\n      \\\"field_id\\\": 262290128,\\n      \\\"id\\\": 262294081,\\n      \\\"value\\\": \\\"My favorite color is red.\\\"\\n    }\\n  ],\\n  \\\"created_at\\\": \\\"Thu, 28 Jul 2016 16:39:45 GMT\\\",\\n  \\\"id\\\": 384625777,\\n  \\\"subscription_id\\\": 384625744,\\n  \\\"type\\\": \\\"product_survey_result\\\",\\n  \\\"updated_at\\\": \\\"Thu, 28 Jul 2016 16:39:45 GMT\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response: 200 OK\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"product-survey-methods","type":"basic","title":"Product Survey Methods"}

Product Survey Methods


The following methods operate on the [Product Survey Results data model](doc:product-survey-results). [block:html] { "html": "<div class=\"endpoint list\">\n <span class=\"method get\">GET</span>\n <span class=\"uri\">\n http://api.cratejoy.com/v1/product_survey_results/\n </span>\n</div>" } [/block] [block:html] { "html": "<div class=\"endpoint list\">\n <span class=\"method get\">GET</span>\n <span class=\"uri\">\n\t\thttps://api.cratejoy.com/v1/product_survey_results/{result_id}/\n </span>\n</div>" } [/block] # List product survey results [block:html] { "html": "<div class=\"endpoint\">\n <span class=\"method get\">GET</span>\n <span class=\"uri\">\n http://api.cratejoy.com/v1/product_survey_results/\n </span>\n</div>\n\n" } [/block] [block:code] { "codes": [ { "code": "$.get('https://api.cratejoy.com/v1/product_survey_results/');", "language": "javascript", "name": "List" }, { "code": "$.get('https://api.cratejoy.com/v1/product_survey_results/?&limit=1&page=1&subscription_id=262294062');", "language": "javascript", "name": "Filtered list" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"count\": 1,\n \"next\": null,\n \"prev\": null,\n \"results\": [\n {\n \"answers\": [\n {\n \"field\": {\n \"id\": 262290128,\n \"survey\": {\n \"id\": 262290126,\n \"type\": \"product_survey\"\n },\n \"survey_id\": 262290126,\n \"type\": \"product_survey_field\"\n },\n \"field_id\": 262290128,\n \"id\": 262294081,\n \"value\": \"My favorite color is red.\"\n }\n ],\n \"created_at\": \"Thu, 14 Apr 2016 19:44:35 GMT\",\n \"id\": 262294080,\n \"subscription_id\": 262294062,\n \"type\": \"product_survey_result\",\n \"updated_at\": \"Thu, 14 Apr 2016 19:44:35 GMT\",\n \"url\": \"/v1/product_survey_results/262294080/\"\n }\n ]\n}", "language": "json", "name": "Response: 200 OK" } ] } [/block] _See [Product Survey Results](doc:product-survey-results) documentation for a complete list of filters and relationships._ # Get product survey result [block:html] { "html": "<div class=\"endpoint\">\n <span class=\"method get\">GET</span>\n <span class=\"uri\">\n\t\thttps://api.cratejoy.com/v1/product_survey_results/{result_id}/\n </span>\n</div>\n" } [/block] [block:code] { "codes": [ { "code": "$.get('https://api.cratejoy.com/v1/product_survey_results/262294080/');", "language": "javascript", "name": "Example" } ] } [/block] Pulls the results with a given ID. [block:code] { "codes": [ { "code": "{\n \"answers\": [\n {\n \"field\": {\n \"id\": 262290129,\n \"survey\": {\n \"id\": 262290126,\n \"type\": \"product_survey\"\n },\n \"survey_id\": 262290126,\n \"type\": \"product_survey_field\"\n },\n \"field_id\": 262290128,\n \"id\": 262294081,\n \"value\": \"My favorite color is red.\"\n }\n ],\n \"created_at\": \"Thu, 28 Jul 2016 16:39:45 GMT\",\n \"id\": 384625777,\n \"subscription_id\": 384625744,\n \"type\": \"product_survey_result\",\n \"updated_at\": \"Thu, 28 Jul 2016 16:39:45 GMT\"\n}", "language": "json", "name": "Response: 200 OK" } ] } [/block]