{"_id":"5773f930255e820e00e1cdb0","parentDoc":null,"version":{"_id":"55d383ac0168850d0073f1da","project":"55d22cd53c74062300aee584","__v":9,"createdAt":"2015-08-18T19:12:44.826Z","releaseDate":"2015-08-18T19:12:44.826Z","categories":["55d383ad0168850d0073f1db","55d383ad0168850d0073f1dc","55d38d25f77e6d0d00b1b179","55f0af8b7dccfc0d00986a08","56047d370c78b00d0039b1c3","560481e1d5c3900d0003e79e","5604849b60d2c40d00deb4ba","56390754aaddb90d00c76018","58867f5fbd44ca1b005d29fd","58ab437f9048311b0089b732"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"user":"55d24afa3c74062300aee61d","__v":12,"category":{"_id":"56047d370c78b00d0039b1c3","__v":14,"pages":["56047d5af6b86e0d00284a0d","56047d6d60d2c40d00deb4b0","56047d76f6b86e0d00284a0f","56047d7e60d2c40d00deb4b3","56047d8a60d2c40d00deb4b5","5604e2fad895120d00a40a16","5609a5668aedf50d0004d18c","561ee5efcec1a50d0097949d","5639069b68b11f0d0048c94d","563907362fc5520d001a4d2e","5639087d049e420d00476ae8","56390eb72fc5520d001a4d48","56390ffbaaddb90d00c7603b","563c63a6ac77910d0027a019"],"version":"55d383ac0168850d0073f1da","project":"55d22cd53c74062300aee584","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-09-24T22:46:15.487Z","from_sync":false,"order":2,"slug":"cdn-developer-api","title":"CDN Developer API"},"project":"55d22cd53c74062300aee584","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-06-29T16:37:04.432Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":true,"order":0,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Token Authentication\"\n}\n[/block]\nThe BelugaCDN API offers a shared-secret based [token authentication](https://docs.belugacdn.com/docs/tokens) method to ensure secure API access.\n\nAn HTTP Authorization header must be added to each request, in the format of:\n\n    Authorization: Token <token id> <SHA-512 HMAC>\n\nThe HMAC is constructed by combining the request method, the request path (including query strings) and an ISO 8601 date header that must be supplied by the client.\n\nIf the request is a POST or PUT request, the SHA-512 of the request body should also be included.\n\nFor example, to request a list of all your configured CDN sites the string to be HMAC'd would be:\n\n    GET:/api/cdn/v2/sites:2016-06-29T16:46:57.884555Z\n\nTo update a CDN site configuration:\n\n    PUT:/api/cdn/v2/sites/i.adam.gs:2016-06-29T16:48:48.271134Z:2cab8e37c2c58c6116b41889b30d07c1cb726009f565d4a28e67f1e38bae8a59441f1a201a2bb355158145733af245e3411fb267f2d7ff24351f73b40976fa9c\n\nPlease ensure that your computers clock is synchronized, as the API validates the value of the Date: header.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Basic Authentication\"\n}\n[/block]\n\nIn addition to the more secure Token Authentication, the BelugaCDN API also offers the ability to authenticate with the API using HTTP Basic authentication using the same login credentials you use to login to the BelugaCDN customer portal. It's a great way to authenticate to generate secure tokens.","excerpt":"","slug":"authentication","type":"basic","title":"Authentication"}
[block:api-header] { "type": "basic", "title": "Token Authentication" } [/block] The BelugaCDN API offers a shared-secret based [token authentication](https://docs.belugacdn.com/docs/tokens) method to ensure secure API access. An HTTP Authorization header must be added to each request, in the format of: Authorization: Token <token id> <SHA-512 HMAC> The HMAC is constructed by combining the request method, the request path (including query strings) and an ISO 8601 date header that must be supplied by the client. If the request is a POST or PUT request, the SHA-512 of the request body should also be included. For example, to request a list of all your configured CDN sites the string to be HMAC'd would be: GET:/api/cdn/v2/sites:2016-06-29T16:46:57.884555Z To update a CDN site configuration: PUT:/api/cdn/v2/sites/i.adam.gs:2016-06-29T16:48:48.271134Z:2cab8e37c2c58c6116b41889b30d07c1cb726009f565d4a28e67f1e38bae8a59441f1a201a2bb355158145733af245e3411fb267f2d7ff24351f73b40976fa9c Please ensure that your computers clock is synchronized, as the API validates the value of the Date: header. [block:api-header] { "type": "basic", "title": "Basic Authentication" } [/block] In addition to the more secure Token Authentication, the BelugaCDN API also offers the ability to authenticate with the API using HTTP Basic authentication using the same login credentials you use to login to the BelugaCDN customer portal. It's a great way to authenticate to generate secure tokens.