Re: Which fields do I use in teh API to track country, state and inviter_email?

Dianna_Sadler
Level 2

Which fields do I use in teh API to track country, state and inviter_email?

Hello,

We were able to integrate our Trial with Marketo program status via custom API calls and update the program status. I'm hoping someone in this community can help with providing insight into what fields I need to use in the API to track `inviter_email`, `country` & `state`? ( for the inviter_email field, our reps send out personal invites to prospects and we want to track who sent the invite out - is this a new custom field we'd create?)

Here's what we're using now:

```leadSource: LEAD_SOURCE,

email: opts.email,

firstName: opts.given_name,

lastName: opts.family_name,

company: opts.company```

where LEAD_SOURCE is 'Safely'

Thanks,

Dianna

Tags (2)
6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator

Re: Which fields do I use in teh API to track country, state and inviter_email?

Please move the thread to Products​ (Move link at the right). This isn't a support space.

After moving, please highlight your code using the Advanced Editor's syntax highlighter. Your code doesn't have any context, however. I have no idea what language it's supposed to be in, nor why you wouldn't know the API names of those 3 fields already (all the API names are available from the Describe Leads API endpoint).

https://s3.amazonaws.com/blog-images-teknkl-com/syntax_highlighter.gif

Dianna_Sadler
Level 2

Re: Which fields do I use in teh API to track country, state and inviter_email?

Sanford Whiteman​ please bare with me as I'm working with a developer who does not have access to Marketo, so I'm being a messenger and don't know what context I need to provide. Your kindness and understanding is greatly appreciated.

Please find below the code.

The API used in node.js (javascript) and it looks like this.

request({

method: 'POST',

url: `${this.restUrl}/v1/leads/push.json`,

qs: { access_token: qr.access_token },

json: {

programName: PROGRAM_NAME,

lookupField: 'email',

input: [{

leadSource: LEAD_SOURCE,

email: opts.email,

firstName: opts.given_name,

lastName: opts.family_name,

company: opts.company

}]

}

});

SanfordWhiteman
Level 10 - Community Moderator

Re: Which fields do I use in teh API to track country, state and inviter_email?

Can you please highlight that code, as in the brief video above, so it's readable?

I'm working with a developer who does not have access to Marketo, so I'm being a messenger and don't know what context I need to provide.

Pretty sure the developer has access to the Describe Lead REST API endpoint, which is where all the REST names like firstName and lastName come from.

You can also go to Field Management, export the field names to XLS, then send them the downloaded sheet. But it would make more sense for them to get the fields directly from the API itself to avoid mistakes.

Also, as I'm sure you're aware, a developer who doesn't have access to Marketo is going to make mistakes...

Dianna_Sadler
Level 2

Re: Which fields do I use in teh API to track country, state and inviter_email?

I can't seem to figure out how to highlight per your video. Here's a screenshot of my window. how do i get to the Advanced Editor's syntax highlighter.

Screen Shot 2019-03-06 at 9.05.24 AM.png

Dianna_Sadler
Level 2

Re: Which fields do I use in teh API to track country, state and inviter_email?

i should also clarify, he does have access to Marketo, just not the support portal.

SanfordWhiteman
Level 10 - Community Moderator

Re: Which fields do I use in teh API to track country, state and inviter_email?

Then just have him go to Field Management and export.