Create new Static List in Marketo via Marketo API - marketo

Is there a way to create a new static list in Marketo using the SOAP or REST API? I see I can Add Leads to an Existing List using REST API, but if I want to create a new static list and then add new leads to that static list all through API, is this possible?

I'm pretty sure there's no way to do so. I'm guessing you're trying to "tag" people by putting them in certain lists when things happen? What you can try is have a data field be updated by a trigger campaign that's dynamic. then later search by it?
I'm making some assumptions.

Related

Object storage alternatives in Wordpress

so I am developing a Quiz plugin for Wordpress.
I have defined a shortcode which is replaced by my html, and I also have enqueued javascript and styles. So far all good.
At this point, I want to visualize each question using ajax and jquery. My quiz has some sophisticated logic - some quiz question-trees can fall off depending on the answers and on the settings of the plugin.
Thus, I am trying to achieve a solution, where javascript uses ajax call to fetch one next question at a time. On the backend, I created controller-class which is responsible for handling the logic and outputing the fetched-question's html code. Thus, whenever a starts the quiz, the backend will generate some controller object.
My question is, how can i store multiple controller objects persistently? So that i can get the current use's progress.
To do that, i need some kind of persistent storage for all the running quizzes. Here, as far as I understand, i have 2 alternatives: put serialized controller objects into the database, or use some sort of WP_CACHE.
So now I have some questions:
1) Is there any other alternative for storing a set of objects in Wordpress?
2) Is the approach I am using for the quiz implementation - okay? Like maybe I am doing something unconventional?
3) Is having ajax calls communicating to the DB a good idea?
* Edit *
Thanks to #cabrerahector, who pointed out the set_transient() wordpress API.
I was able to store an object in the db with the following code:
...
$base64_serial = base64_encode(serialize($report_controller));
set_transient($report_id, $base64_serial, 60*60*12);
...
and then retreive the object with the following code:
...
$report_controller = unserialize(base64_decode( get_transient( $_GET['report_id'] )));
...
I know it's kind of hacky, but does anybody know a better way? Please don't tell me to create an array with all fields of the class...

alfresco share site dashboard dashlets

I have created a site dashboard which has 3 dashlets. The data required by 3 dashlets and displaying in different views.
Currently I am using rest api call using "connector.get" inside webscript1.get.js,webscript2.get.js and webscript3.get.js files. Repeatedly calling in all three dashlets.
My question is, can I call it once and share the object with all three dashlets? I tried doing this with surf root objects, but those objects are immutable. Please can any one help?
In this case what you can do is, save the response of your ajax call in one global javascript variable.When first time you are calling an api, it will call the api and then set the response of it to a global javascript variable.
In other dashlets you can check whether this variable is null or not, If not null you can use the data.

Algolia - WordPress - how can I get the actual query into JS variable to work with it further in the hits template?

I would like to do some interesting stuff with the hits that are being displayed based on the search query that user is not only typing into search box but actually filtering using the instant search filters. I have filter based on hierarchical events_location taxonomy. Based on what user selected I would get the info in JS variable that I can then further use to do other operations in the hits div, specifically on each hit card.
So my URL when searching updates like this:
/what-to-see/?q=&idx=sdbeta_posts_events&p=0&hFR%5Btaxonomies_hierarchical.events_calendar.lvl0%5D%5B0%5D=JUL%204&hFR%5Btaxonomies_hierarchical.events_category.lvl0%5D%5B0%5D=All&hFR%5Btaxonomies_hierarchical.events_locations.lvl0%5D%5B0%5D=Paddock%20Stage
I could potentially take the URL and extract the data from it, but I am sure there is more elegant way of working with the query.
In InstantSearch.js, the state is managed by another library called the algoliasearch-helper. Through this library you can read and write the search parameters.
The cleanest to access the helper is to build a custom widget, which is a plain object with lifecycle hooks (initial rendering and the other renderings). You can read more about custom widgets there.
Once you've accessed the helper, you can read and write with the helper API.
This can be found under search.searchParameters
So:
console.log(search.searchParameters);
Will give you whole object that you can then work with.
There is however one issue with this and that is that it works only on initial load. I was unable to make this work or get any data after starting to selecting categories. So if anyone knows how to use this so it updates after each selection please comment bellow.

Marketo REST API Get Multiple Leads By List Id

Will the REST API get leads from a Smartlist? I created a Smartlist and it has one lead. I sent in this API call:
https://.........../rest/v1/list/{DeanReadyToMove}/leads.json?access_token=..............
and got zero leads back. 'DeanReadyToMove' is the list name and the API call seems to talk about reading by list ID but I can't figure out where to get the list ID from if in fact the list name is the wrong thing. Also tried taking the braces out of the API call but no difference.
It is not currently possible to query leads from a smart list in Marketo. You can query leads from a static list.
The latest Bulk Download API will let you input a Smart List or a Static List, and retrieve all the leads included in either type of list.
Here is the documentation for reference:
http://developers.marketo.com/rest-api/bulk-extract/bulk-lead-extract/

Add to Form Results from External Form

Is there an API for adding to the Form Results that results from standard Forms are added to from an External Form?
I want to try avoid adding to the tables btform, btformanswers, etc. manually
No.
See https://github.com/concrete5/concrete5/blob/master/web/concrete/core/controllers/blocks/form.php#L354-L415 -- the core's form block updates the table manually.
As johjoh says, you could theoretically mimic a post to a form block, by instantiating it and then calling action_submit_form(), but that's just as fraught with difficulty, too... you'd have to keep the "form" in sync with your data, and possibly worry about the token and block ID and all that....
What's your exact use case? New block type? Some sort of external API? The form viewing interface in the dashboard is nice, but nothing that special. I think most people want to get data out of it, not in....

Resources