Sync Contacts and Configured Metadata

Make highly configurable HTTP requests that will sync Simon contacts & configured metadata to an endpoint of your choosing.

Parameters

  • URL (query strings will be re-encoded)
  • HTTP Method (POST, GET, PUT, PATCH, DELETE)
  • Request Headers
    • Define key-value pairs to use as request headers
    • A header of Content-Type: application/json will be added by default
  • Payload Encoding
    • Determines whether to use JSON or POST with form-style parameters.
    • JSON is most common and is more flexible, allowing batching
    • Form style parameters allow only single-item requests
  • Request Type (Single or Batch)
    • Single - sends each Payload one at a time. If URL contains contact information then the Request type is locked to Single.
    • Batch - sends multiple Payloads at a time
      • Batch size - size of the batch of contacts & configured metadata to send to the webhooks endpoint in one request. Can be anything from 1 to 1000 (optional - defaults to 500)
      • Batch is JSON-only
  • Payload Structure (Array or Object)
    • If Array each batch will be sent in a JSON array.
    • If Object then webhooks will utilize the Payload key to embed the Payload under a JSON object
      • Payload Key - the JSON key under which your batched contact payload will be sent (optional - defaults to batch. Relevant for JSON encoding only and not applicable to form-encoded parameters)
  • Authentication
    • No Auth
    • Basic Auth
      • Basic HTTP Authentication - requires a username & password
    • OAuth2
      • Simon currently offers support for the Client Credentials and Password grant types of OAuth2. If you are using this option, please contact your account manager in order to confirm the details of your OAuth setup. Due to the lack of standardization in the OAuth spec, it is possible that light custom configuration work will be needed.
      • Grant Type: Client Credentials or Password
      • Authentication URL - the URL to fetch the OAuth token from
      • Client ID and Client Secret
      • Username and Password if using the Password grant type
  • Payload
    • If configured as JSON encoded, the key-value pairs will be configured in JSON as the request payload. By default all payload keys are sent as strings. You may specify the type by using the Type dropdown.
    • If configured as form encoded, the key values will be send as named individual form parameters.

Example request payloads

Example configuration 1

  • Payload Encoding: JSON
  • Request type: Batch
  • Batch size: 500
  • Payload type: Object
  • Payload key: simonDataTest
  • Payload of:
    • first_name: simon - String
    • last_name: data - String
    • nested_metadata.age: 4 - Number
    • nested_metadata.size: 50 - Number
{
    "simonDataTest": [
        {
            "first_name": "simon",
            "last_name": "data",
            "nested_metadata": {
                "age": 4,
                "size": 50
            }

        },
        ... repeat for 499 more contacts ...
    ]
}

Example configuration 2

  • Payload Encoding: JSON
  • Request type: Batch
  • Batch size: 500
  • Payload type: Array
  • Payload of:
    • first_name: simon - String
    • last_name: data - String
    • nested_metadata.age: 4 - Number
    • nested_metadata.size: 50 - Number
[
        {
            "first_name": "simon",
            "last_name": "data",
            "nested_metadata": {
                "age": 4,
                "size": 50
            }
        },
        ... repeat for 499 more contacts ...
]

Example configuration 3

  • Payload Encoding: JSON
  • Request type: Single
  • Payload of:
    • first_name: simon - String
    • last_name: data - String
    • nested_metadata.age: 4 - Number
    • nested_metadata.size: 50 - Number
{
    "first_name": "simon",
    "last_name": "data",
    "nested_metadata": {
        "age": 4,
        "size": 50
    }
}

Example configuration 4

  • Payload Encoding: Form-encoded
  • Request type: Single
  • Payload of:
    • From: +11234567890 - String
    • To: +12223334444 - String
    • Body: Thanks for signing up! - String
$ curl -X POST https://example.com \
--data-urlencode "Body=Thanks for signing up!" \
--data-urlencode "From=+11234567890" \
--data-urlencode "To=+12223334444" \
-u AUTH_TOKEN:$AUTH_SECRET

Notes

  • Dot notation may be used to construct nested JSON objects as payloads - for instance, a payload key/value pair of outer_object.inner_object.value : True becomes { outer_object: { inner_object: {value: True } } }. This only applies for JSON-encoded parameters, not form-encoded POST requests.
  • When batching, the payload itself is contacts batched in groups of Batch size specified, each contact consisting of a JSON object of the key-value pairs defined as the payload.
  • If a webhook request fails Simon will retry 429 & 500 level errors three times over thirty seconds before deferring to further manual recovery.
  • Test sends are highly encouraged to ensure that webhook requests are configured properly. If there is an error in the HTTP response that will be displayed to you in the flow builder.
  • When running test sends, Simon will inject the test send recipient onto the sample payload under a key of SD_TEST_SEND.
  • You can use pipedream.com to perform test sends and render the payload before sending it to a production endpoint.

Did this page help you?