Our features site is undergoing a refresh! Be sure to explore the revamped site and discover our latest product roadmap launching here on Monday, March 18th.

Normalized RESTful API

Tim Garrison shared this idea 11 years ago
Open Discussion

The current APIs that cPanel and WHM provide open up a lot of options for developers to integrate their applications. However, the data payloads and responses required by many of the API calls are not consistent with each other.


I would like to propose that a RESTful API be constructed using standard REST paradigms. Additionally, the methods and components of this API should provide normalized responses. For example, the call to create a customer should return the same response as the call to get a customer.


As it is, I have to make several different API calls to populate a somewhat normalized data structure derived from the current API documentation.

Replies (3)

photo
1

Is a REST API for cPanel & WHM something that developers are still interested in?

Some advantages might be:

  • A more uniform and predictable interface
  • More specific and appropriate error responses over HTTP
  • Consistent data structures in and out

What other features of REST would you be excited about? What other types of APIs do you have positive experiences using?

photo
1

Think about it this way: If I want to see the detail for a particular user account, I would need to get the account details in one call, the in another call get the quota details, etc. That shouldn't be necessary. Also, when similar models are returned by the API via different methods, they should be consistent with each other. Consider the quota values: One may say 1000M, the other may say 1G (not actual example, just drawing off this 6 year old request memories).

photo
photo
1

A rest api would be great right about now for the app me and my team are working on. It is for web and mobile built with react native. Guess I better get started. graphQL would work nicely to . Then it would only be one endpoint the front-end would have to call.

photo
1

Hi Mike,

Which part(s)/api(s) of our product is your app going to interact with?

photo
1

The mail client to start with .We can send and receive email very easy in the app but adding a new client restapi would be perfect for that.

photo
photo
1

Just to clarify: is the request more for consistency in the APIs, or for REST specifically?

If the latter, why?

photo
2

Self-consistency within the APIs themselves. See my thread reply to TJ above.

photo
Leave a Comment
 
Attach a file