V3 API Wordpress Integration

user984091
Rookie
0 Votes

I am trying to integrate v3 API on my website I was able to get it working on my localhost

i have a custom php template in wordpress I am having a difficult time trying to figure out

1)how can I generate the code on the server as I want the code to be generated automatically without me clicking on the generated url

2)also generate auth token automatically 

2 REPLIES 2
Jimmy_D
Employee
0 Votes

Hi @user984091,

 

You do not have to generate an authentication code more than once. Once you get the Access/Refresh Token for the first time I suggest you store that so it can be accessed when you need it to make an API call. You can then use the Refresh Token as needed to generated a new Access/Refresh Token and replace those with your original set that you stored.


Regards,
Jimmy D.
Tier II API Support Engineer
user49108
Rookie
0 Votes

I have had the same issue saving the refresh token such that it does not expire to solve this you need to make table in db save the token then  setup a cronjob for every hour to refresh the token use system cron instead of wordpress as it will be a little more relaible if you have diffculties you can follow this guide https://www.wpscreators.com/simple-wordpress-custom-constant-contact-api/ 

Resources
Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Announcements

API Updates

Join our list to be notified of new features and updates to our V3 API.

Sign Up