Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
8 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
24 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
15 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
26 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
15 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
17 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
5 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 :...
-1
votes
0answers
10 views

Is there a plugin for adding any APIs?

I'm trying to have a page on my website that shows the news articles from another websites' news aggregator. They have the following information, but I'm unsure how to implement ANY of it into my ...
0
votes
1answer
5 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
22 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
11 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
53 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
18 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
19 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
25 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
17 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
63 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
25 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
28 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
19 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
38 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
16 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
21 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 ...
0
votes
0answers
21 views

woocommerce update user using REST API

I'm building a SPA using wordpress with woocommerce as the backend. I need customers to be able to change their settings (like billing address) from within the SPA, so I wrote a custom endpoint for ...
0
votes
0answers
10 views

Display index page to user from WP custom plugin

I want to write a simple plugin to display a maintenance mode page. How I can do this? Is there a specify wordpress API to display this page on front-end?
0
votes
0answers
45 views

How to integrate an airtime payment to woocommerce in wordpress

I use woocommerce to sell digital products (audio) on my website. I found about a service that powers an airtime payment gateway so I want to know how to integrate it to woocommerce as a payment ...
0
votes
0answers
17 views

Sending WordPress Data (API) to SQL table

Looking for a solution that can send our WordPress checkout data to a local SQL database in certain table. We have custom form to capture data needed from user for our YII application, just no way to ...
1
vote
1answer
266 views

Stuck with wp_remote_post sending data to an external api on user registration

I am trying to create a basic plugin to send user details to a CRM when a user signs up on the WordPress website as a basic subscriber. I have reached a sticking point, I have tried to interpret the ...
0
votes
1answer
17 views

Create API for registering user on wordpress site with 3rd party site

My site needs to integrate with a 3rd party CRM software, which will live on its own sub-domain, hosted by the CRM company. 1) www.example.com - Main Site 2) testsite.example.com - CRM Hosted on the ...
0
votes
0answers
207 views

Autotrader API Integration

I am looking to pull in a feed of used cars from Autotrader. Has anyone had any luck with the Autotrader API Docs and integrating with WordPress? Their current API documentation is very vague - is ...
0
votes
0answers
21 views

Relations between taxonomy terms for getting parent child nested Json objects and arrays

i have 2 taxonomies (cat) (subcat) and they have some terms(rows) for example , , i want make a relation like SQL data tables between the taxonomy terms for giving me a nested object of arrays in the ...
0
votes
1answer
87 views

Implementing an AJAX POST API call in wordpress

I'm attempting to make a POST request to an API. I've created a javascript file in my theme and i have tried two approaches so far: Approach 1: $.ajax({ headers:{ "Content-Type"...
0
votes
0answers
22 views

How do I include an external API in a wordpress plugin?

I would like to include external API libraries hosted by google on a plugin I am developing and I can't figure out how to. I have a couple that I would like to include in my header. I have tried the ...
0
votes
1answer
69 views

WordPress Upgrade - API files returning 404 on Multisite

I've just upgraded to WordPress 5, and all is working fine on the main site. However on the two sub-branch sites, when I try to create a new post, I receive a white screen and the console reports 404 ...
0
votes
1answer
23 views

How can I call an api before user login

I have a custom login, in which I have 2 apis: The first to post a user phone, and the second to post the user pin to verify the phone. The main issues is that these 2 apis, which has the following ...
0
votes
0answers
19 views

Same function but different add_settings_field

I have two fields but related to each other; Is it possible to have two add_settings_field() with same function? or one add_settings_field() with multiple $id and one function? Or just should have ...
0
votes
0answers
239 views

REST API get featured image source for custom post type

I created a custom post type and am getting the posts using the REST API. The returned json looks like this... categories: [] content: {raw: "Morbi mollis tellus ac sapien. Etiam ut purus matt…allis ...
0
votes
0answers
24 views

API: get the post ID by “title” from external site with cURL

Given $title = "This is the title of a post"; I want to cURL the API and get the post ID. With v1 you could use the [filter] parameter, but that no longer works. There is a similiar question: https:...
0
votes
0answers
29 views

History API & URL for single long page

I'm working on a NON-API Wordpress site. One of the pages is a long page segmented into several sections. At the top of the page is a menu for most of the sections on the page. When a user lands on ...
0
votes
1answer
18 views

Different function call depending on shortcode?

So I've modified a piece of code that includes a call to the Google Distance Matrix API. I wanted it to only work out the distance to a specific address. But I now also want to use it on a different ...
0
votes
0answers
12 views

It's possible to get new features and bugs fixed from the WordPress API?

What I want to do is get the new features and the information related from a specific version of Word Press. I want to get this information from an external php platform. I check the Word Press API ...
0
votes
1answer
42 views

Sending POST Request from server

I have to make a Post request to below and get the response . How can I do this in WordPress. I have [CLIENT_ID] and [CLIENT_SECRET] - i can just change it. [REFRESH_TOKEN] is $_GET('code'); POST ...
0
votes
2answers
265 views

How do I filter Child Posts by Parent Post ID for Custom Post types in Wordpress REST API response?

I have two Custom post types: question and answer. "Questions" are hierarchical and they are parent posts for answers - which are child posts. For every answer, there's a parent question. When someone ...
0
votes
0answers
17 views

Detecting if a Youtube video has been watched and change something on a page in reaction to it

Every of my Youtube videos has a dedicated Wordpress page. I want to detect if a video has been watched (say for example for 80%) and in reaction to it, I want to change something on it's page (I want ...
0
votes
1answer
36 views

Creating posts, containing data from remote API

I need some help and guidance. So I'm developing a website(custom theme) where the goal is to get data from a remote API. I want to be able to store the data in individual posts (one custom post type)...
3
votes
3answers
127 views

Defer Code in Widgets - Page Speed

How to UP Page Speed With Widget Defer? Is there a way to defer a widget in the footer? I have an external API in a footer widget which is slowing down my page. It is not needed until the page is ...
0
votes
1answer
20 views

Passing data outside of Wordpress possible?

We're exploring some possibilities to upgrade our web development tools in using Wordpress, but we're concerned whether or not there is a good plug-in to build custom forms in WordPress and pass data ...
1
vote
1answer
56 views

How do I start using an external API and PHP for a WordPress.org page?

I have created some reports for some web pages that use JavaScript HTTP Requests to retrieve some data from an API. I would like to use the reports on some WordPress pages. I have done a lot of ...