admin管理员组

文章数量:1431726

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 a plugin that can help me do it? Or, what's the better way to do it?

And yes I have searched google up to page 10(and clicked almost every single link) I have seen lots of guides or maybe things that can work but nothing consistent, and almost everything that could be good is at least 3 years old, that's why I'm asking here, so please don't be *****. Thank you very much for any help, that's very much appreciated.

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 a plugin that can help me do it? Or, what's the better way to do it?

And yes I have searched google up to page 10(and clicked almost every single link) I have seen lots of guides or maybe things that can work but nothing consistent, and almost everything that could be good is at least 3 years old, that's why I'm asking here, so please don't be *****. Thank you very much for any help, that's very much appreciated.

Share Improve this question asked Apr 21, 2019 at 14:34 Steacy PaquetteSteacy Paquette 13 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You can fetch data using wp_remote_get().

//API URL
$url = 'your api url';

// API RESPONSE
$response = wp_remote_get($url, "your headers goes here / use array to set multiple headers.");

you can then access content from $response.

$response['body']; // will give you content.

wrap it with your own function name and add this code in your functions.php file. Call the function from your custom page template file.

本文标签: pluginsHow to get data from a private API and add it to wordpress pages