10 tips for designing mobile app APIs (1)

Source: Internet
Author: User

1. API Version Control

At any time, it is inevitable for developers to modify APIs to ensure the normal operation of applications. They may only add, delete, or perform other operations on some functions. In this case, you have to suspend the use of the API, or allow the application in use to have a clear understanding of the behavior and response type to be returned.

An API is like an agreement between your application backend and the application that uses it. Without proper version control, one party can change the agreement without the other party's knowledge. Then, you will be in a very dangerous situation. Support for multiple API versions allows users who do not upgrade their applications in time to continue using the API. The latest version of the App allows you to see all the changes to the latest API.

In a mobile App, the importance of API version control is obvious. Without API version control, modifying the API can easily stop the App running, and the consequences will make you regret it in a bid.

2. The returned data should not exceed the required

To a certain extent, the amount of data sent between the application and the server will affect the time for sending the request and its response. The impact is not only the time it takes for the user to focus on loading the page, but also the traffic it takes to load the page.

3. compress the sent and received data

In addition to not returning data that exceeds your needs, compressing the sent and received data allows you to get twice the result with half the effort in speed and data transmission and experience more benefits.

4. resolutely Delete unnecessary steps/requests

API design is common to provide separate discrete steps, but this reflects how the service is used. Therefore, in most cases, these discrete steps are not the most effective method for executing mobile apps.

Let's take a very simple example. The user has provided valid authentication information and logged on before sending the request data. This may be reasonable. We can consider it as two separate steps:

  • The provided authentication information is valid. The API responds to a session token.
  • When a data request is sent, the session token passes.

But in fact, this operation does not need to be repeated. When a single request is sent, the data and session token are returned simultaneously through authentication information and related data details.

The advantage of this is that when a user uses an App, the response speed is faster and the traffic usage is less. For developers, this can make the application code simpler. In this way, both development costs and maintenance costs can be reduced.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.