Send Email Template - 302 error

I am trying to send a legacy email template. Here is my request…

https://api.infusionsoft.com/crm/xmlrpc/v1/APIEmailService/sendtemplate?client_id=abc123&client_secret=abc123&access_token=abc123&contactList=354&templateId=87

I keep getting a 302 error and says “Failed to parse XML-RPC request: Premature end of file”.

Is this still possible to do? Am I doing it wrong?

You’re confusing authorization token and api calls (which require an access token)…I have a vid that might clear it up a bit (hopefully)

@John_Borelli Thank you for the reply. I watched your entire video and it definitely helped me understand oAuth. But I still not sure what is wrong with my call.

As I understand, the authorization token gives me the access token. Then I use that access token to make the call, which is what I’m doing.

I am able to make api calls on the new api but legacy seems different. Can you please tell me what is wrong with this call…?

https://api.infusionsoft.com/crm/xmlrpc/v1/APIEmailService/sendtemplate?client_id=abc123&client_secret=abc123&access_token=abc123&contactList=354&templateId=87

Thanks!

I think you are mixing up REST End Points within an XML-RPC call.

The OAuth XML-RPC End Point is this: https://api.infusionsoft.com/crm/xmlrpc/v1

If you use the XML-RPC protocol you will have to format the call in the proper way, as shown in the example here: xml-rpc - Keap Developer Portal

If you are using Infusionsoft SDK it will save you the headache of doing all of this as it will handled it for you,

Yes, what Pav is describing is what I was referring to above as well. Did you download the rpc sdk or are you just reaching out to endpoints with cURL?

Yes, I am using cURL.

I changed the call to:
https://api.infusionsoft.com/crm/xmlrpc/v1/APIEmailService/sendemail?privateKey=abc123&contactList=354&templateID=87

I got a 401 error this time so I think I’m closer. Is this call correct? What should the privateKey be? ClientSecret or Authorization or Access token??

No, you still got it wrong as that URL will not work.

You need to post XML to this URL: https://api.infusionsoft.com/crm/xmlrpc/v1

Take a look at the example here: xml-rpc - Keap Developer Portal

There isn’t a send email template cURL example at that link. The attached picture is what I see when I go to that link…

You will have to construct the cURL command and insert that XML code with your Contact IDs and Template ID you wish to send the Email Template to. That example you mentioned sends to 3 Contacts.

Using the SDK will save you time, unless you are developing against a particular language that there is no SDK for it.