Rob Myrick
Rob Myrick

Reputation: 859

How to communicate with an API

I am developing a Wordpress plugin that needs to retrieve an Affiliate ID from an outside website - a website based upon this API.

The idea is this:

1) Refer the user to the website and have them sign up as affiliate.

2) User returns to the Wordpress CMS and enters their Affiliate ID

3) Somehow I would like to verify the correct/incorrect Affiliate ID after saving user input.

So my question is 2 parts:

a. How do I accomplish validation of a user's affiliate ID?,

b. Do I need to load the API inside of my Wordpress plugin, or do I communicate with the API through the outside server?

Upvotes: 1

Views: 1444

Answers (1)

Kevin Goedecke
Kevin Goedecke

Reputation: 1983

Regarding b):

You need to make the calls within your WordPress plugin. I got the feeling that you're missing some basics. Please have a look at this article about HTTP & REST.

Basically you only have to make a POST request and the API returns you what ever you want.

Upvotes: 1

Related Questions