Skip to content
  • Why WPGetAPI?
  • Examples
  • Pricing
  • Plugins
    • PRO Plugin
    • API to Posts Plugin
    • OAuth 2.0 Plugin
  • Docs
  • Support
    • Frequently Asked Questions
    • Feature Request
    • Support Ticket
  • account_circle
PRO Plugin
Howdy! How can we help you?
  • Introduction

    • Quick Start
    • Frequently Asked Questions
    • Will this work with my API?
    • Understanding API docs
    • Step by Step Example
  • Setup

    • Setup Page
    • Endpoint Page
    • Parameters - Query String
    • Parameters - Headers
    • Parameters - Body POST
    • Shortcode
    • Template Tag
    • Gutenberg Block
  • Connecting your API

    • API Key in Headers
    • API Key in Query String
    • Authentication & Authorization
  • Output API Data

    • Format API to HTML
    • Format API to HTML Table
    • Format API to Image Gallery
    • Format JSON Data
  • Integrations

    • Send form data to API
    • WPForms to API
    • Gravity Forms to API
    • Contact Form 7 to API
    • WooCommerce to API
    • WooCommerce API Product Sync
    • wpDataTables to API
    • Connect WordPress to OpenAI
    • Connect RapidAPI to WordPress
    • Connect Zoho CRM to WordPress
    • Page Builders (Elementor, DIVI)
    • Formidable Forms to API
    • Elementor Form to API
    • JetFormBuilder to API
    • Fluent Forms to API
    • WS Form to API
    • Ninja Tables to API
    • Easy Digital Downloads(EDD) API Product Sync
    • Ultimate Member Forms to API
  • Tips & Tricks

    • Filters & Action Hooks
    • Code Snippets Plugin
    • Troubleshooting
    • Code Snippets
  • PRO Plugin

    • Installation
    • Actions
    • Tokens
    • Caching
    • Nested data
    • Chaining API calls
    • Dynamic Variables
    • Format API to HTML
    • Call API on user registration
    • Using AJAX to trigger API call
    • Base64 Encoding
    • Licensing
    • Filters & Action Hooks
  • OAuth 2.0 Plugin

    • Installation
    • How it works
    • Grant Type - Client Credentials
    • Grant Type - Authorization Code
    • Licensing
  • API to Posts Plugin

    • Installation
    • Getting Started
    • Multiple Endpoints
    • Mapping Fields
    • Filters & Action Hooks
    • Pagination

OAuth 2.0 is a protocol that allows you to connect to a third-party API securely. Your API docs should tell you whether or not your API uses OAuth 2.0.

This article is a high-level look at the features of the OAuth 2.0 plugin and how the plugin works.

Grant Types

Within the OAuth 2.0 protocol, there are several different types of ‘Grant Types’. These are basically just different methods or variants of OAuth 2.0 and require a slightly different setup to one another. Your docs will tell you which Grant Type it uses.

Our OAuth 2.0 plugin supports the following Grant Types:

  • Authorization Code
  • Authorization Code with PKCE
  • Client Credentials
  • We’ve also added a ‘custom’ option for API’s that don’t strictly follow a protocol

Saving Access Token

Once you have filled in and saved your specific OAuth details, a ‘Get Token’ or ‘Authorize’ button will appear, depending on your Grant Type.

Clicking this button will call your OAuth 2.0 token endpoint and if everything is setup correctly, it will return an access token and this access token will be saved in your database for use in your API calls.

Using the Access Token

With the access token saved, you can now setup the API endpoints that you need to call.

Wherever your token needs to be included within these API calls, you simply need to add wpgetapi_oauth_token and the plugin will replace this keyword with the actual token that is saved.

Refreshing the Access Token

The whole point of OAuth 2.0 is that access tokens are short-lived, meaning that they usually expire after an hour or maybe sometimes a little longer. So that after the token is expired, your API calls will no longer work.

Our plugin handles the automatic refresh of tokens so that your access token is always valid.

This is why we use the wpgetapi_oauth_token keyword in place of the actual token. The plugin sees this keyword and looks for a valid access token. If the token is expired or not valid, it will do the necessary token refresh in the background to get a new token that is valid. It then replaces wpgetapi_oauth_token with the new token.

Essentially this plugin is a set-and-forget plugin. It needs to be configured once and then it simply works in the background to keep your access token up to date.

On this page
contact_support

Still not sure?

APIs can be daunting and sometimes downright confusing.

But we are here to help! Our support is amazing and we can assist you with any setup required and ensure your API integrations are a success!

Ask Us Anything

Connect your WordPress website to external APIs without writing a single line of code. Send data from WordPress to your API or display data from your API within WordPress.

Support

  • Documentation
  • Support Ticket
  • Refund Policy
  • Contact Us
  • About Us
  • Affiliates

Articles

  • Quick Start Guide
  • WooCommerce Orders to API
  • WooCommerce API Products Sync
  • Contact Form 7 to API
  • WPForms to API
  • Gravity Forms to API
  • WordPress to RapidAPI

WordPress API Plugins

  • Free WPGetAPI Plugin
  • PRO Plugin
  • API to Posts Plugin Plugin
  • OAuth 2.0 Authorization Plugin

© 2025 WPGetAPI. All Rights Reserved.

"*" indicates required fields

Name*
This field is for validation purposes and should be left unchanged.