Book Image

WordPress Web Application Development

By : Rakhitha Nimesh Ratnayake
Book Image

WordPress Web Application Development

By: Rakhitha Nimesh Ratnayake

Overview of this book

Table of Contents (19 chapters)
WordPress Web Application Development Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Integrating API access tokens


In the preceding section, we introduced API authentication to prevent unnecessary access to the API. Even the authenticated users can overload the API by accessing it unnecessarily. Therefore, we need to implement user tokens for limiting the use of the API. There can be many reasons for limiting requests to an API. We can think of two main reasons for limiting the API access as listed here:

  • To avoid the unnecessary overloading of server resources

  • To bill the users based on API usage

If you are developing a premium API, it's important to track its usage for billing purposes. Various APIs use unique parameters to measure the API usage. Here are some of the unique ways of measuring API usage:

  • The Twitter API uses the number of requests per hour to measure API usage

  • Google Translate uses the number of words translated to measure API usage

  • Google Cloud SQL uses input and output storage to measure API usage

Here, we won't measure the usage or limit the access to the portfolio...