features icon indicating copy to clipboard operation
features copied to clipboard

Expose features using an HTTP based API

Open albertoleal opened this issue 11 years ago • 0 comments

Create a new feature:

POST /features

Parameters:

Attributes Required? Default
enabled NO false
key YES -
users NO -
percentage NO -

Success will result in a 201 Created response.

  {
    "enabled": true,
    "key":"feature x",
    "users": [],
    "percentage": 0
  }

Update an existing feature:

PUT /features/:feature-key

Success will result in a 200 OK response.

  {
    "enabled": true,
    "key":"feature x",
    "users": [],
    "percentage": 0
  }

Delete an existing feature:

DELETE /features/:feature-key

Success will result in a 204 No Content response. Not found will result in a 404 Not Found response.

Retrieve an existing feature:

GET /features/:feature-key

Success will result in a 200 OK response.

  {
    "enabled": true,
    "key":"feature x",
    "users": [],
    "percentage": 0
  }

Not found will result in a 404 Not Found response.

Errors

  • Sending invalid JSON will result in a 400 Bad Request response.

    {
      "error":"bad_request",
      "error_description":"Invalid JSON."
    }
    
  • Sending invalid fields will result in a 422 Unprocessable Entity response.

    {
      "error":"unprocessable_entity",
      "error_description":"Missing required fields."
    }
    

albertoleal avatar Oct 29 '15 20:10 albertoleal