简体   繁体   English

Web应用程序API的用例?

[英]Use cases for web application API?

Nowadays a lot of web applications are providing API for other applications to use. 如今,许多Web应用程序都在提供API供其他应用程序使用。

I am new to the usage of API so I want to understand the use cases for it. 我是API的新手,所以我想了解它的用例。

Lets take Basecamp as an example. 让我们以大本营为例。

What are the use cases for using their API in my web application? 在我的Web应用程序中使用其API的用例是什么?

  1. For inserting current data in my web application into a newly created Basecamp account instead of inserting everything manually which could take days or weeks if the data is huge? 要将我的Web应用程序中的当前数据插入到新创建的Basecamp帐户中,而不是手动插入所有内容(如果数据庞大,可能需要几天或几周的时间)?
  2. For updating my application data when the user changes something in Basecamp. 当用户在Basecamp中进行某些更改时用于更新我的应用程序数据。 If so, how do I know for example when a user add/edit/remove a contact in Basecamp. 如果是这样,我怎么知道例如用户何时在Basecamp中添加/编辑/删除联系人。 Do I make a request and check every minute from the backend? 我是否要发出请求并从后端检查每一分钟?
  3. For making backup of the Basecamp data so I can move it to other applications if necessary? 为了备份Basecamp数据,以便在必要时可以将其移动到其他应用程序?

Are all the above examples good use cases for the usage of API? 以上所有示例都是使用API​​的良好用例吗?

Are there more use cases? 还有更多用例吗?

I want to have a clear picture of why it's good to use another web service API and how I can leverage that on my application. 我想清楚地说明为什么使用另一个Web服务API会很好,以及如何在应用程序中利用它。

Thanks. 谢谢。

I've found the biggest reason to use and provide web services is to be able to programmatically drive the application with another process. 我发现使用和提供Web服务的最大原因是能够以编程方式通过另一个进程来驱动应用程序。 This allows the coupling of different actions in different applications driven by one event/process/trigger. 这允许在一个事件/过程/触发器驱动的不同应用程序中耦合不同的动作。

For example I could create a use a webservice provided by Basecamp, my bug tracking database and the continuous integration server. 例如,我可以创建一个使用由Basecamp提供的Web服务,我的错误跟踪数据库和持续集成服务器。 I could tie all those things together and kick them off from a commit hook script. 我可以将所有这些东西绑在一起,并从提交钩子脚本开始。

I can have a monitor in production automatically open a ticket in our ticket tracker. 我可以在生产中使用一个监视器,在票证跟踪器中自动打开票证。 This could trigger an autoremediation process from the ticket tracker which logs into the box remotely and restarts the service. 这可能会从票证跟踪器触发自动修复过程,该过程将远程登录到该框中并重新启动服务。

The other major reason I've seen to use and provide web service is to reduce double entry. 我看到使用和提供Web服务的另一个主要原因是减少重复输入。 If you do change management in your production environment that usually means you create Change tickets. 如果您在生产环境中进行变更管理,则通常意味着您要创建变更单。 The changes that occur may also need to be reflected in the Change Management Database which is usually a model of how production is suppose to look. 发生的变更也可能需要反映在变更管理数据库中,该数据库通常是生产外观的模型。 Most of these systems don't automatically drive the update of your configuration item with the data from the change. 这些系统中的大多数系统不会自动使用更改中的数据来驱动配置项的更新。 Using web services you can stitch them together to eliminate the double (manual) entry that would normally occur. 使用Web服务,您可以将它们缝合在一起,以消除通常会出现的两次(手动)输入。

APIs are used any time you want to get data to/from an application without using the default interface. 任何时候您都想使用API​​而不使用默认接口从应用程序获取数据。
*I'd bet there's a mobile app would use the basecamp api. *我敢打赌,有一个移动应用程序将使用basecamp api。
*You could use the api to pull information from basecamp into another application (like project manager software or an individual's todo webpage) *the geekiest of us may prefer to update basecamp from a script/command line rather than interrupting our work flow to open a web page and click around. *您可以使用api将信息从basecamp导入另一个应用程序(例如项目管理器软件或个人的待办网页)*我们最讨厌的人可能更喜欢从脚本/命令行更新basecamp而不是中断我们的工作流程以打开一个网页并单击。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM