Skip to content

TOOGLE APIs

Paulo Roberto Donatilio Rego edited this page Aug 30, 2018 · 2 revisions
  • GET /api/Toggle - Get all toggles.
Sample request:

GET api/Toggle/
You will receive:
Code: 200 - Returns a list with all toggles
Code: 401 - Unauthorized Access
  • POST /api/Toggle - Create a New Toggle
Sample request:

POST api/Toggle/

To include All Services
{
    "Name": "string",
    "State": bolean,
    "Value": int,
    "ServicesList": [ "All" ]
}
        
To include The Services 1,2,3 (By Id)
{
    "Name": "string",
    "State": bolean,
    "Value": int,
    "ServicesList": [ 1,2,3 ]
}
You will receive:
Code: 200 - Sucess
Code: 400 - If the fields name or ServicesList are null.
  • GET /api/Toggle/{id} - Get a specific Toggle by id.
Sample request:

GET api/Toggle/{id}
You will receive:
Code: 200 - Returns the toggle informed by Id
Code: 400 - If id is null or not found
Code: 401 - Unauthorized Access
  • PUT /api/Toggle/{id} - Update the toggle informed by Id
Sample request:

PUT api/Toggle/

{
    "version": int,
    "name": "string"
}
You will receive:
Code: 200 - Sucess
Code: 400 - If the version or name is null
  • DELETE /api/Toggle/{id} - Delete the toggle

This one are omitted on swagger to demonstrate how to hiding APIs. In the code you can se the option [ApiExplorerSettings(IgnoreApi = true)] above them

Sample request:

DELETE api/Toggle/{id}
You will receive:
Code: 200 - Sucess
Code: 400 - If id is null or not found
Code: 401 - Unauthorized Access
Clone this wiki locally