"Send Request" node

Amazon API Gateway allows developers to create, publish, maintain, and secure APIs at any scale. By integrating with a specific endpoint, users can trigger AWS Lambda functions, forward message to Amazon SQS, interact with backend services, or access AWS resources through an HTTP request. The integration between Synerise and Amazon API Gateway allows you to send any requests from Synerise.

This node can be used in customer-oriented and business workflows. A reponse from the endpoint generates the amazonApiGateway.sendRequest event. The name of the event is customizable in the configuration form of this node.

Prerequisites


Node configuration


  1. To create a workflow that sends a request to Amazon API Gateway, go to Automation Hub > Workflows > New workflow.
  2. Start the workflow with a trigger node, (for example, "Scheduled Run" node).
  3. On the trigger node, click THEN.
  4. Click Amazon API Gateway > Send request.
  5. Click Select connection.
  6. From the dropdown list, select the connection.

Create a connection

To allow the data exchange, establish a connection between Synerise and Amazon API Gateway.

  1. At the bottom of the Select connection dropdown list, click Add connection.
  2. In the Connection name field, enter the name of the connection.
    It will only be visible on the list of connections and will help you recognize it on the list.
  3. In the API key field, enter your Amazon API key which lets you receive external requests.
  4. Confirm by clicking Apply.

Define the integration settings

In this step, fill in the form that allows you to send data from Synerise to Amazon API Gateway.

Blank configuration form of the Send request node
Blank configuration form of the Send request node
Note: Fields marked with the Snippet icon icon accept snippets or inserts. This integration allows usage of profile-related inserts.
  1. Select a HTTP method from the dropdown list.

  2. In the Stage invoke URL field, enter the URL of your API Gateway under which your resource is published. This is the base URL used to invoke your deployed API at a specific stage (for example, dev, prod). It’s the entry point for calling your API, the resource path is added in the next field. Example value: https://abc123.execute-api.us-east-1.amazonaws.com/prod

  3. In the Resource path field, enter the path which is added to the stage URL to access a particular resource or endpoint.
    Example values: /users/create; /orders/{orderId}

  4. In the Content Type enter the value of the Content-Type header.

  5. In the Body field, enter the request body.

  6. In the Response event name field, enter the event name in which the response to the requests will be saved. By default, it’s amazonApiGateway.sendRequest. We recommend customizing the event name per each business case. The event will be generated only for the customer-oriented workflows on the profile cards of the customers who participated in the workflow.

  7. In the Additional event parameters section, you can add parameters (key-value) which will be added to the event with the request response. It should be noted that:

    • You can add up to 10 parameters
    • The parameter name cannot exceed 128 characters
    • The parameter name cannot contain special characters
  8. Confirm by clicking Apply.

Test integration


You can run a test request. If the request body contains a dynamic reference to a profile attribute and/or an event data from preceding nodes, then you can define the context using test profile data.

Note: Complete description of the feature is available in Testing outgoing integrations.
  1. In the Test integration section, click Send test request.
    Result: A test request builder opens. If:
    • a request body contains dynamic references, the request preview appears after you select the context of test profiles and events.
    • a request body contains static data, the preview of the body request appears immediately.
    An empty test request builder
    An empty test request builder
  2. If your request contains dynamic references (otherwise, the options aren’t available):
    • From the Test profile dropdown, select a test profile in the context of whom the test request will be performed.
    • From the Event context dropdown list, you can select a particular occurrence of an event whose values/information will be used for the test request.
      1. Select a test profile.
        Result: A history of test profile events appears.
        A stream of events of a test profile
        A stream of events of a test profile
      2. From the list of events, select one whose data you want use as a context. If there is no event you can use, in the upper-right corner of the pop-up, click Define own event and provide the body of the event.
      3. Confirm by clicking Apply.
  3. Verify the request body. If there is someting you want to change, come back to the node settings from previous steps.
  4. If the request body is ready to test, in the upper-right corner, click Send request.
    Result: The response section appears and the Update response event button becomes active.
  5. Optionally, you can update response event with new parameters by clicking Update response event in the upper-right corner.

Example of use


In this example, let’s assume you already have your own email marketing tool, and Synerise serves as your primary data hub. By using real-time customer segmentation and analytics in Synerise and your email tool, you can benefit from both systems through the integration of Synerise and this tool via Amazon API Gateway.

The workflow will start at the defined date for selected group of customers. Information about these customers will be retrieved by the Send request node and exported to Amazon API Gateway. Jinjava will retrieve parameter values for each customer.

The data after sending the request will be available in Amazon SQS for further use in the Amazon email marketing tool.

  1. Start with the Audience node.
  2. In the configuration of the node:
    1. In the Run trigger section define the frequency and/or date and time when this node will be triggered.
    2. In the Define audience section, select an existing segmentation (the Segments tab) or define the conditions a customer must meet to be included in the node (the New audience tab).
    3. Confirm the settings by clicking Apply.
  3. Add the Send request node. In the configuration of the node, fill out the fields according to the instructions in the “Node configuration” section.
    Below, you can find an example request body:
    {
      "firstName": "{% customer firstname %}",
      "email": "{% customer email %}",
      "lastPurchasedItem": "{% aggregate %} UUID {% endaggregate %}"
    }    
        
    The values of these parameters will be replaced with the data of customers who arrive at the Send request node. The value of the lastPurchasedItem parameter is the result of an aggregate which returns the name of the last purchased item by the customer.
  4. Finish the node by adding the End node.
    Result:
    Final workflow configuration
    Final workflow configuration
πŸ˜•

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

πŸ˜‰

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker