How to retrieve list of my templates using API?


(Pragati Paliwal) #1

I am a PHP developer, but new to integration of Infusionsoft APIs.

I am trying to create a platform, where I need to show my users all their Templates that they have created on Infusionsoft. Is there an API method using which I can retrieve a list of Template IDs and Titles?


(Nicholas Trecina) #2

Hi @Pragati_Paliwal, are you referring to email broadcast templates (Marketing > Email Broadcasts > Send Email) or classic templates (Marketing > Templates)?


(John Borelli) #3

The templates that you can create under marketing (notes, emails, phone, task etc) can be read using the Templates table via the query method of the api.


(Pragati Paliwal) #4

Hi @Nicholas_Trecina , I am referring to classic templates (Marketing > Templates). Do you have php code as an example or API name?


(Pragati Paliwal) #5

I have tried to read via query but not getting any result. May be I am not passing right parameters. If you have integrated it before, can you please share your code with me?


(John Borelli) #6

I think the first thing to do, as @Nicholas_Trecina has suggested, is to clear up what templates you are looking to get. Some templates are not found on that table so this is really the key to knowing. Where are the templates you are looking for created in the UI?


(Nicholas Trecina) #7

Here’s a snippet of PHP code that will get you the first 100 classic templates:

$infusionsoft->data()->query('Template', 100, 0, array('Id' => '%'), array('Id', 'Categories', 'PieceTitle', 'PieceType'))

(Pragati Paliwal) #8

I got the classic template Ids. Thanks for you help @Nicholas_Trecina and @John_Borelli