Description

Export a story to a transferable story file.

Request

HTTP Method: GET

Parameter Description
id The ID of the story to export.
curl -X GET \
  https://<tenant-name>.tines.io/api/v1/stories/<story-id>/export \
  -H 'content-type: application/json' \
  -H 'x-user-email: <email-address' \
  -H 'x-user-token: <api-token>'

Response

A successful request will return a JSON object representing the story in exported form.

Sample response


{
    "schema_version": 1,
    "name": "Simple story",
    "description": "In the simple story we will create a fictional situation where a detection system is configured to send alerts to our Tines tenant. The alert will contain the type of alert (infection, ddos, credential stuffing, etc.) and details on any users affected. If the alert is related to an infection, based on the users job title, we will take a specific action.\r\n\r\nThe simple story is described in detail in the <a href=\"https://docs.tines.io/tines_quickstart_simple_story.html\">Tines Docs</a>.\r\n\r\nUse the following URL command (replace $webhook-url with the webhook URL in the ''Summary\" tab of the 'Receive events' agent) to send events to this story:\r\n\r\n<pre>curl $webhook-url -X POST -H \"Content-Type: application/json\" -d '{\"event_name\":\"My first event\",\"type\":\"infection\",\"users\":[{\"name\":\"alice\",\"age\":25,\"country\":\"US\",\"job\":\"Engineer\"},{\"name\":\"bob\",\"age\":20,\"country\":\"UK\",\"job\":\"Student\"},{\"name\":\"carol\",\"age\":61,\"country\":\"Ireland\",\"job\":\"CEO\"}]}'</pre>",
    "guid": "b7c81e0cb416ae8f4c00874ca7b1cdf8",
    "exported_at": "2019-05-31T00:11:15Z",
    "agents": [
        {
            "type": "Agents::HTTPRequestAgent",
            "name": "Send a post request",
            "disabled": false,
            "guid": "05ea2139d96cbe2d164fc2ede218569e",
            "options": {
                "url": "https://postman-echo.com/post",
                "content_type": "json",
                "method": "post",
                "payload": {
                    "name": "{{.explode_users.user.name}}",
                    "age": "{{.explode_users.user.age}}",
                    "country": "{{.explode_users.user.country}}",
                    "job": "{{.explode_users.user.job}}"
                },
                "expected_update_period_in_days": "1"
            },
            "schedule": "never",
            "keep_events_for": 604800
        },
        {
            "type": "Agents::TriggerAgent",
            "name": "User is engineer",
            "disabled": false,
            "guid": "15c0ff2c7a5cf30473ca9122d5125e60",
            "options": {
                "rules": [
                    {
                        "type": "regex",
                        "value": "engineer",
                        "path": "{{.explode_users.user.job}}"
                    }
                ],
                "expected_update_period_in_days": "2"
            },
            "keep_events_for": 604800
        },
        {
            "type": "Agents::TriggerAgent",
            "name": "User is student",
            "disabled": false,
            "guid": "1ebbfe364b9c1bd78a16f82001934f0b",
            "options": {
                "rules": [
                    {
                        "type": "regex",
                        "value": "student",
                        "path": "{{.explode_users.user.job}}"
                    }
                ],
                "expected_update_period_in_days": "2"
            },
            "keep_events_for": 604800
        },
        {
            "type": "Agents::EventTransformationAgent",
            "name": "Explode users",
            "disabled": false,
            "guid": "219a7a3241d06c08fda64fa2a9694fdd",
            "options": {
                "mode": "explode",
                "path": "{{.receive_events.users}}",
                "to": "user",
                "expected_update_period_in_days": "1"
            },
            "keep_events_for": 604800
        },
        {
            "type": "Agents::TriggerAgent",
            "name": "Type is infection",
            "disabled": false,
            "guid": "434992c00929c419dc02cf7160118236",
            "options": {
                "rules": [
                    {
                        "type": "regex",
                        "value": "infection",
                        "path": "{{ .receive_events.type }}"
                    }
                ],
                "expected_update_period_in_days": "2"
            },
            "keep_events_for": 604800
        },
        {
            "type": "Agents::WebhookAgent",
            "name": "Receive events",
            "disabled": false,
            "guid": "81ec7dbe205b260953e05874d189fac2",
            "options": {
                "secret": "201367c22bd83f4e79ac81aa9f9efb7c",
                "verbs": "post",
                "expected_update_period_in_days": 1
            },
            "keep_events_for": 604800
        },
        {
            "type": "Agents::EmailAgent",
            "name": "Notify by email",
            "disabled": false,
            "guid": "8e30d78e9971d457ff142f46e3d6d3d4",
            "options": {
                "recipients": "tinesdemouser@outlook.com",
                "subject": "Engineer in infected",
                "body": "Hello,<br/><br/>An alert has been detected that relates to an infected engineer. The user's details are shown below:<br/><b>Name:</b> {{.explode_users.user.name}}<br/><b>Age:</b> {{.explode_users.user.age}}<br/><b>Country:</b> {{.explode_users.user.country}}<br/><br/>Thanks!",
                "expected_update_period_in_days": "2"
            },
            "keep_events_for": 604800
        },
        {
            "type": "Agents::TriggerAgent",
            "name": "User is ceo",
            "disabled": false,
            "guid": "9a0cc3733c3a25eed99ca819d751daec",
            "options": {
                "rules": [
                    {
                        "type": "regex",
                        "value": "ceo",
                        "path": "{{.explode_users.user.job}}"
                    }
                ],
                "expected_update_period_in_days": "2"
            },
            "keep_events_for": 604800
        }
    ],
    "links": [
        {
            "source": 1,
            "receiver": 6
        },
        {
            "source": 3,
            "receiver": 1
        },
        {
            "source": 3,
            "receiver": 2
        },
        {
            "source": 3,
            "receiver": 7
        },
        {
            "source": 4,
            "receiver": 3
        },
        {
            "source": 5,
            "receiver": 4
        },
        {
            "source": 7,
            "receiver": 0
        }
    ],
    "control_links": []
}