### HTTP Request Example (Conceptual) Source: https://wpgetapi.com/docs/connect-apis-from-rapidapi-to-wordpress Illustrates the conceptual HTTP request structure based on the RapidAPI setup, showing the method, host, and path for fetching a random joke. ```HTTP GET /random/joke HTTP/1.1 Host: dad-jokes.p.rapidapi.com X-Rapidapi-Key: xxxxxxxxxxxxxxxxxxxxxxxxxxx X-Rapidapi-Host: dad-jokes.p.rapidapi.com ``` -------------------------------- ### Zoho API Endpoint Examples Source: https://wpgetapi.com/docs/setting-up-oauth-2-0-authorization Examples of Zoho API endpoints and their associated scope requirements, used for configuring the WPGetAPI plugin. ```APIDOC Zoho API Endpoint Scope Examples: Users Endpoint: - Endpoint: /users - Description: Retrieves user data. - Required Scope: ZohoCRM.users.READ - Reference: https://www.zoho.com/crm/developer/docs/api/v2/get-users.html ``` -------------------------------- ### WPGetAPI Pro Plugin Installation Steps Source: https://wpgetapi.com/docs/quick-start-guide Detailed steps for installing the WPGetAPI Pro plugin into a WordPress site. This involves downloading the plugin zip file, uploading it via the WordPress admin dashboard, and activating it. ```WordPress Plugin Usage 1. Log in to your WordPress admin dashboard. 2. Navigate to the "Plugins" section and click on "Add New Plugin". 3. Click the "Upload Plugin" button. 4. Click "Choose file" and select the downloaded WPGetAPI Pro zip file. 5. Click "Install Now" to upload and install the plugin. 6. Click "Activate Plugin" to activate the plugin. ``` -------------------------------- ### API to Posts Plugin Source: https://wpgetapi.com/docs/frequently-asked-questions Details for the API to Posts plugin, including getting started, handling multiple endpoints, mapping fields, pagination, and available filters/action hooks for customization. ```APIDOC API to Posts Plugin: Getting Started: Basic setup and usage guide. Features: - Multiple Endpoints: Ability to fetch data from several API endpoints. - Mapping Fields: Customize how API data fields map to WordPress post fields. - Pagination: Handles paginated API responses for importing large datasets. Customization: - Filters & Action Hooks: Provides hooks for advanced customization and integration. ``` -------------------------------- ### RapidAPI - Dad Jokes API Example Source: https://wpgetapi.com/docs/connect-apis-from-rapidapi-to-wordpress Demonstrates the process of selecting and testing an API from RapidAPI, using the 'Dad Jokes' API as an example. It covers subscribing to a free plan and testing a specific endpoint to verify functionality before integrating with WordPress. ```APIDOC API Example: Dad Jokes API on RapidAPI Category: Entertainment Endpoint: Random Jokes Subscription: - Free plan available. - Hard Limit: 50 calls/day on free plan. Testing: - Navigate to the API's page on RapidAPI. - Click 'Subscribe to Test' button. - Choose a pricing plan (e.g., free). - Go to the 'Endpoints' tab. - Click 'Test Endpoint' button. - Verify response data. Integration Note: After testing, use the API key and endpoint details within the WPGetAPI plugin settings. ``` -------------------------------- ### WPGetAPI Plugin: PHP Code Example Source: https://wpgetapi.com/docs/connect-using-api-key-in-headers A basic PHP example demonstrating how to use the WPGetAPI plugin's functions within a WordPress theme or plugin to fetch data from a configured API endpoint. ```PHP get_current_user_id(), // Get the current logged-in user's ID 'limit' => 10 ); // Fetch data from the configured API endpoint // The third parameter can be used to pass arguments/parameters to the API call $api_response = wpgetapi_get_data( $api_endpoint_name, '', $params ); // Check if the API call was successful and returned data if ( ! is_wp_error( $api_response ) && ! empty( $api_response ) ) { // Process the API response data // $api_response will typically be an array or object depending on the API's output (JSON, XML, etc.) echo '

API Data:

'; echo '
';
        print_r( $api_response ); // Display the raw response for debugging
        echo '
'; // Example: Displaying a specific field if the response is JSON like {"name": "Example"} // if ( isset( $api_response['name'] ) ) { // echo '

API Name: ' . esc_html( $api_response['name'] ) . '

'; // } } else { // Handle API errors or empty responses if ( is_wp_error( $api_response ) ) { echo '

Error fetching data: ' . esc_html( $api_response->get_error_message() ) . '

'; } else { echo '

No data received from the API.

'; } } } else { // Inform the user if WPGetAPI plugin is not active echo '

WPGetAPI plugin is not active. Please activate it to use its features.

