Scenario: Data transmission between the Marketo database and an external system using REST API - 6.3

Talend Open Studio for Big Data Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for Big Data
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

The following scenario describes a four-component Job that inserts several lead records into the Marketo database, then retrieves these records from the Marketo database and displays them on the console.

Setting up the Job

  1. Add two tFixedFlowInput components, a tMarketoOutput component, a tMarketoInput component, and a tLogRow component by typing their names on the design workspace or dropping them from the Palette.

  2. Double-click the tMarketoOutput component to open its Basic settings view and in the API Mode area make sure the REST API mode is selected.

  3. Do the same to make sure the REST API mode is also selected in the API Mode area on the Basic settings view of the tMarketoInput component.

  4. Connect the first tFixedFlowInput component to the tMarketoOutput component using a Row > Main connection. In the pop-up dialog box, click Yes so that the first tFixedFlowInput component can get the schema from the target tMarketoOutput component.

  5. Connect the second tFixedFlowInput component to the tMarketoInput component using a Row > Main connection. In the pop-up dialog box, click No and the second tFixedFlowInput component will not get the schema from the target tMarketoInput component.

  6. Connect the tMarketoInput component to the tLogRow component using a Row > Main connection.

  7. Connect the first tFixedFlowInput component to the second tFixedFlowInput component using a Trigger > On Subjob Ok connection.

Inserting lead records into Marketo

  1. Double-click the first tFixedFlowInput component to open its Basic settings view.

  2. Click the [...] button next to Edit schema to open the schema dialog box.

  3. In the schema dialog box, select the id and Status columns that don't need input values and click the [x] button to remove them.

    Then click OK to save the settings and close the schema dialog box.

  4. In the Mode area, select Use Inline Content(delimited file) and enter the following input data in the Content field.

    dev@talend.com;Peter;Wang
    doc@talend.com;Judy;Zhang
    dev@talend.com;Nick;Liu
    dev@talend.com;Mark;Zhao
    doc@talend.com;Alex;Sun
  5. Double-click the tMarketoOutput component to open its Basic settings view.

  6. In the Endpoint address field, enter the REST API endpoint URL that can be found on the Marketo Admin -> Web Services panel.

    In the Client Access ID and Secret key fields, enter the user ID and encryption key required to access Marketo.

  7. From the Operation list, select SyncMultipleLeads to insert multiple lead records, and from the list displayed, select createDuplicate to allow duplicated leads to be created.

Retrieving lead records from Marketo

  1. Double-click the second tFixedFlowInput component to open its Basic settings view.

  2. Click the [...] button next to Edit schema and in the schema dialog box displayed, define the schema by adding one column mail of String type.

    Then click OK to save the changes and close the schema dialog box.

  3. In the Mode area, select Use Inline Table. Then click the [+] button twice below the table displayed to add two rows and fill each row with respective values. In this example, two email values dev@talend.com and doc@talend.com are added so that the lead records identified by these email values can be retrieved.

  4. Double-click the tMarketoInput component to open its Basic settings view.

  5. In the Endpoint address field, enter the REST API endpoint URL that can be found on the Marketo Admin -> Web Services panel.

    In the Client Access ID and Secret key fields, enter the user ID and encryption key required to access Marketo.

  6. Select getMultipleLeads from the Operation list to retrieve a batch of lead records.

    Then select LeadKeySelector from the Lead Selector list, and select email from the LeadKey type list and mail from the LeadKey values list to retrieve the leads identified by the email values passed from the second tFixedFlowInput component.

  7. Double-click the tLogRow component to open its Basic settings view.

  8. In the Mode area, select Table (print values in cells of a table) for better readability of the result.

Saving and executing the Job

  1. Press Ctrl + S to save the Job.

  2. Press F6 to execute the Job.