Submitting Lead through API, Can I set the Source or Reason? | Community
Skip to main content
Jan 23, 2017 4:42 PM UTC
Solved

Submitting Lead through API, Can I set the Source or Reason?

When we submit an upsert change through the REST API, is it possible to attach a custom Source or Reason with the event?

Normally, after I submit a change, I can see the updated field in that Lead's activity list, it shows the old value, the new value, the time of the change, a Source, and a Reason.

If I log into Marketo and update a Lead by hand, the activity gets a Source of "Person update" and a Reason of "Manual person edit"

If I go through the API, both fields get set to "Web service API"

Could I have my API call save a reason like "My First API Application"

marketohost.wpengine.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#!/Leads/syncLeadUsingPOST

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Grégoire_Miche2
Grégoire_Miche2Accepted solution
Level 10
Jan 23, 2017 6:25 PM UTC

Hi Matthew,

No you cannot. The API does not provide the possibility to set your own values and it's not possible to change it afterwards.

-Greg

8 replies

Grégoire_Miche2
Grégoire_Miche2Accepted solution
Level 10
Jan 23, 2017 6:25 PM UTC

Hi Matthew,

No you cannot. The API does not provide the possibility to set your own values and it's not possible to change it afterwards.

-Greg

Translate
ChristinaZuniga
Level 9
Jan 23, 2017 6:22 PM UTC

I have a lot of integrations and they all use "Web service API" which made it difficult for me to determine lead source. What I did was have each of those systems create a hidden field and I connected it to a custom Marketo field I call "Integration Source". Then all they do is pass along the data like "CVENT" or "Vidyard", etc.


That field is overwritten each time a lead interacts with one of those, but I can have interesting moments fire off, lead source created, last lead source updated, etc. that allow me to see when that integration touched or created a lead. It works well for me!

Translate
Sep 20, 2017 1:51 AM UTC

Hi Christina,

I'm having the same issue. Could you please explain what you mean when you say those systems create a "hidden field" that you then "connect to" a customer Marketo field?

Do you mean that you have the web service api sources write to your Integration Source field? I created a similar field called API Source that one of our web api sources writes to. I was considering getting the others to do so as well - but realized it would get over-written each time - which isn't helpful when troubleshooting. So I was thinking about blocking API Source from updates and creating an API Source Most Recent field that could get overwritten.

Thank you,

Denise

Translate
SanfordWhiteman
Level 10
Sep 20, 2017 2:33 AM UTC

Sounds like a good idea to me, Denise.

Note you can actually attach a Reason to the Push Lead API endpoint. This Reason remains attached to the Push Lead activity and can be queried.

However, not all API-based apps use this endpoint (I would venture that few do b/c they don't see the advantages). Push is a good substitute to for upserting leads in batches, but it doesn't allow for the pure bulk importing of the Bulk Import API.

Translate