Skip Navigation

[Resolved] API calls for database

This support ticket is created 5 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 3.98 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 5 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#1200413

Hi,

I just have a few general clarifying questions regarding API.

Our organisation is partnering with a CRM provider, and we are wanting to take the user generated posts (custom post type) and automatically feed into the CRM system.

I am no expert, but I wonder if you could see a possibility for an API call that could be connected to a database - given that the CRM providor faciliate this on their side?

Thank you!

#1200415

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Andrea

This sounds like a case where you would want to use the REST API for this, which you can read about here: https://developer.wordpress.org/rest-api/

Toolset doesn't add anything special to this.

For your custom post types in the settings you need to make sure the option show_in_rest is checked (it is disabled by default), which will make the post type available in the REST API.

Custom fields can be retrieved as the raw values from the database (if you do not know already, fields are stored with a key that uses a 'wpcf-' prefix, so a Types field "status" would be stored in wp_postmeta with a key of 'wpcf-status', for example).

We don't currently have any special endpoints to return formatted fields, but that may come as we work on deepening our Gutenberg integration.