Overview and Request Content
    • PDF

    Overview and Request Content

    • PDF

    Article summary

    Overview

    This API is used to trigger a new EasySend transaction. When triggered, a Start email/SMS would be sent to the specified customer according to configuration and the API endpoint that is being used.

    In addition, the API returns a link to the digital process transaction. The created link will contain a unique request ID that ensures all prefilled data is embedded in the link and can only be submitted once before expiry.

    URL Path 

    • player/api/generate-link - generate a digital process link
    • player/api/send-link - generate a digital process link with customer notification

    Method

     A POST request should be performed with the following HTTP Header: Content-Type: application/json.

    Authentication Using apiKey Field

    The apiKey allows EasySend to use a simple authentication mechanism that is used to authenticate the client against the server. The apiKey must be passed with every API call.

    Warning!
    Your apiKey is private and should always be kept secret. Never share your API key with a 3rd party. Always trigger EasySend APIs from a server-side application. Avoid embedding your API key in a client-side / web-based application.

    Request Content

    Table 1 describes the required request content parameters.

    Table 1: Request Content

    ParameterTypeOptional/Required Discerption
    apiKeystringRequiredThe API key for the provided environment 
    customerIdstringRequiredAs given by EasySend
    processIdstringRequiredThe unique id of the process
    sourcestringOptionalSet the source field for the digital process metadata
    serializedModel objectOptionalAll the model fields are according to the journey sender’s model
    rolestringOptionalThe role to be used for the first step of the digital workflow
    brandstringOptionalBrand name as configured in the urls for the environment, will be used to create a url with the configured domain for that brand
    EnableRtSyncbooleanOptionalDetermines if the link that was sent will be active with Co-browsing:
    • True - Co-browsing is on
    • False - Co-browsing is off

    If the parameter is not specified, the Co-browsing behavior will be determined according to the server's configuration

    runAsyncbooleanOptionalSet to true for link generation to run asynchronously

    Sample Calls

    {
        "apiKey": "[your-API-key]",
        "customerId": "y-company",
        "processId": "Ffb2g752chqBfNYk70Fp",
        "serializedModel": {
            "personalDetails": {
                "firstName": "John",
                "lastName": "Smith"
            }
        }
    }

    When calling this API asynchronously, for long processes or processes that may include heavy computation tasks, the runAsync=true parameter must be added:

    {
        "apiKey": "[your-API-key]",
        "customerId": "y-company",
        "processId": "Ffb2g752chqBfNYk70Fp",
        "serializedModel": {
            "personalDetails": {
                "firstName": "John",
                "lastName": "Smith"
            }
        },
        "enableRtSync": false,
        "runAsync": true
    }

    Return Values

    The HTTP status code will determine the success/failure of the response. The return code 200 is a success, and any other return code is considered an error. A successful request will contain a JSON request body as follows:

    {
    	“link”: <generated link to EasySend form>,
    	“rid”: <generated unique request ID>,
        “masterRid”: <generated unique request ID>
    }

    when sending an asynchronous request, the response will look like this:

    {
        "taskId": "7309d641-8f2e-43bd-91f3-b3290447e6f7",
        "taskState": "STARTED"
    }

    To poll the task status, use /api/poll/<task-id> api. The poll response will include the task state, and if succeeds, the generate link response (on taskData field):

    {
         "taskId": <task id>,
         "taskState": "SUCCESS",
         "taskData": "{
         “link”: <generated link to EasySend form>,
         “rid”: <generated unique request ID>,
         “masterRid”: <generated unique request ID>
         }"
    }



    Was this article helpful?