# Best place to start for sending data from custom forms into Keap?

**URL:** <https://integration.keap.com/t/best-place-to-start-for-sending-data-from-custom-forms-into-keap/92364>\
**Category:** API Q&A\
**Tags:** web-forms, landing-page, api\
**Created:** [February 9, 2024, 6:51pm UTC](https://integration.keap.com/t/best-place-to-start-for-sending-data-from-custom-forms-into-keap/92364 "2024-02-09T18:51:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christian\_Zagarskas](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@Christian\_Zagarskas](https://integration.keap.com/u/Christian_Zagarskas)\
**Post date:** [February 9, 2024, 6:51pm UTC](https://integration.keap.com/t/best-place-to-start-for-sending-data-from-custom-forms-into-keap/92364/1 "2024-02-09T18:51:42Z")

</div>

After reading though the list of items below I have some simple questions:

**PREMISE:**  
Because I want to simply send some data from a custom landing page with a custom form using PHP to collect UTM vars and custom fields from paid SEM campaigns…

**Is this a TRUE statement:**  
A) I should use the infusionsoft/infusionsoft-php SDK to make an XML-RPC call to the API via HTTP POST method to the V1 url using **access\_token = Legacy API Key** here: /crm/xmlrpc/v1?access\_token=123abc - because this will make my life easy and it will be around for a long time

**Is this a TRUE statement:**  
B)- I should use use a **Service Account Key** and V2 of the API because its better and the Legacy stuff is going away one day _(which is why its called legacy)_…

or…  
**Is this a TRUE statement:**  
C) Both are true because either could be used, **but option A is the best choice** for PHP and the low volume usage case we are expecting

**I have read through the following:**

- [Developer Guide - Keap Developer Portal](https://developer.infusionsoft.com/developer-guide/)
- [API Helper Libraries - Keap Developer Portal](https://developer.keap.com/resources/helper-libraries/)
- [Keap REST API](https://developer.keap.com/docs/restv2/#tag/Contact/operation/createContactUsingPOST_1)
- [Keap REST API](https://developer.infusionsoft.com/docs/rest/#tag/Contact/operation/createOrUpdateContactUsingPUT)
- [GitHub - infusionsoft/infusionsoft-php: PHP client library for the Infusionsoft API.](https://github.com/infusionsoft/infusionsoft-php)

---

<div class="post-metadata">

**Author:** ![Tom\_Scott](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/tom_scott/32/14748_2.png) [@Tom\_Scott](https://integration.keap.com/u/Tom_Scott)\
**Post date:** [February 9, 2024, 8:04pm UTC](https://integration.keap.com/t/best-place-to-start-for-sending-data-from-custom-forms-into-keap/92364/2 "2024-02-09T20:04:34Z")

</div>

The simplest and most future-proofed method would be B, using a Service Account Key against our Rest V2 API.

---

<div class="post-metadata">

**Author:** ![Christian\_Zagarskas](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@Christian\_Zagarskas](https://integration.keap.com/u/Christian_Zagarskas)\
**Post date:** [May 11, 2024, 6:48pm UTC](https://integration.keap.com/t/best-place-to-start-for-sending-data-from-custom-forms-into-keap/92364/3 "2024-05-11T18:48:33Z")

</div>

Once we submit data from our custom forms the UTM vars are being rejected.

the process looks like this:  
We use the APi key to send data from a custom form into:  
A: email  
B: our local database  
C: Keap of course

We use PUT via createOrUpdateContactUsingPUT  
[https://developer.infusionsoft.com/docs/rest/#tag/Contact/operation/createOrUpdateContactUsingPUT](https://developer.infusionsoft.com/docs/rest/#tag/Contact/operation/createOrUpdateContactUsingPUT)

Then we catch the **contactId** for the use and run this  
[https://developer.infusionsoft.com/docs/rest/#tag/Contact/operation/insertUTMsUsingPOST](https://developer.infusionsoft.com/docs/rest/#tag/Contact/operation/insertUTMsUsingPOST)

However… insertUTMsUsingPOST  
Always fails to update the UTM vars.

The output “says” it works.  
the code returned is 200, along with all of the following:  
[utmSource] =\> test01source  
[utmMedium] =\> test01medium  
[utmTerm] =\> test01term  
[utmCampaign] =\> test01campaign  
[utmContent] =\> test01content

However… That data never gets inserted into the user record.

We use the following call:  
[https://api.infusionsoft.com/crm/rest/v1/contacts/{contactId}/utm](https://api.infusionsoft.com/crm/rest/v1/contacts/%7BcontactId%7D/utm)  
We have tried using all of the following for keapSourceId  
-1  
0  
115 (our default form ID)

How do we get the UTM vars into **createOrUpdateContactUsingPUT** or **insertUTMsUsingPOST**?

---

<div class="post-metadata">

**Author:** ![Marion\_Dorsett2](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/marion_dorsett2/32/14894_2.png) [@Marion\_Dorsett2](https://integration.keap.com/u/Marion_Dorsett2)\
**Post date:** [May 16, 2024, 2:21pm UTC](https://integration.keap.com/t/best-place-to-start-for-sending-data-from-custom-forms-into-keap/92364/4 "2024-05-16T14:21:08Z")

</div>

I just tried this using Postman and I received a 201 created response when I used the form’s XID value.

> **[2024-05-16\_10-17-38](https://app.screencast.com/ajKaPRqskVrWl)**
>
> World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.
