{"_id":"54cb1d7561698d0d00baf746","githubsync":"","parentDoc":null,"user":"5474380459fade080004c91d","version":{"_id":"5474381b59fade080004c923","project":"5474381b59fade080004c920","__v":12,"createdAt":"2014-11-25T08:04:43.418Z","releaseDate":"2014-11-25T08:04:43.418Z","categories":["5474381b59fade080004c924","5474387f59fade080004c927","547d639078fd57080023cb81","549eb883b67f031400a5dc0e","54c87c8bab03760d00c8e4ec","54ca1480eb42170d0045d3c6","54ca1539dd5cf30d00c35135","560e634e59cb8d0d0015cce1","560e7bfc59cb8d0d0015ccfb","562531976ff1010d009b16f0","57c0378264ebf60e006886d9","57c037912588020e004b5c8e"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"project":"5474381b59fade080004c920","category":{"_id":"5474381b59fade080004c924","pages":["5474381c59fade080004c926","547d631878fd57080023cb7f","547d637f2eaee50800ed11b9","549eb8577483040b001e9f85","549eb915b67f031400a5dc15","54a11a7fce33cf1600c2330b","54ae635c3697fc1600d89473","54b4c52760a6291f00dce24d","54bd2ab5f1177e0c00679d64","54bd3147a0d4080c005f5420","54c8d9730174630d00efa847","54cb1a5f323d0f0d00be8de2","54cb1a7061698d0d00baf743","54cb1d7561698d0d00baf746"],"__v":14,"project":"5474381b59fade080004c920","version":"5474381b59fade080004c923","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-11-25T08:04:43.915Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"__v":8,"updates":["54cbcc78323d0f0d00be8ed9"],"next":{"pages":[],"description":""},"createdAt":"2015-01-30T05:58:13.544Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"Authentication requires a key which can be created in your user profile settings.\n\nClick your name in bottom left corner, select \"Your Account...\" and then select tab \"API Keys\".\n\n\nYou will need to include your key in every request using X-Auth-Token header:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$.ajax({\\n  method: \\\"GET\\\",\\n\\turl: 'https://my.surveypal.com/api/rest/surveys',\\n  headers: {\\n    \\\"X-Auth-Token\\\": \\\"YOUR-TOKEN\\\",\\n    \\\"Accept\\\": \\\"application/json\\\"\\n  }\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"jQuery\"\n    },\n    {\n      \"code\": \"curl -i -X GET \\\\\\n   -H \\\"X-Auth-Token:YOUR-TOKEN\\\" \\\\\\n   -H \\\"Accept:application/json\\\" \\\\\\n 'https://my.surveypal.com/api/rest/surveys'\",\n      \"language\": \"curl\",\n      \"name\": \"cUrl\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"authentication-1","type":"basic","title":"Authentication"}
Authentication requires a key which can be created in your user profile settings. Click your name in bottom left corner, select "Your Account..." and then select tab "API Keys". You will need to include your key in every request using X-Auth-Token header: [block:code] { "codes": [ { "code": "$.ajax({\n method: \"GET\",\n\turl: 'https://my.surveypal.com/api/rest/surveys',\n headers: {\n \"X-Auth-Token\": \"YOUR-TOKEN\",\n \"Accept\": \"application/json\"\n }\n});", "language": "javascript", "name": "jQuery" }, { "code": "curl -i -X GET \\\n -H \"X-Auth-Token:YOUR-TOKEN\" \\\n -H \"Accept:application/json\" \\\n 'https://my.surveypal.com/api/rest/surveys'", "language": "curl", "name": "cUrl" } ] } [/block]