'; } ?> ``` -------------------------------- ### User Login Data Example Source: https://wpgetapi.com/docs/call-api-with-actions Example data structure representing a user's login event. It includes user details, capabilities, and metadata. Note that sensitive information like passwords is not available. ```php array ( 'data' => array ( 'ID' => '70', 'user_login' => 'Test User', 'user_nicename' => 'Bob Smith', 'user_email' => '[email protected]', 'user_url' => '', 'user_registered' => '2023-07-10 04:45:33', 'user_status' => '0', 'display_name' => 'Bob', // ... other data fields ), 'caps' => array ( 'subscriber' => true, ), 'meta' => array ( 'locale' => '', 'wp_user_level' => '0', 'last_update' => '1688964334', 'wc_last_active' => '1688947200', // ... other meta fields ), ) ``` -------------------------------- ### WPGetAPI Setup for OpenAI API Key Source: https://wpgetapi.com/docs/connect-wordpress-to-openai-chatgpt Illustrates how to input your OpenAI API key into the WPGetAPI settings. This is a crucial step for authenticating your requests to the OpenAI service. ```APIDOC WPGetAPI OpenAI API Key Setup: Navigate to WPGetAPI settings in WordPress. Locate the API Key field. Enter your OpenAI API key obtained from your OpenAI account profile. Example Input: API Key: sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` -------------------------------- ### Easy Digital Downloads Purchase Data Example Source: https://wpgetapi.com/docs/call-api-with-actions Example data structure for Easy Digital Downloads complete purchase actions. It contains transaction details, user information, and purchased download items. Specific data points are accessible via tokens, such as (action:user_info:user_email). ```PHP [ "key" => "392bf557400db696e75ee75a25cc20ee", "email" => "[email\u00a0protected]", "date" => "2023-07-18 11:46:20", "user_info" => [ "id" => "1", "first_name" => "a", "last_name" => "a", "email" => "[email\u00a0protected]" ], "downloads" => [ 0 => [ "id" => "17100", "quantity" => "1", "options" => [ "quantity" => "1" ] ] ], "cart_details" => [ 0 => [ "name" => "test", "id" => "17100", "item_number" => [ "id" => "17100", "quantity" => "1", "options" => [ "quantity" => "1" ] ], "item_price" => "15.000000000", "quantity" => "1", "discount" => "0.000000000", "subtotal" => "15.000000000", "tax" => "0.000000000", "price" => "15.000000000", "order_item_id" => "2" ] ], "currency" => "USD", "tax" => "0.000000000", "payment_id" => 17110 ] ``` -------------------------------- ### OAuth 2.0 Plugin Source: https://wpgetapi.com/docs/frequently-asked-questions Documentation for the WPGetAPI OAuth 2.0 plugin, covering installation, its operational mechanism, and specific grant types like Client Credentials and Authorization Code. ```APIDOC OAuth 2.0 Plugin: Installation: Refer to general plugin installation docs. Functionality: Manages OAuth 2.0 authentication for API connections. Grant Types Supported: - Client Credentials: For server-to-server authentication. - Authorization Code: For user-delegated authorization. ``` -------------------------------- ### Standard Authorization Header Example Source: https://wpgetapi.com/docs/oauth-2-0-with-grant-type-client-credentials Illustrates the typical format for an Authorization header when using a Bearer token, as commonly seen in API documentation. ```APIDOC Authorization: Bearer d92d4xxxxxxxxxxxxxxxxxx15f52 ``` -------------------------------- ### Formatting API Data Output Source: https://wpgetapi.com/docs/step-by-step-example Guides on transforming raw API data into user-friendly formats within WordPress, including HTML, HTML tables, image galleries, and raw JSON. ```APIDOC Format API to HTML: - Description: Convert API data into standard HTML markup for display. - Usage: Useful for displaying simple text-based API responses. Format API to HTML Table: - Description: Structure API data into a sortable and filterable HTML table. - Usage: Ideal for displaying lists of items or structured data sets. Format API to Image Gallery: - Description: Create an image gallery from API data that includes image URLs. - Usage: Displaying product images, user avatars, or other visual content. Format JSON Data: - Description: Display raw JSON data returned by the API, often for debugging or specific use cases. - Usage: Useful when the API response is inherently JSON and needs to be presented as such. ``` -------------------------------- ### OpenAI API Request Example (cURL) Source: https://wpgetapi.com/docs/understand-api-docs Illustrates a typical cURL command for making a POST request to the OpenAI API's completions endpoint, including headers and data payload. ```cURL curl https://api.openai.com/v1/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "model": "text-davinci-003", "prompt": "Say this is a test", "max_tokens": 7, "temperature": 0 }' ``` -------------------------------- ### Formatting API Data Output Source: https://wpgetapi.com/docs/setting-up-oauth-2-0-authorization Guides on transforming raw API data into user-friendly formats within WordPress, including HTML, HTML tables, image galleries, and raw JSON. ```APIDOC Format API to HTML: - Description: Convert API data into standard HTML markup for display. - Usage: Useful for displaying simple text-based API responses. Format API to HTML Table: - Description: Structure API data into a sortable and filterable HTML table. - Usage: Ideal for displaying lists of items or structured data sets. Format API to Image Gallery: - Description: Create an image gallery from API data that includes image URLs. - Usage: Displaying product images, user avatars, or other visual content. Format JSON Data: - Description: Display raw JSON data returned by the API, often for debugging or specific use cases. - Usage: Useful when the API response is inherently JSON and needs to be presented as such. ``` -------------------------------- ### Formatting API Data Output Source: https://wpgetapi.com/docs/the-setup-page Guides on transforming raw API data into user-friendly formats within WordPress, including HTML, HTML tables, image galleries, and raw JSON. ```APIDOC Format API to HTML: - Description: Convert API data into standard HTML markup for display. - Usage: Useful for displaying simple text-based API responses. Format API to HTML Table: - Description: Structure API data into a sortable and filterable HTML table. - Usage: Ideal for displaying lists of items or structured data sets. Format API to Image Gallery: - Description: Create an image gallery from API data that includes image URLs. - Usage: Displaying product images, user avatars, or other visual content. Format JSON Data: - Description: Display raw JSON data returned by the API, often for debugging or specific use cases. - Usage: Useful when the API response is inherently JSON and needs to be presented as such. ``` -------------------------------- ### Example API Header with Direct Token (for illustration) Source: https://wpgetapi.com/docs/setting-up-oauth-2-0-authorization Illustrates a typical API header format for authorization using a direct access token. This format is shown to contrast with the recommended placeholder method, highlighting the need for dynamic token management. ```text Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxxxxxxx15f52 ``` -------------------------------- ### API to Posts Plugin Setup Source: https://wpgetapi.com/docs/getting-started-api-to-posts Details the steps for setting up the API to Posts plugin to import and save API data as WordPress posts. It covers activating endpoints, testing data format, and configuring the plugin's core settings. ```APIDOC API to Posts Plugin Setup: 1. **Activate Endpoint for Saving**: - Navigate to your API endpoint settings within WPGetAPI. - Locate the 'Import & Save' field and select 'Yes'. - Save the endpoint. - *Note*: Ensure the endpoint returns data in **PHP array format**. 2. **Test Endpoint Data**: - Use the 'Test Endpoint' button to verify data retrieval and format. 3. **Configure API to Posts Plugin**: - Access the 'API to Posts' menu in the WordPress sidebar. - Select the activated endpoint to begin configuration. - The plugin offers 5 tabs for setup: - **API Settings**: Configure API data type (single item, multiple items, detail). - **Post Settings**: Define how posts or products are created. - **API Importer**: Trigger API calls and save data. - **Data Mapping**: Map API fields to WordPress fields. - **Post Creator**: Create posts based on mapping and settings. **Data Type Considerations**: - **Multiple items**: Most common for lists of data. - **Single item**: For APIs returning a single record. - **Detail**: Used when importing data from multiple endpoints (requires specific setup). ``` -------------------------------- ### WPGetAPI API to Posts Plugin Source: https://wpgetapi.com/docs/using-with-ninja-tables Details the functionality of the API to Posts plugin, which allows importing data from APIs directly into WordPress posts. It covers getting started, handling multiple endpoints, mapping fields, pagination, and available filters/hooks. ```APIDOC WPGetAPI API to Posts Plugin: Overview: Imports data from external APIs and creates WordPress posts or custom post types. Getting Started: - Install and activate the plugin. - Configure API endpoints within WPGetAPI. - Map API data fields to WordPress post fields (title, content, custom fields). Key Features: - Multiple Endpoints: - Supports fetching data from and creating posts from multiple API endpoints simultaneously. - Allows defining separate mappings for each endpoint. - Mapping Fields: - Provides a flexible interface to map specific fields from the API response (JSON) to WordPress post attributes (e.g., title, content, featured image, custom fields, taxonomies). - Supports mapping nested JSON data. - Pagination: - Handles paginated API responses to ensure all available data is fetched and processed. - Configuration options for pagination parameters (e.g., page number, items per page). - Filters & Action Hooks: - Offers hooks for developers to customize the post creation process, modify data before saving, or perform actions after posts are created. - Example: Filter to modify post content before saving, hook to trigger actions after post creation. ``` -------------------------------- ### User Deletion Data Example Source: https://wpgetapi.com/docs/call-api-with-actions Example data structure for a user deletion event. The structure is identical to the user login data, reflecting the user's state at the time of deletion. ```php array ( 'data' => array ( 'ID' => '70', 'user_login' => 'Test User', 'user_nicename' => 'Bob Smith', 'user_email' => '[email protected]', 'user_url' => '', 'user_registered' => '2023-07-10 04:45:33', 'user_status' => '0', 'display_name' => 'Bob', // ... other data fields ), 'caps' => array ( 'subscriber' => true, ), 'meta' => array ( 'locale' => '', 'wp_user_level' => '0', 'last_update' => '1688964334', 'wc_last_active' => '1688947200', // ... other meta fields ), ) ``` -------------------------------- ### JetFormBuilder Submission Data Structure (PHP) Source: https://wpgetapi.com/docs/call-api-with-actions Example data structure for a JetFormBuilder submission. JetFormBuilder uses field names to access values. The example shows how to retrieve the value from the 'color_picker' field. ```PHP [ "__form_id" => 60978, "__refer" => "http://localhost:8888/staging/a", "__is_ajax" => FALSE, "post_id" => "60905", "text_field" => "test text value", "color_picker" => "#724f4f" ] ``` -------------------------------- ### API Authentication Methods Source: https://wpgetapi.com/docs/getting-started-api-to-posts Explains common methods for authenticating API requests with WPGetAPI, focusing on API keys passed via headers or query strings, and general authentication/authorization concepts. ```APIDOC API Key in Headers: - Description: Securely pass API keys or tokens within the HTTP request headers. - Common Header: 'Authorization: Bearer YOUR_API_KEY' or custom headers like 'X-API-Key: YOUR_API_KEY'. API Key in Query String: - Description: Include API keys as a parameter directly in the API endpoint URL. - Usage: Example: 'https://api.example.com/data?api_key=YOUR_API_KEY'. Authentication & Authorization: - Description: General overview of how WPGetAPI handles various authentication schemes (e.g., OAuth 2.0, Basic Auth) and authorization tokens to access protected API resources. ``` -------------------------------- ### Zoho CRM API - Get Users Endpoint Source: https://wpgetapi.com/docs/setting-up-oauth-2-0-authorization Information on how to retrieve a list of users from the Zoho CRM API using the GET method. This endpoint is part of the Zoho CRM API v2. ```APIDOC APIDOC: Title: Zoho CRM API - Get Users Endpoint Description: Retrieves a list of users from the Zoho CRM. This is an example endpoint for demonstrating API integration. Endpoint: - Method: GET - URL: https://www.zoho.com/crm/developer/docs/api/v2/get-users.html (Conceptual, actual URL depends on base API URL and authentication) Parameters: - Authorization: Required. OAuth 2.0 Bearer Token. - Parameters for filtering or pagination might be available (refer to specific Zoho CRM API documentation). Returns: - A JSON object containing a list of user records. Example Usage: - This would typically be called via the wpgetapi plugin after successful OAuth 2.0 authorization. Related Documentation: - Zoho CRM API v2 Overview: https://www.zoho.com/crm/developer/docs/api/v2/oauth-overview.html ``` -------------------------------- ### API Authentication Methods Source: https://wpgetapi.com/docs/step-by-step-example Explains common methods for authenticating API requests with WPGetAPI, focusing on API keys passed via headers or query strings, and general authentication/authorization concepts. ```APIDOC API Key in Headers: - Description: Securely pass API keys or tokens within the HTTP request headers. - Common Header: 'Authorization: Bearer YOUR_API_KEY' or custom headers like 'X-API-Key: YOUR_API_KEY'. API Key in Query String: - Description: Include API keys as a parameter directly in the API endpoint URL. - Usage: Example: 'https://api.example.com/data?api_key=YOUR_API_KEY'. Authentication & Authorization: - Description: General overview of how WPGetAPI handles various authentication schemes (e.g., OAuth 2.0, Basic Auth) and authorization tokens to access protected API resources. ``` -------------------------------- ### WPForms Submission Data Structure (PHP) Source: https://wpgetapi.com/docs/call-api-with-actions Example data structure for a WPForms submission. WPForms uses field IDs to access values. The example shows how to retrieve the file URL from field ID 11. ```PHP array ( 9 => array ( 'name' => 'Name', 'value' => 'test test', 'id' => 9, 'type' => 'name', 'first' => 'test', 'middle' => '', 'last' => 'test', ), 5 => array ( 'name' => 'Single Line Text', 'value' => 'test', 'id' => 5, 'type' => 'text', ), 10 => array ( 'name' => 'Multiple Choice', 'value' => 'First Choice', 'value_raw' => 'First Choice', 'id' => 10, 'type' => 'radio', ), 11 => array ( 'name' => 'File Upload', 'value' => 'http://localhost:8888/staging/wp-content/uploads/wpforms/57895-2c68ef3ed28e3767df892e65436a8a46/Screen-Shot-2023-07-12-at-5.04.59-pm-7cabd466ffd7824c49a1fa25dabf8c2b.png', 'value_raw' => array ( 0 => array ( 'name' => 'Screen-Shot-2023-07-12-at-5.04.59-pm.png', 'value' => 'http://localhost:8888/staging/wp-content/uploads/wpforms/57895-2c68ef3ed28e3767df892e65436a8a46/Screen-Shot-2023-07-12-at-5.04.59-pm-7cabd466ffd7824c49a1fa25dabf8c2b.png', 'file' => 'Screen-Shot-2023-07-12-at-5.04.59-pm.png', 'file_original' => 'Screen-Shot-2023-07-12-at-5.04.59-pm.png', 'file_user_name' => 'Screen Shot 2023-07-12 at 5.04.59 pm.png', 'ext' => 'png', 'attachment_id' => 0, 'id' => 11, 'type' => 'image/png', ), ), 'id' => 11, 'type' => 'file-upload', 'style' => 'modern', ) ) ``` -------------------------------- ### WPGetAPI Core Features Source: https://wpgetapi.com/docs/getting-started-api-to-posts Overview of core functionalities provided by the WPGetAPI plugin, including caching API calls, retrieving nested data, chaining requests, and using dynamic variables. ```APIDOC WPGetAPI Core Functionalities: - **Caching API Calls**: - Reduces redundant API requests by storing responses locally. - Improves performance and reduces server load. - Configuration options for cache duration and invalidation. - **Retrieve Nested Data**: - Enables fetching and processing data from complex, nested JSON or XML API responses. - Provides methods to navigate and extract specific data points from hierarchical structures. - **Chaining API Calls**: - Allows sequential execution of multiple API requests, where the output of one call can be used as input for the next. - Facilitates complex data retrieval workflows. - **Dynamic Variables**: - Supports sending dynamic data (e.g., user IDs, form inputs) to API endpoints. - Enables personalized or context-aware API requests. - **Format API Data as HTML**: - Provides functionality to transform raw API data into HTML structures for display on WordPress sites. - **Call API on User Registration**: - Triggers API requests automatically upon new user registration in WordPress. - **Using AJAX to Trigger API Call**: - Allows API calls to be initiated asynchronously from the frontend using JavaScript (AJAX). - **Base64 Encoding**: - Supports Base64 encoding for data transmission, often required for authentication headers or specific API parameters. ``` -------------------------------- ### WPGetAPI OAuth 2.0 Plugin Source: https://wpgetapi.com/docs/using-with-ninja-tables Documentation for the WPGetAPI OAuth 2.0 plugin, covering installation, how it works, and specific grant types like Client Credentials and Authorization Code. It also mentions licensing for the plugin. ```APIDOC WPGetAPI OAuth 2.0 Plugin: Overview: Facilitates secure API authentication using the OAuth 2.0 protocol. Installation: - Standard WordPress plugin installation process. How it Works: - Manages OAuth 2.0 flows to obtain access tokens for protected APIs. - Integrates with WPGetAPI to use these tokens for authenticated API requests. Grant Types Supported: 1. Client Credentials: - Use Case: Machine-to-machine authentication where the client application acts on its own behalf. - Setup: Requires Client ID and Client Secret from the authorization server. - Process: Client requests an access token directly using its credentials. 2. Authorization Code: - Use Case: Delegated access, typically for user-facing applications where a user grants permission. - Setup: Requires Client ID, Client Secret, Authorization URL, and Token URL. - Process: Involves redirecting the user to an authorization server, obtaining an authorization code, and exchanging it for an access token. Licensing: - Information regarding plugin licensing is available. ``` -------------------------------- ### Elementor Forms Submission Data Structure (PHP) Source: https://wpgetapi.com/docs/call-api-with-actions Example data structure for an Elementor Forms submission. Elementor Forms uses field IDs (or names in simpler cases) to access values. The example shows how to retrieve the 'email' value. ```PHP [ "name" => "Bob Smith", "email" => "[email protected]", "message" => "Testing" ] ``` -------------------------------- ### Fluent Forms Submission Data Structure (PHP) Source: https://wpgetapi.com/docs/call-api-with-actions Example data structure for a Fluent Forms submission. Fluent Forms uses field names to access values, including nested structures. The example shows how to retrieve 'email' and 'first_name' values. ```PHP [ "__fluent_form_embded_post_id" => "117", "_fluentform_1_fluentformnonce" => "6cd8c08c02", "_wp_http_referer" => "/fluent-form/", "names" => [ "first_name" => "Bob", "last_name" => "Smith" ], "email" => "[email protected]", "entry_id" => 1 ] ``` -------------------------------- ### WordPress Integrations with WPGetAPI Source: https://wpgetapi.com/docs/getting-started-api-to-posts Showcases how WPGetAPI can integrate with various WordPress plugins and features, enabling data exchange and automation between external APIs and the WordPress environment. ```APIDOC Send form data to API: - Description: Connect WordPress forms (e.g., WPForms, Gravity Forms, Contact Form 7, Elementor Form, JetFormBuilder, Fluent Forms, WS Form, Formidable Forms) to send submitted data to an external API. WooCommerce API Product Sync: - Description: Synchronize product data between WooCommerce and an external API. Connect WordPress to OpenAI: - Description: Integrate with OpenAI's API (e.g., ChatGPT) for AI-powered content generation or analysis within WordPress. Connect RapidAPI to WordPress: - Description: Utilize WPGetAPI to connect to APIs listed on the RapidAPI marketplace. Connect Zoho CRM to WordPress: - Description: Integrate WordPress with Zoho CRM to sync contact or lead data. Using with wpDataTables / Ninja Tables: - Description: Fetch API data directly into wpDataTables or Ninja Tables for advanced data visualization and management. Easy Digital Downloads (EDD) API Product Sync: - Description: Synchronize product data between Easy Digital Downloads and an external API. Ultimate Member Forms to API: - Description: Send data submitted through Ultimate Member forms to an external API. ``` -------------------------------- ### New Post Published Data Example Source: https://wpgetapi.com/docs/call-api-with-actions Example data structure for a new post being published. It includes post details, author, dates, status, categories, tags, and meta fields. This structure is also used for status changes and deletion events. ```php [ "ID" => 61003, "post_author" => "1", "post_date" => "2023-07-18 12:04:46", "post_date_gmt" => "2023-07-18 02:04:46", "post_title" => "asdf dsaf", "post_status" => "publish", "comment_status" => "open", "ping_status" => "open", "post_name" => "asdf-dsaf", "post_modified" => "2023-07-18 12:04:46", "post_modified_gmt" => "2023-07-18 02:04:46", "post_parent" => 0, "guid" => "http://localhost:8888/staging/?p=61003", "menu_order" => 0, "post_type" => "post", "comment_count" => "0", "filter" => "raw", "meta" => [ "_edit_lock" => "1689645881:1", "_edit_last" => "1" ], "old_status" => "draft", "category" => [ 0 => [ "term_id" => 13034, "name" => "Used", "slug" => "used", "term_group" => 0, "term_taxonomy_id" => 13034, "taxonomy" => "category", "parent" => 0, "count" => 1, "filter" => "raw" ] ], "post_tag" => [ 0 => [ "term_id" => 13054, "name" => "test tag", "slug" => "test-tag", "term_group" => 0, "term_taxonomy_id" => 13054, "taxonomy" => "post_tag", "parent" => 0, "count" => 6, "filter" => "raw" ] ] ] ``` -------------------------------- ### Formidable Forms Submission Data Structure (PHP) Source: https://wpgetapi.com/docs/call-api-with-actions Example data structure for a Formidable Forms submission. Formidable Forms uses field IDs within the 'item_meta' array to access values. The example shows how to retrieve the value from field ID 3. ```PHP [ "frm_action" => "create", "form_id" => "1", "form_key" => "contact-form", "item_meta" => [ 1 => "Bob", 2 => "Smith", 3 => "[email protected]", 4 => "Testing a single text field", 5 => "Testing a textarea field" ], "frm_submit_entry_1" => "15e12e88f6", "_wp_http_referer" => "/staging/aaaa/", "entry_id" => 14 ] ``` -------------------------------- ### API Authentication Methods Source: https://wpgetapi.com/docs/setting-up-oauth-2-0-authorization Explains common methods for authenticating API requests with WPGetAPI, focusing on API keys passed via headers or query strings, and general authentication/authorization concepts. ```APIDOC API Key in Headers: - Description: Securely pass API keys or tokens within the HTTP request headers. - Common Header: 'Authorization: Bearer YOUR_API_KEY' or custom headers like 'X-API-Key: YOUR_API_KEY'. API Key in Query String: - Description: Include API keys as a parameter directly in the API endpoint URL. - Usage: Example: 'https://api.example.com/data?api_key=YOUR_API_KEY'. Authentication & Authorization: - Description: General overview of how WPGetAPI handles various authentication schemes (e.g., OAuth 2.0, Basic Auth) and authorization tokens to access protected API resources. ``` -------------------------------- ### API Authentication Methods Source: https://wpgetapi.com/docs/the-setup-page Explains common methods for authenticating API requests with WPGetAPI, focusing on API keys passed via headers or query strings, and general authentication/authorization concepts. ```APIDOC API Key in Headers: - Description: Securely pass API keys or tokens within the HTTP request headers. - Common Header: 'Authorization: Bearer YOUR_API_KEY' or custom headers like 'X-API-Key: YOUR_API_KEY'. API Key in Query String: - Description: Include API keys as a parameter directly in the API endpoint URL. - Usage: Example: 'https://api.example.com/data?api_key=YOUR_API_KEY'. Authentication & Authorization: - Description: General overview of how WPGetAPI handles various authentication schemes (e.g., OAuth 2.0, Basic Auth) and authorization tokens to access protected API resources. ``` -------------------------------- ### Configuring API and Endpoint in WPGetAPI Source: https://wpgetapi.com/docs/quick-start-guide Steps to set up an API connection and define specific endpoint details within the WPGetAPI plugin. This includes entering API details, saving, and then filling in endpoint specifics. ```WordPress Plugin Usage Step 2: Add your API - Fill in the details for the API you are using. - Hit 'Save'. A new tab for the API will be created. Step 3: Add endpoint details - Click into the newly created API tab. - Fill in the endpoint details. - Hit the 'Save' button. ``` -------------------------------- ### Paid Memberships Pro Checkout Data Example Source: https://wpgetapi.com/docs/call-api-with-actions Example data structure associated with Paid Memberships Pro checkout actions. It includes details like membership level, business information, user ID, and payment gateway. Values can be accessed using specific tokens, e.g., (action:business_name). ```PHP [ "level" => "1", "checkjavascript" => "1", "business_name" => "test business name", "bcountry" => "US", "bemail" => "[email\u00a0protected]", "bconfirmemail" => "[email\u00a0protected]", "CardType" => "Unknown Card Type", "ExpirationMonth" => "01", "ExpirationYear" => "2023", "submit-checkout" => "1", "javascriptok" => "1", "order_id" => "48", "user_id" => "5", "gateway" => "free", "CVV" => "-- sensitive value hidden --" ] ``` -------------------------------- ### OAuth 2.0 Grant Types Source: https://wpgetapi.com/docs/getting-started-api-to-posts Documentation for setting up OAuth 2.0 authentication with WPGetAPI, covering different grant types like Client Credentials and Authorization Code for secure API access. ```APIDOC OAuth 2.0 Plugin Configuration: This plugin facilitates secure API access using OAuth 2.0. **Supported Grant Types**: 1. **Client Credentials Grant**: - **Purpose**: Used for machine-to-machine authentication where the client application accesses API resources directly. - **Setup**: Requires Client ID and Client Secret provided by the API provider. - **Flow**: The client application requests an access token directly from the authorization server using its credentials. 2. **Authorization Code Grant**: - **Purpose**: Used for delegated authorization, typically for user-facing applications where a user grants permission to access their data. - **Setup**: Requires Authorization URL, Token URL, Client ID, Client Secret, and Redirect URI. - **Flow**: Involves redirecting the user to the authorization server, obtaining an authorization code, and exchanging it for an access token. ``` -------------------------------- ### Gravity Forms Submission Data Example Source: https://wpgetapi.com/docs/call-api-with-actions This snippet displays an example array of data submitted through a Gravity Forms form. Unlike Contact Form 7, Gravity Forms uses field IDs as keys for accessing submission data. For instance, a field with ID '2' can be accessed via the token '(action:2)'. ```php array ( 'id' => '409', 'status' => 'active', 'form_id' => '5', 'ip' => '::1', 'source_url' => 'http://localhost:8888/staging/a/', 'currency' => 'USD', 'post_id' => '', 'date_created' => '2023-07-12 03:09:21', 'date_updated' => '2023-07-12 03:09:21', 'is_starred' => '0', 'is_read' => '0', 'user_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36', 'payment_status' => '', 'payment_date' => '', 'payment_amount' => '', 'payment_method' => '', 'transaction_id' => '', 'is_fulfilled' => '', 'created_by' => '1', 'transaction_type' => '', 1 => 'technology', 2 => '[email protected]', ) ``` -------------------------------- ### WooCommerce Order Status Changed Data Example Source: https://wpgetapi.com/docs/call-api-with-actions This snippet shows an example array representing data associated with a WooCommerce order status change event. It includes details like order ID, status, currency, customer information, and line items. This data structure is crucial for understanding the payload when integrating with WooCommerce order updates. ```php array ( 'id' => '60963', 'parent_id' => '0', 'status' => 'pending', 'currency' => 'USD', 'version' => '7.8.0', 'prices_include_tax' => '', 'date_created' => array ( 'date' => '2023-07-11 14:41:52.000000', 'timezone_type' => 3, 'timezone' => 'Australia/Melbourne', ), 'discount_total' => '0', 'discount_tax' => '0', 'shipping_total' => '0', 'shipping_tax' => '0', 'cart_tax' => '0', 'total' => '0.00', 'total_tax' => '0', 'customer_id' => '0', 'order_key' => 'wc_order_HL6T4nWrGq5My', 'billing' => array ( 'first_name' => '', 'last_name' => '', 'company' => '', 'address_1' => '', 'address_2' => '', 'city' => '', 'state' => '', 'postcode' => '', 'country' => '', 'email' => '', 'phone' => '', ), 'shipping' => array ( // ... same as billing ), 'payment_method' => '', 'payment_method_title' => '', 'transaction_id' => '', 'customer_ip_address' => '', 'customer_user_agent' => '', 'created_via' => 'admin', 'customer_note' => '', 'date_completed' => '', 'date_paid' => '', 'cart_hash' => '', 'order_stock_reduced' => '', 'download_permissions_granted' => '', 'new_order_email_sent' => '', 'recorded_sales' => '', 'recorded_coupon_usage_counts' => '', 'number' => '60963', 'line_items' =>array ( 0 => array ( 'id' => 28, 'order_id' => 60965, 'name' => 'iPhone 14', 'product_id' => 58590, 'variation_id' => 0, 'quantity' => 3, 'tax_class' => '', 'subtotal' => '4200', 'subtotal_tax' => '0', 'total' => '4200', 'total_tax' => '0', ), ), ) ``` -------------------------------- ### API Authentication Methods Source: https://wpgetapi.com/docs/easy-digital-downloadsedd-api-product-sync Explains common methods for authenticating API requests with WPGetAPI, focusing on API keys passed via headers or query strings, and general authentication/authorization concepts. ```APIDOC API Key in Headers: - Description: Securely pass API keys or tokens within the HTTP request headers. - Common Header: 'Authorization: Bearer YOUR_API_KEY' or custom headers like 'X-API-Key: YOUR_API_KEY'. API Key in Query String: - Description: Include API keys as a parameter directly in the API endpoint URL. - Usage: Example: 'https://api.example.com/data?api_key=YOUR_API_KEY'. Authentication & Authorization: - Description: General overview of how WPGetAPI handles various authentication schemes (e.g., OAuth 2.0, Basic Auth) and authorization tokens to access protected API resources. ``` -------------------------------- ### OpenAI API Request Example with curl Source: https://wpgetapi.com/docs/understand-api-docs Demonstrates how to make a POST request to the OpenAI completions API using the curl command-line tool. It shows the necessary headers for content type and authorization, and how to send data in the request body. ```curl curl https://api.openai.com/v1/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "model": "text-davinci-003", "prompt": "Say this is a test", "max_tokens": 7 }' ``` -------------------------------- ### OAuth 2.0 Authorization Code Grant Setup Source: https://wpgetapi.com/docs/setting-up-oauth-2-0-authorization Details the process of setting up OAuth 2.0 Authorization using the Authorization Code grant type with the wpgetapi plugin. This includes registering an application with a service provider and configuring the plugin with the obtained credentials. ```APIDOC APIDOC: Title: OAuth 2.0 Authorization Code Grant Setup Description: Guides users through setting up OAuth 2.0 Authorization using the Authorization Code grant type with the wpgetapi plugin, using Zoho CRM API as an example. Steps: 1. Register an application with the API provider (e.g., Zoho Developer Console). - Choose 'Server-based Application' client type. - Fill in required fields: Client Name, Homepage URL, Authorized Redirect URIs. - Authorized Redirect URIs format: https://YOURWEBSITE/wp-admin/admin.php?page=wpgetapi_oauth 2. Obtain Client ID and Client Secret from the provider after application creation. 3. Configure the wpgetapi plugin with the obtained Client ID, Client Secret, and other necessary authorization details. Dependencies: - wpgetapi plugin - OAuth 2.0 Authorization Plugin (https://wpgetapi.com/downloads/oauth-2-0-authorization/) Example Provider Docs: - Zoho CRM API OAuth Overview: https://www.zoho.com/crm/developer/docs/api/v2/oauth-overview.html - Zoho CRM API Users Endpoint: https://www.zoho.com/crm/developer/docs/api/v2/get-users.html Related Concepts: - OAuth 2.0 Grant Types (Client Credentials, Authorization Code) - Callback URL / Redirect URI ``` -------------------------------- ### Formatting API Data Output Source: https://wpgetapi.com/docs/getting-started-api-to-posts Guides on transforming raw API data into user-friendly formats within WordPress, including HTML, HTML tables, image galleries, and raw JSON. ```APIDOC Format API to HTML: - Description: Convert API data into standard HTML markup for display. - Usage: Useful for displaying simple text-based API responses. Format API to HTML Table: - Description: Structure API data into a sortable and filterable HTML table. - Usage: Ideal for displaying lists of items or structured data sets. Format API to Image Gallery: - Description: Create an image gallery from API data that includes image URLs. - Usage: Displaying product images, user avatars, or other visual content. Format JSON Data: - Description: Display raw JSON data returned by the API, often for debugging or specific use cases. - Usage: Useful when the API response is inherently JSON and needs to be presented as such. ``` -------------------------------- ### WPGetAPI Shortcode Usage Source: https://wpgetapi.com/docs/troubleshooting Examples of using the WPGetAPI shortcode to fetch API data directly within WordPress content. It shows how to specify API and endpoint IDs, and pass parameters. ```html [wpgetapi_endpoint api_id='api_id' endpoint_id='endpoint_id' param1='value1' param2='value2'] ``` -------------------------------- ### WPGetAPI Endpoint Header Configuration Source: https://wpgetapi.com/docs/oauth-2-0-with-grant-type-client-credentials Details the specific configuration required within the WPGetAPI endpoint setup to utilize the dynamic token. This involves setting the header name and its corresponding value. ```APIDOC Name: Authorization Value: Bearer wpgetapi_oauth_token ```