Customizable status codes and error messages for APIs

Antal
Antal Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 88 Neuron

When buliding API's it would be helpful if we could create custom status messages with error codes for the benefit of the IT teams calling the API.

For example, if a feature is sent with a value that isn't in a specified range, we could send back a status 400 with a descriptive error message.

As an example: A feature 'age' is sent to the API with a value of 200, the API code checks this to a valid range (18-99) and sends back a status 400 response with an error message like 'Age out of range'.

As it is now we can check for that in the code and return a different result, but it will still send as a status 200, because the API call itself was successful. Being able to create different status codes to be sent back would help us greatly in communicating about API behavior with out IT 'customers'.

1
1 votes

New · Last Updated

Comments

Setup Info
    Tags
      Help me…