background preloader

REST

Facebook Twitter

Design patterns for modern web APIs – The Feathers Flightpath. Asynchronous operations - The RESTful cookbook. Instead of creating the actual resources, create a temporary one.

Asynchronous operations - The RESTful cookbook

Instead of returning a 201 (Created) HTTP response, you can issue a 202 (Accepted) response code. This informs the client that the request has been accepted and understood by the server, but the resource is not (yet) created. Send the temporary resource inside the Location header. Describing Request Body. OAS 3 This page applies to OpenAPI 3 – the latest version of the OpenAPI Specification.

Describing Request Body

If you use OpenAPI 2 (fka Swagger), visit OpenAPI 2 pages. Request bodies are typically used with “create” and “update” operations (POST, PUT, PATCH).

Hateoas

Basic auth for REST APIs. This page shows you how to allow REST clients to authenticate themselves using basic authentication with an Atlassian account email address and API token.

Basic auth for REST APIs

This is one of three methods that you can use for authentication against the Jira REST API; the other two are cookie-based authentication and OAuth. Before you begin. Some People Understand REST and HTTP. This is a follow-up post to my post here.

Some People Understand REST and HTTP

You probably want to read that first. UPDATE: Please note that 'REST is over'. Nobody Understands REST or HTTP. A RESTful learning curve: nouns, verbs, HATEOAS and ROCA. There’s a model hiding in your REST API - Vehikl. REST is a great standard, but sometimes you need an endpoint that breaks convention.

There’s a model hiding in your REST API - Vehikl

Say your application manages mailing lists, and the users subscribed to them. Your database structure might look like this: …and you’ve got a couple of related models: class User{ public function mailingLists() { return $this->belongsToMany('MailingList'); }} class MailingList{ public function users() { return $this->belongsToMany('User'); }} Seems straightforward enough right? Richardson Maturity Model. A model (developed by Leonard Richardson) that breaks down the principal elements of a REST approach into three steps.

Richardson Maturity Model

These introduce resources, http verbs, and hypermedia controls. Recently I've been reading drafts of Rest In Practice : a book that a couple of my colleagues have been working on. Their aim is to explain how to use Restful web services to handle many of the integration problems that enterprises face. Design patterns for modern web APIs – The Feathers Flightpath. Best Practices for Designing a Pragmatic RESTful API. Your data model has started to stabilize and you're in a position to create a public API for your web app. You realize it's hard to make significant changes to your API once it's released and want to get as much right as possible up front. Now, the internet has no shortage on opinions on API design.

But, since there's no one widely adopted standard that works in all cases, you're left with a bunch of choices: What formats should you accept? How should you authenticate? Should your API be versioned? What HTTP Status code to respond with. Protocol In telecommunications, a communications protocol is a system of rules that allow two or more entities of a communications system to transmit information via any kind of variation of a physical quantity.

What HTTP Status code to respond with

These are the rules or standard that defines the syntax, semantics and synchronization of communication and possible error recovery methods. Protocols may be implemented by hardware, software, or a combination of both. RESTful APIs - An accurate description - Johno the Coder. Hi everyone Today I thought I would do a quick post to cover RESTful APIs, and what they are.

RESTful APIs - An accurate description - Johno the Coder

The reason for this article is that I have, on numerous occasions, encountered developers (and indeed whole teams) who have misunderstood this concept at its very core. This causes a number of problems, firstly if you don’t understand RESTful APIs fundamentally, you’re likely to encounter integration issues quite early on. Secondly, unfortunately, if you’re a candidate interviewing for a role and haven’t understood what a RESTful API is properly, you’ll come unstuck in interview. What RESTful is not (necessarily)