The create e-mail action operation will add an e-mail action to a self service product with the specified body content.
Request
Request URI
Method | Request URI |
---|---|
POST | https://{company-name}.helloid.com/api/v1/selfservice/products/{productGUID}/emailaction |
POST | https://{company-name}.helloid.com/api/v1/selfservice/products/{productCode}/emailaction |
Request parameters
Parameter | Description |
---|---|
{company-name} | The company name of the target company |
{productGUID} | The GUID for the self service product |
{productCode} | The code for the self service product |
Request headers
Header | Description |
---|---|
Content-Type | Required. Must be set to application/json. |
Sample request body
{ "executeOnState": 1, "variables": [ { "name": "to", "value": "recipient@company.com", "typeConstraint": "string", "secure": false }, { "name": "from", "value": "sender@company.com", "typeConstraint": "string", "secure": false }, { "name": "subject", "value": "Example subject", "typeConstraint": "string", "secure": false }, { "name": "content", "value": "Example content", "typeConstraint": "string", "secure": false }, { "name": "isHtmlContent", "value": "true", "typeConstraint": "boolean", "secure": false }, { "name": "template", "value": "sendrequestemail", "typeConstraint": "string", "secure": false }, { "name": "useTemplate", "value": "true", "typeConstraint": "boolean", "secure": false } ] }
Request body parameters
Parameter | Description | Required/Optional | Default value |
---|---|---|---|
executeOnState | Indicates in which state the Send Email action will trigger. Possible values: 1. RequestCreated (default) 2. RequestCreateCompleted 3. RequestApproved 4. RequestApproveCompleted 5. RequestDenied 6. RequestDenyCompleted 7. RequestDeleted 8. RequestDeleteCompleted 9. RequestRevoked 10. RequestRevokeCompleted 11. RequestReturned 12. RequestReturnCompleted |
Optional | - |
variables/to | The e-mail address of the recipient. | Required | - |
variables/from | The e-mail address of the sender. | Required | - |
variables/subject | The subject of the e-mail. | Required | - |
variables/content | The body of the e-mail. | Optional | - |
variables/isHtmlContent | A boolean value indicating if the e-mail is a HTML e-mail or a text e-mail. | Optional | true |
variables/template | The name of the e-mail template. Available templates: 1. sendrequestemail: An e-mail template for requests that need to be approved or denied. 2. senddeniedemail: An e-mail template for requests that have been denied. |
Optional | - |
variables/useTemplate | A boolean value indicating if the e-mail action should use the specified template. | Optional | False |
Response
Response status
Code | Description |
---|---|
200(OK) | Indicates that the operation was successful and the resource is created. |
400(BAD REQUEST) | Indicates that the operation was not successful. The content type was incorrect or the request body was malformed. |
401(UNAUTHORIZED) | Indicates that no authentication header was given or the api key and secret were invalid. If the api key and secret were valid check the configuration in your portal, it is possibilty these were IP restricted or are disabled. |
404(NOTFOUND) | Indicates that the the specified no product with the specified GUID or SKU exists.. |
409(CONFLICT) | Indicates that the operation was not successful. If there were validation errors, the response will include an error result. |
Please also see error result.
Please also see common HTTP status codes
Sample response body
{ "actionGUID": "773bbacd-6ee6-473f-ae5a-c33b120b2d82", "name": "Send email", "options": 1, "objectGUID": "87ed7ecc-0ee7-4d9c-a718-341d2f6861fe", "executeOnState": 1, "automationStoreTaskId": "4768fd73-622c-4cc6-bece-5ccba5bac8c2", "automationStoreTaskVersion": "1.0.0", "executionType": "native", "executionEntry": "send-email", "executionEnvironment": "helloid", "executionMinimumVersion": "1.1.0", "variables": [ { "id": "271a827a-e289-4d13-9526-8d23141cb85a", "name": "content", "value": "Example content", "typeConstraint": "string", "secure": false, "isScriptVariable": false }, { "id": "15f65a5e-2335-41f5-9101-d5c51b505dc9", "name": "from", "value": "sender@company.com", "typeConstraint": "string", "secure": false, "isScriptVariable": false }, { "id": "5d10219a-de3b-4eb6-b0c8-210a507c5cb6", "name": "isHtmlContent", "value": "true", "typeConstraint": "boolean", "secure": false, "isScriptVariable": false }, { "id": "0bc64aa1-2a4b-4c5e-8f03-f547ef445e35", "name": "subject", "value": "Example subject", "typeConstraint": "string", "secure": false, "isScriptVariable": false }, { "id": "ea6f1a62-d7ff-4cab-be54-697ce4fed6e6", "name": "template", "value": "sendrequestemail", "typeConstraint": "string", "secure": false, "isScriptVariable": false }, { "id": "eb98448d-035f-4801-9da7-487fd301ecb7", "name": "to", "value": "recipient@company.com", "typeConstraint": "string", "secure": false, "isScriptVariable": false }, { "id": "beecab1f-1ac3-4fcd-b6e3-236391145eec", "name": "useTemplate", "value": "true", "typeConstraint": "boolean", "secure": false, "isScriptVariable": false } ] }
Example request with cURL
Replace placeholder values surrounded by {
}
with the actual values.
curl -u {api-key}:{api-secret} -X POST https://{company-name}.helloid.com/api/v1/selfservice/products/{productGUID}/emailaction -H "Content-Type:application/json" -d
'{
[request body here]
}'