Questions tagged [api]

An application programming interface (API) specifies how some software components should interact with each other. In addition to accessing databases or computer hardware, such as hard disk drives or video cards, an API can be used to ease the work of programming graphical user interface components. In practice, most often an API is a library that includes specifications for routines, data structures, object classes, and variables.

Filter by
Sorted by
Tagged with
0
votes
1answer
19 views

Get a remote post ID via API given URL

Given you have a URL, how can you get the post ID of a post on a remote WordPress site? As far as I can tell, you would have to: HTTP GET /wp-json/v2/posts And then look for your URL, but the ...
0
votes
0answers
13 views

How to identify remote “Is it WordPress?” programatically?

I am examining a remote site, say with cURL or wp_remote_get()... How can I tell if it is a WordPress site or not, programmatically? Since anything in WordPress can be modified, there can't be a ...
0
votes
0answers
10 views

How to use api key [on hold]

So I've subscribed to https://bridgedataoutput.com/login and i don't know what to do next , how to integrate it with the website , is there any plugin to use ??? please help me
0
votes
1answer
17 views

Wordpress json rest api displaying 10 categories only

Wordpress rest api for categories is displaying 10 categories only. how can i get all list of categories in the api. please help me out of this. Thanks
0
votes
1answer
15 views

How to get Wordpress to respond to a GET request at the end of a Woo product page

I need to initiate an action on a WooCommerce product page if parameters are added to the end of the page. For example: https://somesite.com/products/some-random-product?some-parameter=true If this ...
0
votes
1answer
60 views

Using custom code, how can I fetch data from the WordPress plugin repo?

In the WordPress repo, on the main page for every plugin, it displays the date of the plugin's last update (screenshot). From my own WordPress site, is it possible to fetch this data with custom PHP ...
0
votes
0answers
16 views

WC REST Payment - Stripe Gateway' is not available

