Amplitude Connector > Amplitude operations > Amplitude source operations
  

Amplitude source operations

Create a Source transformation in the Mapping Task wizard to read data from Amplitude.
To configure the Source operation, perform the following steps:
  1. 1In the Source transformation, select a Amplitude connection.
  2. 2On the Source tab, select an operation from the list of operations.
  3. 3Configure the request message for the operation. Copy the request message from the sample template, and edit the JSON based on your use case.

Configuring a request using Request Message Editor

When you create a Source transformation, configure a JSON request message for the operation that you want to perform in Amplitude.
Use the Request Message Editor to create a request message. The request message uses the JSON format and contains request parameters exposed by the Amplitude API for a specific operation. You can use the default request message for the operation, and then customize it to specify the data that you want to include.
To customize your request, copy the request message from the sample template to the Request Message Editor pane where you can edit the JSON message and add the attributes for the request. Remove unnecessary tags from the request message to avoid operation failure. However, if the object requires no parameters, specify an empty JSON object, {}, to pass mapping validation. You can hide the optional elements to see the required elements for the request message.
For example, to get a summary of a user's newest or oldest events, specify the user ID, limit, and direction for the getUserActivity operation. The following sample request message shows these parameters:
{
"user" : "1625373250235",
"limit" : 10,
"direction" : "latest"
}
The following image shows the request message template and a request message configured to get a user summary along with the newest or oldest events in the Mapping Designer:
In the Request Message Editor, the request message template at the top lists the empty parameters for the operation. Below the template, the Request Message section shows a request message with an example configuration.
The request message format in Amplitude Connector follows the service request definition in Amplitude. Use well-formed JSON in the request message, and include the parameters that you need for your use case.

Field mapping in a Source transformation

The response message format follows the service response definition in Amplitude. You can map response fields from a hierarchical to a relational structure of output groups and fields.
After you configure an operation for a source and specify the request message, create the relational format from the hierarchical data to include groups and fields that you want in the output.
Select the elements in the response structure that you want to include as output fields. The Secure Agent converts the JSON response in the hierarchical structure to relational groups at run time.
The following image shows an example hierarchical response structure generated for the getUserActivity operation, and the corresponding relational output fields for the response:
In the field mapping for the getUserActivity operation, the hierarchical response elements on the left map to the relational output fields on the right.
You can edit the data type, precision, and scale for the groups and fields after mapping the fields.
For more information about field mapping, see Transformations.