{"__v":0,"_id":"55fc9b803c21291900e7e106","category":{"__v":1,"_id":"55fc9b7a3c21291900e7e0dc","pages":["55fc9b803c21291900e7e105","55fc9b803c21291900e7e106","55fc9b803c21291900e7e107","55fc9b803c21291900e7e108"],"project":"5553d36165e8260d0024419a","version":"55fc9b793c21291900e7e0d7","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-13T22:51:53.784Z","from_sync":false,"order":4,"slug":"authentication","title":"Authentication"},"parentDoc":null,"project":"5553d36165e8260d0024419a","user":"5553d33065e8260d00244199","version":{"__v":12,"_id":"55fc9b793c21291900e7e0d7","project":"5553d36165e8260d0024419a","createdAt":"2015-09-18T23:17:13.545Z","releaseDate":"2015-09-18T23:17:13.545Z","categories":["55fc9b7a3c21291900e7e0d8","55fc9b7a3c21291900e7e0d9","55fc9b7a3c21291900e7e0da","55fc9b7a3c21291900e7e0db","55fc9b7a3c21291900e7e0dc","55fc9b7a3c21291900e7e0dd","55fc9b7a3c21291900e7e0de","55fc9b7a3c21291900e7e0df","55fc9b7a3c21291900e7e0e0","55fc9b7a3c21291900e7e0e1","55fc9b7a3c21291900e7e0e2","55fc9b7a3c21291900e7e0e3","55fc9bad4c80910d00b9bece","56394a0c3539050d00082122","56394a2f68b11f0d0048c9ff","56394a462fc5520d001a4db3","56394a4c2fc5520d001a4db4","56394a5b049e420d00476b5c","56394a6a2fc5520d001a4db5","56394f791593e4190073a44b","567b3adfb56bac0d0019d8d9","569d590e5a2b060d008741eb","569ea93dffccd10d00a05c7f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-15T16:37:49.710Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"Many API services use an API Key in the Header or Body to handle authentication. \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Authentication Setup\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ZvJHWdrmRXGynkqCJTR6_webserviceedit.jpg\",\n        \"webserviceedit.jpg\",\n        \"1005\",\n        \"400\",\n        \"#515987\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Section\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"Endpoint Domain\",\n    \"h-2\": \"Required?\",\n    \"0-1\": \"The URI of the endpoint used by the API.\",\n    \"0-2\": \"NO (recommended). This is a very powerful way to link API calls and find services later.\",\n    \"1-0\": \"Service Name\",\n    \"1-1\": \"Your name for the Authentication Service (for instance, Sue's Retail Service API Key 1)\",\n    \"1-2\": \"YES\",\n    \"2-0\": \"Authentication Type\",\n    \"2-1\": \"Select from the drop-down\",\n    \"2-2\": \"YES\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Set API Key\"\n}\n[/block]\nClick 'Create New Token' to set the API key.\n\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Header or Body?\",\n  \"body\": \"Typically most services will allow you to specify the header or body - use the format in the form (description) = (key)\"\n}\n[/block]\nFor example:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/W2YnYLkeQQ6eYibupiWY_tokeneditor.png\",\n        \"tokeneditor.png\",\n        \"685\",\n        \"235\",\n        \"#ab9243\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]","excerpt":"Using API Keys to authenticate API calls","slug":"api-key-authentication","type":"basic","title":"API Key Authentication"}

API Key Authentication

Using API Keys to authenticate API calls

Many API services use an API Key in the Header or Body to handle authentication. [block:api-header] { "type": "basic", "title": "Authentication Setup" } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/ZvJHWdrmRXGynkqCJTR6_webserviceedit.jpg", "webserviceedit.jpg", "1005", "400", "#515987", "" ] } ] } [/block] [block:parameters] { "data": { "h-0": "Section", "h-1": "Description", "0-0": "Endpoint Domain", "h-2": "Required?", "0-1": "The URI of the endpoint used by the API.", "0-2": "NO (recommended). This is a very powerful way to link API calls and find services later.", "1-0": "Service Name", "1-1": "Your name for the Authentication Service (for instance, Sue's Retail Service API Key 1)", "1-2": "YES", "2-0": "Authentication Type", "2-1": "Select from the drop-down", "2-2": "YES" }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Set API Key" } [/block] Click 'Create New Token' to set the API key. [block:callout] { "type": "info", "title": "Header or Body?", "body": "Typically most services will allow you to specify the header or body - use the format in the form (description) = (key)" } [/block] For example: [block:image] { "images": [ { "image": [ "https://files.readme.io/W2YnYLkeQQ6eYibupiWY_tokeneditor.png", "tokeneditor.png", "685", "235", "#ab9243", "" ] } ] } [/block]