• WordPress.com
  • Forums
  • Plans & Pricing
  • Log In
  • Get Started
  • WordPress Hosting
  • Domain Names
  • Website Builder
  • Create a Blog
  • Newsletter
  • Professional Email
  • Website Design Services
  • Commerce
  • Enterprise
  • Overview
  • WordPress Themes
  • WordPress Plugins
  • WordPress Patterns
  • Google Apps
  • WordPress.com Support
  • News
  • Website Building Tips
  • Business Name Generator
  • Logo Maker
  • Popular Topics
  • Daily Webinars
  • Learn WordPress
Get Started
  • Sign Up
  • Log In
About
  • Plans & Pricing
Products
  • WordPress Hosting
  • Domain Names
  • Website Builder
  • Create a Blog
  • Newsletter
  • Professional Email
  • Website Design Services
  • Commerce
  • Enterprise
Features
  • Overview
  • WordPress Themes
  • WordPress Plugins
  • WordPress Patterns
  • Google Apps
Resources
  • WordPress.com Support
  • News
  • Website Building Tips
  • Business Name Generator
  • Logo Maker
  • Popular Topics
  • Daily Webinars
  • Learn WordPress
en WordPress.com Forums How to send a POST request to the WordPress REST API?

How to send a POST request to the WordPress REST API?

  • xanadu6 · Member · Dec 20, 2023 at 5:48 pm
    • Copy link Copy link
    • Add topic to favorites Add topic to favorites

    I want to make posts to my blog by using the WordPress API.

    In order to authenticate my requests, I understand that I have to create a username and password for a private app.

    This video tries to explain how to create an application password.

    The problem is, the UI has changed since that video was made. After opening the Users tab, no option appears to create an application.

    So, how can I create a new app to give it a username and password so I can authenticate my API calls?

  • umair4342fa0bcb · Member · Dec 20, 2023 at 6:00 pm
    • Copy link Copy link

    there are actually a few different authentication methods available, each with its own advantages and security considerations. Here’s a breakdown of the options:
    Method: Using username and password embedded in the Authorization header.
    Advantages: Simple to implement, compatible with many libraries and tools.
    Disadvantages: Less secure, passwords are exposed during transmission, not suitable for long-lived applications

    OAuth 1.0a:

    Method: Industry-standard OAuth protocol with tokens and authorization codes.
    Advantages: More secure than basic authentication, tokens can be refreshed, suitable for long-lived applications.
    Disadvantages: More complex to implement, requires additional steps in the authorization flow
    OAuth 2.0:

    Method: Newer version of OAuth with improved security and flexibility.
    Advantages: Most secure option, supports different grant types like client credentials and password, suitable for various use cases.
    Disadvantages: Requires careful configuration and management of tokens, can be complex for beginners.
    Basic authentication: If you’re working with a simple script or need a quick solution, basic authentication might be sufficient. However, avoid this method for sensitive data or long-lived applications.
    OAuth 1.0a: Consider this option if you need more security than basic authentication but want to avoid the complexity of OAuth 2.0.
    OAuth 2.0: Choose this method for best security practices and maximum flexibility, especially for long-lived applications or those interacting with sensitive data.

    1. Using the “API Keys” Feature:
      Using the JWT Authentication for WP-API Plugin:

    If you’re looking for a more robust and flexible token-based authentication system, consider using the “JWT Authentication for WP-API” plugin.
    This plugin allows you to create various types of tokens with different permissions and expiration times.
    After installing and activating the plugin, follow the provided instructions to create your desired JWT token for API access.

    1. Using the WordPress.com REST API:

    If you’re using WordPress.com, they offer their own OAuth API authentication system.
    Go to the “My Sites” page on WordPress.com.
    Click on the site you want to manage and navigate to “Tools > Jetpack”.
    Click on the “Connect” button to enable Jetpack for your site.
    Once Jetpack is enabled, go to “Settings > Jetpack” and then to the “Connections” tab.
    Click on the “Add New” button and select “API”.
    Give your API a name and click “Create API Key”.
    Your API key and secret will be displayed. Use them for authentication with the WordPress.com REST API

  • xanadu6 · Member · Dec 20, 2023 at 6:19 pm
    • Copy link Copy link

    @umair4342fa0bcb Thank you for your reply.

    The menus don’t match what you are describing for the Jetpack option.

    Could you please provide a screenshot of what I should be seeing?

  • xanadu6 · Member · Dec 20, 2023 at 8:10 pm
    • Copy link Copy link

    @umair4342fa0bcb Is this possible on a free account?

  • umair4342fa0bcb · Member · Dec 20, 2023 at 8:39 pm
    • Copy link Copy link

    However, there are still options for interacting with your WordPress site on a free account:

    • Jetpack Plugin: The free Jetpack plugin unlocks some limited APIs for features like contact forms and social sharing. You can explore its offerings to see if any meet your needs.
    • External Plugins: Some specialized plugins might offer their own APIs even for free accounts. However, their capabilities and functionalities will vary greatly.
    • Alternative Methods: Consider alternative methods for posting content besides the WordPress API, like directly editing theme files (not recommended for beginners) or using third-party tools that integrate with WordPress without requiring API access.

    Remember, free accounts on WordPress.com are primarily for creating and hosting basic websites. They offer limited flexibility compared to paid plans. If you need full API access for advanced functionality, upgrading to a paid plan might be necessary.

    I hope this clarifies the limitations of free accounts and provides alternative options for your needs. Feel free to ask if you have any further questions or need help exploring specific tools or plugins.

  • xanadu6 · Member · Dec 20, 2023 at 10:21 pm
    • Copy link Copy link

    @umair4342fa0bcb I’m sorry. I didn’t understand the clear answer to my question. I apologize. Let me rephrase for clarity…

    Is it possible to access the WordPress API with a free account?

  • The topic ‘How to send a POST request to the WordPress REST API?’ is closed to new replies.

Tags

  • account
  • design

About this topic

  • In: Support
  • 2 participants
  • 5 replies
  • Last activity 1 year
  • Latest reply from xanadu6
Advertisment

WordPress.com

WordPress.com WordPress.com Logo

Products

  • WordPress Hosting
  • Domain Names
  • Website Builder
  • Create a Blog
  • Professional Email
  • P2: WordPress for Teams
  • Website Design Services
  • Enterprise Solutions

Features

  • Overview
  • WordPress Themes
  • WordPress Plugins
  • WordPress Patterns
  • Google Apps

Resources

  • WordPress.com Support
  • WordPress Forums
  • WordPress News
  • Website Building Tips
  • Business Name Generator
  • Logo Maker
  • Discover New Posts
  • Popular Tags
  • Blog Search
  • Daily Webinars
  • Learn WordPress
  • Developer Resources

Company

  • About
  • Partners
  • Press
  • Terms of Service
  • Privacy Policy
  • Do Not Sell or Share My Personal Information
  • Privacy Notice for California Users

Language

Mobile Apps

  • Download on the App Store
  • Get it on Google Play

Social Media

  • WordPress.com on Twitter Twitter Icon
  • WordPress.com on Facebook Facebook Icon
  • WordPress.com on Instagram Instagram Icon
  • WordPress.com on YouTube Youtube Icon
An Automattic invention
Work With Us
    • WordPress.com Forums
    • Customize
    • Sign up
    • Log in
    • Copy shortlink
    • Report this content
    • Manage subscriptions