Marketo - REST API field for Microsoft Type - marketo

In case of a sync between Marketo and Microsoft Dynamics the "Microsoft Type" field is added to leads data.
The issue is that there is no access to "Microsoft Type" field via REST API. I don't find its REST API name in the export fields document.
Any idea why it's not available or anyone knows the REST API name for Microsoft Type field?

Well, we integrated our Marketo instance with Salesforce, so I'm not 100% sure how the Type field is called in case of Microsoft Dynamics. However, based on the Salesforce integration (where the API name of the SFDC Type field is sfdcType) I would expect it to be "microsoftType".
To make sure, I would make a call to the Describe Lead API endpoint –at GET /rest/v1/leads/describe.json– to get a list of the field names available on the Lead object.
The response looks something like this:
[
{
"id":4,
"displayName":"Company Name",
"dataType":"string",
"length":255,
"rest": {
"name":"company",
"readOnly":false
},
"soap": {
"name":"Company",
"readOnly":false
}
}
// … other field descriptions
{
"id":90,
"displayName":"SFDC Type",
"dataType":"string",
"length":50,
"rest": {
"name":"sfdcType",// <- REST API name
"readOnly":true
}
}
// … other field descriptions
]

I've made a custom field(Marketo Microsoft Type) and a campaign where I assign Microsoft Type value to the new created custom field

Related

Api Platform and Embedded Write

I have this issue with my Symfony Api Platform; I have two entities: a news and an author; every news belongs to an author.
I want to expone an API to let some external clients to add a news, using a JSON with author details; if an author already exists, the platform should be able to retrieve the author for that news, and store the news.
I embed a JSON as author, the Platform will always create a new author, also if an author with same key ( let the slug ) already exists.
Which is the best way to handle this situation? Let I have this payload:
{
"author": {
"slug": "luca"
}
"title":"news Title"
}
I expect that the API search for a user, add OR create a new one, than save the news for that author.
I add a unique constrain based the author slug, I got a database error because the platform try to store a new author every time.
But I don't want to have a public API where the client has to add an IRI , cause the client should FIRST add an author, IF NOT EXISTS on my db, THAN use the IRI ... too difficult.
Which is for you the best way to archieve this? Using some kind of event subscriber? or a DTO?
Thanks in advance

How to add JSON section tags to a SendGrid contact for parsing with handlebars templating language in dynamic email

