P
P
pipa_and_pupa2021-06-15 15:58:14
JavaScript
pipa_and_pupa, 2021-06-15 15:58:14

How to make an API for Wordpress?

In general, I am a noob, I have tables in MSSQL, I need to display them on a WP site. Partially the tables are filled in, partly they must be filled in on the site and this data must be saved in the database. I kind of made an API using JS that outputs JSON tables, it works on postman. Now the question is what's next? how to add it to the site?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Nesterov, 2021-06-21
@cooder

In general, if without details -
1) In WP, you need to create an appropriate data structure for the structure of your tables. This is done "manually" (custom types + metabox), or with the help of plugins (ACF, Pods, etc.).
2) In WP, you need to implement data loading from your server, where there is already an API.
3) In WP, implement the import of the received data (from JSON) into the WP database.
Total: create a data structure, implement receiving data via API, importing the received data into the site database.
This is in general terms. Implementation details - it all depends on the specifics, each developer can do it in his own way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question