Stories

GET /stories

Path

GET "https://api.botengine.ai/stories"

Example request

curl -X GET \
  https://api.botengine.ai/stories \
  -H 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'

Example response

[
  {
    "name": "Example name",
    "description": "Example description",
    "id": "58ee11d75fb5580005cb8199"
  }
]

Returns list of all stories.

GET /stories/:id

Returns single story for the given id.

Path

GET "https://api.botengine.ai/stories/:id"

Example request

curl -X GET \
  https://api.botengine.ai/stories/58ee11d75fb5580005cb8199 \
  -H 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'

Example response

{
  "name": "Example name",
  "description": "Example description",
  "order": [
    "58ee2d045d033800059a3f7e"
  ],
  "id": "58ee11d75fb5580005cb8199",
  "story": [
    {
      "id": "58ee2d045d033800059a3f7e",
      "childrens": [
        {
          "id": "58ee2d105fb5580005cb81aa",
          "ref": false,
          "childrens": []
        }
      ]
    }
  ],
  "interactions": {
    "58ee2d045d033800059a3f7e": {
      "name": "parent",
      "root": true,
      "references": [],
      "contextOut": [
        "58ee2d105fb5580005cb81aa"
      ],
      "webhook": "",
      "id": "58ee2d045d033800059a3f7e"
    },
    "58ee2d105fb5580005cb81aa": {
      "name": "child",
      "root": false,
      "references": [],
      "contextOut": [],
      "webhook": "",
      "id": "58ee2d105fb5580005cb81aa"
    }
  }
}

POST /stories

Path

POST "https://api.botengine.ai/stories"

Example request

curl -X POST \
  https://api.botengine.ai/stories \
  -H 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
  -H 'content-type: application/json'
  -d '{
    "name": "story name",
    "description": "story description"
}'

Example response

{
  "id": "58ee2e085d033800059a3f7f",
  "timestamp": "2017-04-12T13:39:20.721Z",
  "status": {
    "code": 200,
    "errorType": "success"
  }
}

Creates a new story.

Required parameters

Property Type Description
name String Story name
Max: 1024
description String Story description
Max: 2048

PUT /stories/:id

Path

PUT "https://api.botengine.ai/stories/:id"

Example request

curl -X PUT \
  https://api.botengine.ai/stories/58ee2e085d033800059a3f7f \
  -H 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
  -H 'content-type: application/json' \
  -d '{
    "name": "new story name",
    "description": "new story description"
}'

Example response

{
  "timestamp": "2017-04-12T13:40:40.260Z",
  "status": {
    "code": 200,
    "errorType": "success"
  }
}

Update story with the given id.

Required parameters

Property Type Description
name String Story name
Max: 1024
description String Story description
Max: 2048

DEL /stories/:id

Path

DELETE "https://api.botengine.ai/stories/:id"

Example request

curl -X DELETE \
  https://api.botengine.ai/stories/58ee2e085d033800059a3f7f \
  -H 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'

Example response

{
  "timestamp": "2017-04-12T13:41:47.020Z",
  "status": {
    "code": 200,
    "errorType": "success"
  }
}

Removes a story with the given id.