I installed the plugin and I could not configure it with stripe I get this error. {"code":407,"message":"Failed to process payment. WooCommerce Gateway 'stripe' exists, but 'WC REST Payment - Stripe ...
0
votes
0answers
36 views

Deleting media using the Wordpress Rest API

I am trying to delete a media object from my Wordpress instance using the Wordpress API in Postman. I'm having trouble finding the endpoint according to the documentation. Here is my http method and ...
0
votes
1answer
25 views

Working with a json feed & trying to figure out how best to import

Good morning all, I need to be able to import a json product feed on a daily basis to update our products and stock. I am starting to write a plugin to make this work, but have a couple of questions ...
0
votes
0answers
9 views

Get origin or context of a how a post got created and/or updated

Is there an easy way to get the context of how a post (as well as custom post types) got created and/or updated? There are two paths I can think of: Via the admin dashboard Via the REST API Is there ...
0
votes
1answer
16 views

Rest API: trouble receiving response through script (browser and Postman display correctly)

I made a simple plugin to practice connections to the WP Rest API. Testing a get request to http://localhost/wptest2/?rest_route=/wp/v2/posts/1 in browser and using Postman, I see the default "Hello ...
-1
votes
1answer
52 views

Rest API does not work after changing Wordpress Theme

Rest API works perfectly with default theme twenty sixteen, but when I change the theme the post on site does not appear. Anyone have the exact problem? <script type="text/javascript"> $(...
0
votes
1answer
14 views

Generate Static Page to Show Search Results/Detail for API

I'm fairly new to WordPress, but well seasoned in PHP. I've looked around for other examples, and most of the code samples I see are all about creating posts and hooking around the search results ...
0
votes
0answers
16 views

WP-API Yoast Default Site titles with snippet variables not saving

I’m using a headless WordPress with WP-API. So, I’m exposing yoast data in the API. With something like this: 'yoast_wpseo_title' => wpseo_replace_vars(get_post_meta($post->ID, '...
0
votes
0answers
37 views

wp_remote_post To external API multiple values with the same key

I am trying to create a WP plugin that calls an external API using HTTP POST. I am using wp_remote_post and my arguments look like this: $body = array( 'CustomerID' => '10', 'Items' => [...
0
votes
1answer
55 views

wp_remote_get() returns 403 while file_get_contents() does not

We are working on a WordPress plugin and we require an API call. We are using the api: http://www.geoplugin.net/json.gp?ip=8.8.8.8 In this context: $response = wp_remote_get("http://www....
0
votes
0answers
58 views

Delete product image using WooCommerce API?

I'm trying to remove product image (one at a time) using WooCommerce API but I'm facing a strange problem. I can remove all associated image at once by sending an empty array in images: { images:[] } ...
1
vote
1answer
38 views

Query Post Preview Updates from the WP API?

Is there a way to query previews made to updates of already published Posts via the WP API? For example, I am making updates to a post that has already been published, I click the preview button, and ...
0
votes
1answer
32 views

Using AJAX to submit and return data inside the WordPress Plugin Boiler Plate framework

I am using the WordPress Plugin Boilerplate to show a form to the user via shortcode. I am just a little confused of the flow of data not so much the syntax to do it. My Main Public Class has a ...
0
votes
0answers
29 views

$_GET['title'] in Wordpress

I work on a site developed a few years ago by someone else. An intranet had been developed on this site. A page of this intranet had to list elements does not work. Here are the first lines, I think ...
0
votes
1answer
16 views

How do I create a WP endpoint that retrieves all custom post types that have a tag?

I have a custom post type, let's call it 'capability'. Each capability can have one or more tags. I have a searchbox on the frontend that the user can type into to search for all capabilities that ...
0
votes
1answer
21 views

Set logged in user based on API response

I have an external application that I want to redirect to a page on a wordpress site. The page needs to be different based on who is logged in. The application has an API endpoint which I can call ...
1
vote
0answers
30 views

Wordpress REST API “rest_authentication_errors” doesn't work external queries?

Wordpress REST API "rest_authentication_errors" doesn't work external queries? I was using following experimental codes for experimental purposes. add_filter('rest_authentication_errors', 'auth'); ...
0
votes
1answer
14 views

Absolute search against wordpress api

I am using the below to search to check if a product category is already created $params = [ 'search' => "category1" ]; $searchedparaCat = $woocommerce->get('products/categories', $params); ...
0
votes
0answers
8 views

Use data from API call to populate post_data to support the Social Warfare plugin in an hybrid SPA wordpress

I'm trying to figure out how to have Social Warfare use something different than $post_data, or to use a filter to change $post_data to what I want before it gets used. Our website has two parts: ...
0
votes
2answers
80 views

Images are displaying as blank images

I am trying to upload base 64 encoded images to my website media library via API. API returns with image ID but these images are displaying as blank images in my media library. Here is my code ...
0
votes
1answer
34 views

API getting null values with wp_remote_post

I'm trying to post some data to an API and I keep getting null values in the fields. My PHP code: $url = 'https://apiconnector.com/v2/address-books/136517/contacts'; $username = 'apiuser'; $...
1
vote
1answer
64 views

How to add WP API and JS featured image attachment

I would like to fetch the image from the wordpress rest api - I have the following code: HTML: <div class="post-item"> <div id="posts">Loading posts... </div> Ajax script: <...
0
votes
1answer
22 views

WordPress single page website redirect to index.html

I have developer angular app from WordPress rest API. I my WordPress baseURL and Angular app both are in same director (this is because WordPress and Angular URL are matched). But in this setup issue ...
0
votes
1answer
39 views

Populating Custom Fields from live JSON

I'm trying to populate WP custom fields using the code below, my problem is I can't output the nested JSON field data.quote.USD. Can someone help find the right direction here? Thank you. //some code ...
0
votes
0answers
20 views

Does WPML have a JSON/REST API to retrieve slugs?

I'm migrating from QTranslate-X to WPML. The resulting redirect rules that were generated are wrong: they point to the English-version slugs rather than the French-version slugs. I therefore want to ...
0
votes
0answers
18 views

WordPress and Azure Directory

We have a WordPress website that is synced with our Azure company directory. This allows users to access this WordPress website with their Email and password SSO (single sign on). Instead of users ...
0
votes
0answers
11 views

404 not found if user, email already exists [Plugin: JSON API User]

-I am using the JSON API User Plugin for WordPress Rest API data. -When i used this API to register a new user, if the user already exists, it retrieves a 404 not found. Thanks in advance Response :...
0
votes
1answer
31 views

Gutenberg internal page link search box

I'm trying to create a field or a select box in a WordPress custom block where the user can select a page and store it's ID or URL like the default internal linking field works. The only difference ...
0
votes
0answers
19 views

Pulling Products from an API

I am working with a client who sells products from a few different vendors. They want a separate page for each vendor and want a list view and detail view of each product. Most of their clients send ...
0
votes
0answers
26 views

Custom post status not working in REST API

I am trying to add a custom post status to my custom post types using thefollowing code: // Register new post status function my_custom_status_creation(){ register_post_status( 'approved', array( ...
0
votes
1answer
17 views

How to get data from a private API and add it to wordpress pages

I got a private API (Cliniko) I want for example the full list of clients to be listed where I want on a page. I know how APIs work, what I don't know is how to implement them in Wordpress. Is there ...
0
votes
1answer
302 views

Can't get POST data in API endpoint callback

I have this: add_action( 'rest_api_init', function () { register_rest_route('my-project/v1/form', '/post', array( 'methods' => 'POST', 'callback' => 'post_form' ) ); }); I called ...
0
votes
1answer
61 views

POST request not going through?

I'm still trying to see clearly in some aspects of the API. I have a custom route add_action( 'rest_api_init', function () { register_rest_route('my-project/v1/', '/form/post/', array( '...
0
votes
0answers
23 views

How to use the WordPress API to get links and scripts in <head> and <body>

I'm using the WordPress API as a headless CMS. I have Elementor plugin installed to do page building in the WordPress admin. I'm trying to figure out how to get all of the <link> and <script&...
0
votes
0answers
44 views

GETing data from a gzip compressed API?

I know WP can get JSON API data via a GET request, but does anyone know plugins/ways that I can get and decompress JSON data from a gzip compressed API? I would then output the JSON response to a ...
0
votes
0answers
24 views

User Information after facebook login using SDK

I am developing a plugin where I am trying to add facebook login. I have added both of my login button code as well as response code ( getting logged in user info after redirect ) in the same page and ...
-1
votes
1answer
70 views

external api call dont know what i´m doing wrong

Hi I'm trying to make a Call to the API I'm pretty new to PHP so if there is an obvious mistake enlighten me. <form method="POST" action=""> <div class="...
0
votes
0answers
40 views

403 why this? what i´m i doing wrong

I'm trying to make a simple API request but I get the 403 code why? <?php $g2aEmail = 'xxx'; // customer email $apiHash = 'xxx'; // customer API hash $apiSecret = 'xxx'; // ...
0
votes
1answer
46 views

Prevent plugin from intruding on wp-json posts api

We use a plugin called Recent Posts Widget Extended (RPWE) to nicely format categorized lists of posts on our company’s support website (WordPress, naturally). It works great, but more importantly, it'...
-1
votes
1answer
23 views

Page structure using The Customizer Api

so I'm trying to customize themes using The Customizer Api, and I've noticed that I can only change the css, is there a way to control the page structure and layout (HTML) ?
0
votes
0answers
20 views

WP API V2 Filtering URL request second tier

I currently have a WP API URL call that looks like https://siteurl/wp-json/wp/v2/knowledge_base?_embed&knowledge_types=8 The JSON code looks like [ { "knowledge_types": 8, } ] How ...
0
votes
1answer
140 views

Wordpress API response filter by ACF value

I'm building a site with wordpress API. I'm using Advanced Custom Fields, and also ACF to Rest API plugin to expose ACF data in API: https://github.com/airesvsg/acf-to-rest-api Now I'm trying to ...
0
votes
1answer
19 views

Customizer JS API get value of customizer field

I want to use a javascript plugin on my website that should be initialized with values set in the wordpress customizer. Kirki::add_field( 'artist_theme_config', array( 'type' => 'select', ...
0
votes
0answers
25 views

woocommerce plugin to query external vendors REST API

All, I am attempting to assist a friend with some research as to how much it efford /cost it would take to start a woocommerce site to sell ATV/Motorcycle parts and accessories. The site would be ...