Go Back
Retrieve Leads from the Marketo REST API
Publisher
: Lingk
Run In Lingk
Description
This recipe retrieves the AuthToken from Marketo and uses it in a subsequent API request. To run this recipe, replace all tenant and API configurations with your configuration and click "Run".
Browse the knowledge base
Twitter
E-Mail
# _____ _ _____ __ # | __ \ (_) |_ _| / _| # | |__) |___ ___ _ _ __ ___ | | _ __ | |_ ___ # | _ // _ \/ __| | '_ \ / _ \ | | | '_ \| _/ _ \ # | | \ \ __/ (__| | |_) | __/ _| |_| | | | || (_) | # |_| \_\___|\___|_| .__/ \___| |_____|_| |_|_| \___/ # | | # |_| # Project Name - RETRIEVE LEADS FROM THE MARKETO REST API # Recipe URL - https://app.lingk.io/a/10932/tf/17820 # Description - # This recipe retrieves the AuthToken from Marketo and uses it in a subsequent API request. # To run this recipe, replace all tenant and API configurations with your configuration and click "Run". # Industry - Higher Ed # Business Process - Graduate Reporting # Systems - Lingk # Connectors - HTTP # Data Flows - Single Direction # Connection Type - API to SOAP # Add Recipe notes / Change log information here! # _____ _ # / ____| | | # | | ___ _ __ _ __ ___ ___| |_ ___ _ __ ___ # | | / _ \| '_ \| '_ \ / _ \/ __| __/ _ \| '__/ __| # | |___| (_) | | | | | | | __/ (__| || (_) | | \__ \ # \_____\___/|_| |_|_| |_|\___|\___|\__\___/|_| |___/ # # CONNECTORS specify what data will be pulled into the in-memory database during processing connectors: # Configure HTTP credentials in your Environment before running this recipe # HTTP Setup - https://help.lingk.io/en/articles/304-http-connector-setup-guide ###### Start - HTTP Reader connectors ###### # Retrieve the Marketo Auth token # Note: You can upload a properties file to the Local File connectors, insert the config data to executionContent to make config values Environment specific. - name: oauthCreds type: httpReader properties: url: https://<YOUR-SUBDOMAIN>.mktorest.com/identity/oauth/token?grant_type=client_credentials&client_id=<YOUR_CLIENT_ID>&client_secret=<YOUR_CLIENT_ID> headersJson: > { "Content-Type": "application/json" } httpMethod: GET # GET leads - name: getLeads type: httpReader delayedRead: true properties: url: https://<YOUR-SUBDOMAIN>.mktorest.com/rest/v1/leads.json?filterType=email&filterValues=myemail@domail.com headersJson: > { "Content-Type": "application/json", "Authorization": "Bearer {{executionContext.oauthCreds.access_token}}" } httpMethod: GET ###### End - HTTP Reader connectors ###### # _____ _ _ _ # / ____| | | | | | # | (___ | |_ __ _| |_ ___ _ __ ___ ___ _ __ | |_ ___ # \___ \| __/ _` | __/ _ \ '_ ` _ \ / _ \ '_ \| __/ __| # ____) | || (_| | || __/ | | | | | __/ | | | |_\__ \ # |_____/ \__\__,_|\__\___|_| |_| |_|\___|_| |_|\__|___/ # STATEMENTS specify how the data should be processed while in memory statements: #******************************************************************** D I S C L A I M E R *********************************************************************************************** # * # Note that in an effort to keep recipes optimized for DPH (Data Processing Hours), print statements should be commented out after development has concluded for a recipe. * # For more information on DPH optimization, please visit the following help article - https://help.lingk.io/en/articles/212-minimizing-data-processing-hours-on-the-lingk-platform * # * #******************************************************************** D I S C L A I M E R *********************************************************************************************** # NOTE: You can also insert configuration parameters from the environment Local File reader before you get OAuth credentials to make the recipe environment specific. # 1. Handle OAuthToken and place into the ExecutionContext #- statement: print oauthCreds - statement: INSERT oauthCreds INTO executionContext # 2. The getLeads connector is configured with "delayedRead" of true to ensure it does not get executed before the credentials are available. # Therefore, we REFRESH to execute the connector. - statement: REFRESH getLeads # With the response data available for the connector, we can now do a SELECT statement against it. - statement: (leadData) => SELECT * FROM getLeads #- statement: print leadData # Add more statements to convert, join, aggregrate, transform, and integrate your data
Aeries Sections and Programs SIS Reader to Salesforce
Transforming and Writing Bulk Data in Batches