Showing results for 
Search instead for 
Did you mean: 

API for Php version 5.2

Occasional Participant

Re: API for Php version 5.2

Thank you elijah. You are such a big help to me who is newbie. 

Regarding the api that uses curl, the one you gave to me, I checked on it if there is any function related to GET ALL THE CONTACTS FROM SPECIFIC LIST? I can't seem to find it on the given example. So, I tried this one

function getContacts($list_id) {
return json_decode( MakeRequest("$list_id?api_key="._apiKey,"GET"));

It didn't work. Can you help me please

Honored Contributor

Re: API for Php version 5.2

Hello Mark,


You've got the right idea with using the list ID, but we actually have a specific API endpoint that is used for lists. You can find the specifications for that here:


Based on the specifications on that link, the format for your URL will be like this:{listId}/contacts?limit={1-500}&api_key={APIKey}


So if I take that format and use it in the code function, it comes out like this:

function getContacts($list_id, $limit) {
return json_decode( MakeRequest("$list_id/contacts/?limit=$limit&api_key="._apiKey,"GET"));


One other important thing to note is that if the list has more than $limit contacts, the system will return a pagination URL that you can use to fetch the next page of results. If youlook at the example response in the documentation I linked above, you can see an example of how that link is delievered.



Elijah G.

API Support Specialist

Elijah G.
API Support Engineer