A Brief Overview of the Problem
I am trying to store JSON data on my SendGrid contacts for usage in dynamic email templates designed in the SendGrid GUI.
To start, within the SendGrid email builder I can write the following code within a codeblock:
Here is the handlebar code in that code block...
<ol>
{{#each user.accounts}}
{{#if this.isPending}}
<li>
{{this.name}} is <strong>pending activation.</strong>
</li>
{{else}}
<li>
{{this.name}} is <strong>active.</strong>
</li>
{{/if}}
{{/each}}
</ol>
When I go to preview that code & add some test data I get the following:
Here is the JSON code in that code block formatted a bit nicer...
{
"user": {
"accounts": [
{
"name": "Checking",
"isPending": false
},
{
"name": "401k",
"isPending": true
},
{
"name": "Savings",
"isPending": true
}
]
}
}
The Question
Everything mentioned above is PERFECT so far - this is exactly what I want... To populate email data based on dynamic content present on each contact the email is going to. Here is where I hit the roadblock, where is that JSON Test Data coming from on the contact when the real email is sent out? And how do I populate a contact with JSON data using the API?
As far as I can tell, there is no option to add this custom JSON data to a new contact when creating one via the API (or via the GUI, for that matter) (see API docs here)
When I set up this email to send out to my SendGrid contacts via a SendGrid automation flow, does anyone know how to populate the JSON used by my code block for showing pending/activated accounts with data specific to each user?
Thank you, I greatly appreciate any help on this!
I think that JSON data is actually only useful when you are using the API to send an email with a template. You then provide the JSON data as dynamic_template_data and it is populated in the email template.
When dealing with Automations, you need to pull the data from the contact record itself. You can get the data you have on a Contact in the Tags section of the template designer.
There are a number of fields that already exist on contacts, like first_name, last_name, email, address_line_1, etc. You can also add Custom Fields which give you further fields you can use on your contacts. Custom Fields can be created by adding new columns on an CSV upload of your contacts, by creating them in the SendGrid admin or by creating them via API.
If you are using the API to create or update your contacts, you can pass an object of custom_fields as part of the contact record in the API request. For example:
const data = {
"contacts": [
{
"email": "ryan39#lee-young.com",
"custom_fields": {
"w1": "2002-10-02T15:00:00Z",
"w33": 9.5,
"e2": "Coffee is a beverage that puts one to sleep when not drank."
}
}
]
};
Note that to set custom fields on a contact when you create/update by the API like this, you need to use the custom field ID as the key in the custom_fields object (like the example above, the IDs "w1", "w33" , "e2" were used). If you need to know those IDs, you can use the API to get all field definitions.
Once you have added Custom Fields they will also be available as Tags in the design editor, then you can use them in the email design.
The only thing is, I notice you are using an array of accounts in your example. If you need an array of arbitrary data, then I don't believe you can achieve that with contact data and automations. You can set individual custom fields for, say, a checking account, 401k and savings. But you cannot have arbitrary data in a custom field. If you really need the data to be arbitrary, then Automations might not be right for you and you should send your emails out using the send mail API and providing dynamic template data.

How to get details about a publication using Microsoft Academic Knowledge API

I'm using the Interpret and Evaluate methods from Project Academic Knowledge.
If you search for Composite(J.JN='jama') and include J.JId in the request, you'll get a response with the Id 172573765:
{
"logprob": -14.823,
"prob": 3.651345212E-07,
"Id": 2107832644,
"J": {
"JId": 172573765
}
}
You can find more details about that journal by opening: https://academic.microsoft.com/journal/172573765
However, there doesn't seem to be a way to retrieve that same information (Number of papers, number of citations, website, about) using the API. How can we get this (other than by accessing the URL of the journal)?
Project Academic Knowledge allows you to retrieve journal entities using the Evaluate method. The query is simply Id=JId. For example, to retrieve the journal name, publication and citation counts you'd use:
https://api.labs.cognitive.microsoft.com/academic/v1.0/evaluate?subscription-key=SUBSCRIPTION_KEY&attributes=Id,JN,DJN,CC,PC&expr=Id=172573765
See the journal entity documentation page for a list of the available attributes you can request.

Event attendee ID missing on Google Calendar Events list response

The Google Calendar specifies that it will return an array of Event resources that will also include:
attendees[].id (string) The attendee's Profile ID, if available. It
corresponds to theid field in the People collection of the Google+ API
However, when I invoke the Events:list API it returns me an attendee with the following properties only:
{
"email": "attendee.address#gmail.com",
"displayName": "Attendee Name",
"responseStatus": "accepted"
}
I would like to fetch more information (and namely the user avatar) for this user/attendee by invoking the Google+ API, however, without an ID I can't do much.
The endpoint that I am using to fetch events is https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events?${params} which I confirm is the latest API version.
Any thoughts on this issue would be much welcome!

Using the Freebase search api mql_output parameter to obtain linked data

I am trying to use the freebase search API to obtain the parties of specific politicians as well as general biographical data (using php). I know that the search api passes the id of each search result found to an MQL query specified by the mql_output parameter.
Here is the MQL query I have at the moment which I use for the mql_ouput parameter
{
"name":null,
"/people/person/date_of_birth":null,
"/people/person/gender":null,
"/wikipedia/topic/en_id":null,
"id":null,
"/government/politician/party":[
{
party : null
}
]
}
and this is the resultant query url
https://www.googleapis.com/freebase/v1/search?Barrack%20Obama&filter=%28all%20type%3Apolitician%29&mql_output=%7B%22name%22%3Anull%2C%22%5C%2Fpeople%5C%2Fperson%5C%2Fdate_of_birth%22%3Anull%2C%22%5C%2Fpeople%5C%2Fperson%5C%2Fgender%22%3Anull%2C%22%5C%2Fwikipedia%5C%2Ftopic%5C%2Fen_id%22%3Anull%2C%22id%22%3Anull%2C%22%5C%2Fgovernment%5C%2Fpolitician%5C%2Fparty%22%3A%5B%7B%7D%5D%7D&key=AIzaSyDdJ_9L6mcWXinx5Lehku2TULmJhOMESew&indent=true
Thanks for your help, sorry that it's quite basic question,
Mark
Answer
Could not self answer due to not enough forum rep.
I just realised what I needed to do after going over some more examples. To have the database retrieve the party information I needed to use the following query.
{
"name":null,
"/people/person/date_of_birth":null,
"/people/person/gender":null,
"/wikipedia/topic/en_id":null,
"id":null,
"/government/politician/party":{
"party" : null
}
}
Mark
I just realised what I needed to do after going over some more examples. To have the database retrieve the party information I needed to use the following query.
{ "name":null, "/people/person/date_of_birth":null, "/people/person/gender":null, "/wikipedia/topic/en_id":null, "id":null, "/government/politician/party":{ "party" : null } }
Mark

Resources