{"_id":"57ffd85f755a2e1700c2bb27","category":{"_id":"57ffd85f755a2e1700c2bb0a","version":"57ffd85f755a2e1700c2bb05","__v":0,"project":"567083021dabd80d00b122ae","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-12-18T23:14:14.145Z","from_sync":false,"order":4,"slug":"rest-api","title":"REST API"},"parentDoc":null,"user":"567082433a32d20d00c45cab","version":{"_id":"57ffd85f755a2e1700c2bb05","project":"567083021dabd80d00b122ae","__v":1,"createdAt":"2016-10-13T18:54:23.018Z","releaseDate":"2016-10-13T18:54:23.018Z","categories":["57ffd85f755a2e1700c2bb06","57ffd85f755a2e1700c2bb07","57ffd85f755a2e1700c2bb08","57ffd85f755a2e1700c2bb09","57ffd85f755a2e1700c2bb0a","57ffd85f755a2e1700c2bb0b","57ffd85f755a2e1700c2bb0c","57ffd85f755a2e1700c2bb0d"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"3.4.0","version":"3.4"},"__v":0,"project":"567083021dabd80d00b122ae","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-12-18T23:18:33.958Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"> [Restangular](https://github.com/mgonto/restangular) is an AngularJS service that simplifies common GET, POST, DELETE, and UPDATE requests with a minimum of client code. It's a perfect fit for any WebApp that consumes data from a RESTful API.\n\nWhich makes it a perfect fit for this repository.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"\",\n  \"body\": \"Restangular is a layer on top of `$http`\"\n}\n[/block]\n# Default Configuration\nThis repository provides you with a service called `API` (found at angular/services/api.service.js) which configures the following:\n* Content negotiation (header)\n* Content type (header)\n* Base URL: this means you can omit the `/api/` when calling API endpoints\n* error interceptor which displays the first error message in a red Toast.\n* JWT support\n\nAll of these configurations are in-line with what we'd expect from the API (also inline with the dingo/api configuration).\n\nFeel free to explore other options as documented on [their repository](https://github.com/mgonto/restangular).\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Avoid using Restangular service. Use API service instead\",\n  \"body\": \"It's recommended that you avoid using the Restangular service.\\nUsing a service that extends Restangular (e.g.: API) would allow you to introduce other services for other APIs or other configurations.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"\",\n  \"body\": \"Restangular might seem a bit hard to grasp at first. But it's totally worth it.\\nOnce you get the hang of it, you'll be calling your endpoint in a fluent manner.\"\n}\n[/block]\n> Prefer a screencast?\n[block:html]\n{\n  \"html\": \"<iframe width=\\\"560\\\" height=\\\"315\\\" src=\\\"https://www.youtube.com/embed/RHQNpw-XmpI\\\" frameborder=\\\"0\\\" allowfullscreen></iframe>\"\n}\n[/block]","excerpt":"","slug":"restangular","type":"basic","title":"Restangular"}
> [Restangular](https://github.com/mgonto/restangular) is an AngularJS service that simplifies common GET, POST, DELETE, and UPDATE requests with a minimum of client code. It's a perfect fit for any WebApp that consumes data from a RESTful API. Which makes it a perfect fit for this repository. [block:callout] { "type": "info", "title": "", "body": "Restangular is a layer on top of `$http`" } [/block] # Default Configuration This repository provides you with a service called `API` (found at angular/services/api.service.js) which configures the following: * Content negotiation (header) * Content type (header) * Base URL: this means you can omit the `/api/` when calling API endpoints * error interceptor which displays the first error message in a red Toast. * JWT support All of these configurations are in-line with what we'd expect from the API (also inline with the dingo/api configuration). Feel free to explore other options as documented on [their repository](https://github.com/mgonto/restangular). [block:callout] { "type": "success", "title": "Avoid using Restangular service. Use API service instead", "body": "It's recommended that you avoid using the Restangular service.\nUsing a service that extends Restangular (e.g.: API) would allow you to introduce other services for other APIs or other configurations." } [/block] [block:callout] { "type": "warning", "title": "", "body": "Restangular might seem a bit hard to grasp at first. But it's totally worth it.\nOnce you get the hang of it, you'll be calling your endpoint in a fluent manner." } [/block] > Prefer a screencast? [block:html] { "html": "<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/RHQNpw-XmpI\" frameborder=\"0\" allowfullscreen></iframe>" } [/block]