Categories
API General Web API

How to improve an API speed performance ?

Today’s challenge : investigate the slow responsiveness of the api. I was assigned the task to investigate the performance report produced the day before. The report concluded in the most unclear manner that the backend was lacking in term of performance. No precision regarding the list of failing api calls was provided. I used newRelic and discovered that indeed during the specific timeframe mentioned a clear bottleneck was surfacing an a specific api call to a specific internal server.

I reached out to the developer mainly responsible of this server. The newRelic information [pointing out the entanglement] was challenged in the most defensive and almost aggressive manner to my stupefaction.

Developer do not like to be pointed out or criticized. What/How should have approach this developer ?=

The developer challenged the results by saying “I just executed the specified api endpoint with the specified payload and guess what; the result came back under one second”. Omitting the context of Heavy Test Performance. So being pushed back multiple time, I moved on to the sysOp department to get more information on what was going on.

The slow server obviously was not monitored with newRelic. A coordination with sysOp was necessary to get this server under surveillance. During our meeting, it was established that the server was under provisioned in term of CPU power and memory space. We did increase these metrics.

The tests were ran and passed successfully. The main challenges were to get the approval from the CIO to have sysOp moving and the developer’s resistance to acknowledge a possible glitch on the server.

My approach toward this developer although very specific and data documented should have been persuasive rather than convincing.

Categories
API Web API

RESTFUL API – HTTP CODE 422 – Unprocessable Entity

The HyperText Transfer Protocol (HTTP) 422 Unprocessable Entity response status code indicates that the server understands the content type of the request entity, and the syntax of the request entity is correct, but it was unable to process the contained instructions.

Categories
API

What HTTP status response code should I use if the request is missing a required parameter?

The 422 (Unprocessable Entity) status code means the server understands the content type of the request entity (hence a 415(Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions. For example, this error condition may occur if an XML request body contains well-formed (i.e., syntactically correct), but semantically erroneous, XML instructions.

https://stackoverflow.com/questions/3050518/what-http-status-response-code-should-i-use-if-the-request-is-missing-a-required

Categories
Access Token API Laravel Oauth PHP Valet Web API

Laravel Passsport – Oauth2

Laravel makes API authentication a breeze using Laravel Passport, which provides a full OAuth2 server implementation for your Laravel application in a matter of minutes. Passport is built on top of the League OAuth2 server that is maintained by Andy Millington and Simon Hamp.

Categories
API

API Collection

Symfony

Laravel

Lumen

Raleche Framework