{"id":53031,"date":"2019-07-11T13:00:39","date_gmt":"2019-07-11T18:00:39","guid":{"rendered":"https:\/\/blog.cpanel.com\/?p=53031"},"modified":"2019-07-11T13:00:39","modified_gmt":"2019-07-11T18:00:39","slug":"uapi-whats-new-in-82","status":"publish","type":"post","link":"https:\/\/devel.www.cpanel.net\/blog\/products\/uapi-whats-new-in-82\/","title":{"rendered":"UAPI- What’s New in 82"},"content":{"rendered":"\n
With the release of cPanel & WHM version 82 to CURRENT this week, we are adding several new UAPI<\/a> modules and functions. These new functions replace several previously-deprecated cPanel API 1<\/a> functions. For a complete list of API calls that we’ve added so far, read our Guide to Replacing cPanel API 1 functions with UAPI equivalents<\/a> documentation.<\/p>\n\n\n\n Our goal is to provide a more seamless experience for anyone who integrates with cPanel & WHM. <\/p>\n\n\n\n An Application Programming Interface<\/a> (API) is a set of subroutine definitions and communication protocols. These components help connect a software application’s backend<\/a> functionality to a user interface (UI). An API can also function as a means for external applications to communicate with the application that defines the API. <\/p>\n\n\n\n When users perform an action in the UI or directly via an API call, the API sends the action to the backend. The backend then responds with the information. If the system can’t complete the request, the API call returns a meaningful error or warning.<\/p>\n\n\n\n cPanel & WHM uses the API frameworks that ship with our product to build, populate, and create functionality in our UIs. Anyone who wants to integrate with cPanel & WHM can also use these API frameworks.<\/p>\n\n\n\n cPanel & WHM has two active APIs:<\/p>\n\n\n\n We also have the following deprecated<\/a> APIs:<\/p>\n\n\n\n For more information about each of these APIs, read our\u00a0Quickstart Development Guide<\/a>\u00a0documentation.<\/p>\n\n\n\n We introduced UAPI in cPanel & WHM version 11.42. UAPI provides a more consistent and predictable experience for developers who create integrations and extensions that interact with cPanel. UAPI functions return information in a simple data structure without formatting. This format allows integrators to use the data as needed. UAPI allows developers to filter<\/a>, sort<\/a>, and paginate<\/a> the output. Additionally, developers can filter returned data into output columns<\/a>.<\/p>\n\n\n\n Since cPanel API 1 and API 2 are both deprecated, we strongly<\/strong> recommend using UAPI calls for cPanel integrations whenever possible. We tentatively plan to have all cPanel functionality operating under the UAPI framework by version 86 and plan to completely remove cPanel API 1 from our codebase in version 88.<\/p>\n\n\n\n Imagine you are a web developer with many cPanel user accounts across various servers to help manage your customers’ websites. You want to ensure that those sites don’t run out of their allocated filesystem space, so you create a dashboard web application. The UAPI Quota::get_quota_info<\/a> call is what you need to get the necessary data to your dashboard.<\/p>\n\n\n\n With a simple API request, it returns the following account information:<\/p>\n\n\n\n You can pass this data into variables within your code that are later used to generate a graph. You’ve done this for one cPanel instance, but you have three other accounts.<\/p>\n\n\n\n So within each cPanel account, you generate a cPanel API Token<\/a>. This token allows you to access API functionality for the cPanel account without logging in through the cPanel interface. Now, on a regular interval of time that you’ve set, your dashboard can automatically poll each cPanel account via the API and retrieve the data you need.<\/p>\n\n\n\n With the release of cPanel & WHM version 82 to CURRENT this week, we are adding several new UAPI modules and functions. These new functions replace several previously-deprecated cPanel API 1 functions. For a complete list of API calls that we’ve added so far, read our Guide to Replacing cPanel API 1 functions with UAPI equivalents documentation. Our goal is to provide […]<\/p>\n","protected":false},"author":77,"featured_media":65193,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[49],"tags":[],"class_list":["post-53031","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-products"],"acf":[],"yoast_head":"\nWhat is an API, and who uses it?<\/h2>\n\n\n\n
Wait, cPanel & WHM has an API?<\/h2>\n\n\n\n
<\/figure>\n\n\n\n
Why use UAPI?<\/h1>\n\n\n\n
<\/figure>\n\n\n\n
A Simple Example<\/h2>\n\n\n\n
<\/figure>\n\n\n\n
Tell Us Your Thoughts!<\/h2>\n\n\n\n
What APIs have you used in the past?\u00a0What features and options make an API great to use? Join in on developer discussions in our\u00a0Discord<\/a> integrations\u00a0channel, on our\u00a0cPanel Developers forum<\/a>, and\u00a0sign up to our Plugin Devs mailing list<\/a>. You can also join us in our\u00a0Slack<\/a> channel or our official cPanel subreddit<\/a>!\u00a0Look for future blog posts to include updates related to this API project and monitor our\u00a0Release Notes<\/a>\u00a0to keep informed about new UAPI functions.
We look forward to hearing your thoughts and continuing this discussion!<\/p>\n","protected":false},"excerpt":{"rendered":"