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:

Read More

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?

Related posts

Leave a Reply

1 comment

  1. 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.