Marketo - How to get the mandatory fields information in leads database - marketo

I would like to fetch the mandatory fields information in in leads database.
Is there any way to do this

There are no mandatory fields in the Person object in Marketo. If you wanted, you could create records with no information at all. If you just want to get the field names, use the 'describe' call.
GET /rest/v1/leads/describe.json
For full details, see http://developers.marketo.com/rest-api/lead-database/leads/#describe

Related

Multi-layered query

I'm trying to avoid creating additional custom field for one of the posts, and was wondering if there is a way to query WP DB to retrieve the necessary data.
I have 3 types of posts: Events, Programs and Locations. On the event post type, there is a custom field for program it is related to. On the program post type, there is a custom field for location.
I'm looking for a query, that can add to the single-location.php document, which will retrieve all the events in that location, without the need to create an additional custom field.
My logic was: get me all the events and filter all the events, where the related program, has a related location, which is the title of this post.
Would it be possible?

What is the best way to create a web traffic log in DynamoDB?

I have a newspaper and would like to register the hits for every news article. I was thinking of tbl_hits with fields ArticleId and sort field timestamp (plus Other attribute fileds for headers, browser type).
However usually i get multiple hits for the same article at theexact same time so I guess I wont be able to register them since I will get duplicate key error.
What primary key + sorting fields would you recommend? Thanks so much.

Error : The entity passed to the choice field must be managed

In a search form, when I submit for the second time the datas containing a equipment criterion, I receive this error :
Entity of type "App\Entity\Equipment" passed to the choice field must be
managed. Maybe you forget to persist it in the entity manager?
There is a example flow to reproduce the problem :
I introduce criteria (without equipment criterion) to find the corresponding adverts
I submit the serach form
The adverts are showed without problem
I introduce one or many equipment criteria (via a multiple choices list of entity type)
I submit the serach form
The adverts are showed without problem
I introduce for the second time one or many new equipment criteria
I submit the search form
I receive the error :
Entity of type "App\Entity\Equipment" passed to the choice field must be
managed. Maybe you forget to persist it in the entity manager?
Somebody have an idea to resolve this problem?
Thanks for your help.

Marketo REST API - what is "dedupeFields" for custom objects?

When it comes to creating/updating custom objects, can I use both dedupeFields or lookupField when pushing the data to Marketo?
What is the difference between the two?
I'm not sure what do you mean under lookupField, as there is no such input field described in the API documentation of the Sync Custom Objects endpoint. (That is the endpoint to create or update custom objects.)
In the other hand, you do not need such a standalone lookup field, as with the input array you provide the objects you want to create or update, with all their important values. Have a look at the sample payload in the docs.
When input is used together with the optional dedupeBy and action fields, you have full control over which object you want to create or update.
Also, the endpoint expects the name of the dedupe field under dedupeBy key, as opposed to dedupeFields. So the name is singular; you can provide a single field name use, and it does what you can expect: if the value in the field for a given record is not unique, an error will be returned for the individual record.

Marketo REST API - is there a way to get all records of a custom object?

I created a custom object and i want to get all its existing records. Is there a way of doing that via the REST API? Seems like a very basic and simple operation but i couldn't find information about it anywhere.
As you say, it seems like a basic task, but in the reality, it is more complex indeed.
Unfortunately, the Get Custom Object endpoint (which is the only endpoint to fetch Custom Objects) requires the filterType and filterValues parameters to be present as well. Basically this means that you have to have some information about the queried objects beforehand.
Also, a further restriction is that the value of filterType can only be one of the “searchable” fields of the Custom Object, meaning that it has to be either a Link field or a Dedupe field. (These fields are listed under the searchableFields property in the response from the Describe Custom Objects endpoint.)
So as mentioned above, you have to know the values for at least one of the properties of your Custom Objects before you make the query.
With additional queries though, you can grab these required values.
Let's say, you have your Custom Object linked to the Lead Object, and the Link field is called Owner Email (with the REST API name being ownerEmail) which links to the Email Address field of the Lead Object. In this case you could set the filterType to ownerEmail and set the emails of the leads as filterValues.
Then it is up to you how you gather the emails of those Leads who has a Custom Object attached. Luckily the REST API won’t throw an error if you provide a value that has no corresponding Custom Objects.
If your Custom Object is linked to a Lead, it's a bit complex but you can do like this:
Create a smart list and filter with "Has You Custom Object"
Get the smart list with API (GET /rest/asset/v1/smartLists.json)
Based on this list of Leads, get all Custom Objects (see the other answer).

Resources