Hi all,
I'm trying to understand how querying and creating Marketo companies works through the API. Here's what I'm struggling with specifically:
When I query companies like this from Postman:
{{base_url}}/rest/v1/companies.json?filterType=externalCompanyId&filterValues=1000244485
I get this result:
{
"requestId": "de8d#17bff2da213",
"result": [],
"success": true
}
I've tried various filterTypes like "id" or "company" and "externalCompanyId" as seen above, but the result was never not empty.
Here's what the description of the company object looks like: ({{base_url}}/rest/v1/companies/describe.json)
"result": [
{
"name": "Company",
"description": "Map for API company fields",
"createdAt": "2019-03-22T17:37:45Z",
"updatedAt": "2019-03-22T17:37:45Z",
"idField": "id",
"dedupeFields": [
"externalCompanyId"
],
"searchableFields": [
[
"externalCompanyId"
],
[
"id"
],
and some more lines. So I should be able to use "id" and "externalCompanyId" as filterTypes, right?
How would I see "id" and "externalCompanyID" in the UI? External Company ID is a hidden system field (???) and what's ID? Is that what I get if I run this CDV?
That creates a field value for "Flexfield 1" but if I use that in the query:
{{base_url}}/rest/v1/companies.json?filterType=id&filterValues=1837
I don't get anything either.
What am I missing here?
-----------
And question two is this: How would I proceed if I wanted to insert/update "contacts" through a non-native sync. Create companies first and then leads by linking them to "externalCompanyId". Or does this work in just one call?
Thanks!
Solved! Go to Solution.
Probably not. I assume that there were just lead list imports into lead and company fields, where something like an "Internal SAP Company ID" holds it all together. So probably there are no companies in that instance, which would mean, no "externalCompanyId" was ever populated.
Marketo's {{company.id}} would exist regardless, right?
Pretty sure the standard non-REST-inserted Companies can’t be used in this scenario.
How would I proceed if I wanted to insert/update "contacts" through a non-native sync. Create companies first and then leads by linking them to "externalCompanyId".
Yes, 2 calls.
For your 1st question, did you create a company using the REST API first?
In addition to Sandford's question, I would recommend specifying the fields you want to retrieve on your Companies query call by simply adding &fields=company,annualRevenue (as example fields).
@Katja_Keesom - I tried that, but to no avail. And if I understand the documentation correctly, with omitted parameter "fields" the call should still return four default fields.
@SanfordWhiteman - hmm, that might be the key question, and I don't know that answer. Probably not. I assume that there were just lead list imports into lead and company fields, where something like an "Internal SAP Company ID" holds it all together. So probably there are no companies in that instance, which would mean, no "externalCompanyId" was ever populated.
Marketo's {{company.id}} would exist regardless, right?
Probably not. I assume that there were just lead list imports into lead and company fields, where something like an "Internal SAP Company ID" holds it all together. So probably there are no companies in that instance, which would mean, no "externalCompanyId" was ever populated.
Marketo's {{company.id}} would exist regardless, right?
Pretty sure the standard non-REST-inserted Companies can’t be used in this scenario.