- PDF
Overview and Request Content
- PDF
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.
Request Content
Table 1 describes the required request content parameters.
Table 1: Request Content
Parameter | Type | Optional/Required | Discerption |
apiKey | string | Required | The API key for the provided environment |
customerId | string | Required | As given by EasySend |
processId | string | Required | The unique id of the process |
source | string | Optional | Set the source field for the digital process metadata |
serializedModel | object | Optional | All the model fields are according to the journey sender’s model |
role | string | Optional | The role to be used for the first step of the digital workflow |
brand | string | Optional | Brand name as configured in the urls for the environment, will be used to create a url with the configured domain for that brand |
EnableRtSync | boolean | Optional | Determines if the link that was sent will be active with Co-browsing:
If the parameter is not specified, the Co-browsing behavior will be determined according to the server's configuration |
runAsync | boolean | Optional | Set 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>
}"
}