Routes

All Stellify routes are defined as JSON objects and stored in a database table.

Route Object

A route object is simply a JSON object with properties defining the route's behavior and characteristics.

Properties

  • Name
    name
    Type
    string
    Description

    The name given to the route.

  • Name
    uuid
    Type
    string
    Description

    Unique identifier for the route.

  • Name
    data
    Type
    array
    Description

    Root level routes that are attached to the route.

  • Name
    type
    Type
    string
    Description

    The type of route i.e. Web, API.

  • Name
    path
    Type
    string
    Description

    The path the route can be accessed at.

  • Name
    parent
    Type
    string
    Description

    A reference to the uuid of a parent route.

  • Name
    method
    Type
    string
    Description

    The HTTP verb associated with the request.

  • Name
    public
    Type
    boolean
    Description

    Whether the route is publicly accessible or not.

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp of when the route was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    Timestamp of when the route was last updated.


GET/v1/route/:id

Retrieve Route

This endpoint allows you to retrieve a route for a given uuid.

Request

GET
/v1/route/480c8f3b-5da1-49e0-8ab0-b88cbef2b306
curl -G https://api.stellify.com/v1/route/480c8f3b-5da1-49e0-8ab0-b88cbef2b306 \
  -H "Authorization: Bearer {token}" \
  -d route_id=480c8f3b-5da1-49e0-8ab0-b88cbef2b306 \


import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.route.get('480c8f3b-5da1-49e0-8ab0-b88cbef2b306')
from stellify_api import ApiClient

client = ApiClient(token)

client.route.get('480c8f3b-5da1-49e0-8ab0-b88cbef2b306')
$client = new \Stellify\ApiClient($token);

$client->route->get('480c8f3b-5da1-49e0-8ab0-b88cbef2b306');

Response

{
    "uuid": "480c8f3b-5da1-49e0-8ab0-b88cbef2b306",
    "type": "web",
    "path": "480c8f3b-5da1-49e0-8ab0-b88cbef2b306",
    "public": true,
    "name": "Example Route"
}

POST/v1/route

Create Route

This endpoint allows you to create a new route.

Request

POST
/v1/route
curl https://api.stellify.com/v1/route \
  -H "Authorization: Bearer {token}" \
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.route.create()
from stellify_api import ApiClient

client = ApiClient(token)

client.route.create()
$client = new \Stellify\ApiClient($token);

$client->route->create();

Response

{
    "uuid": "480c8f3b-5da1-49e0-8ab0-b88cbef2b306",
    "type": "web",
    "path": "480c8f3b-5da1-49e0-8ab0-b88cbef2b306"
}

PUT/v1/route/:id

Update Route

This endpoint allows you to perform an update on an route.

Required attributes

  • Name
    Request JSON Body
    Type
    object
    Description

    The route object properties properties as set out above.

Request

PUT
/v1/route/480c8f3b-5da1-49e0-8ab0-b88cbef2b306
curl -X PUT https://api.stellify.com/v1/route/480c8f3b-5da1-49e0-8ab0-b88cbef2b306 \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d "{\"uuid\": \"480c8f3b-5da1-49e0-8ab0-b88cbef2b306\",\"type\": \"web\",\"path\": \"480c8f3b-5da1-49e0-8ab0-b88cbef2b306\",\"public\": false,\"name\": \"Example Route\"}"
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.route.update('480c8f3b-5da1-49e0-8ab0-b88cbef2b306', {
    "uuid": "480c8f3b-5da1-49e0-8ab0-b88cbef2b306",
    "type": "web",
    "public": false,
    "name": Example Route,
    "path": "480c8f3b-5da1-49e0-8ab0-b88cbef2b306"
});
from stellify_api import ApiClient

client = ApiClient(token)

client.route.update("480c8f3b-5da1-49e0-8ab0-b88cbef2b306",
"{\"uuid\": \"480c8f3b-5da1-49e0-8ab0-b88cbef2b306\",\"type\": \"web\",\"path\": \"480c8f3b-5da1-49e0-8ab0-b88cbef2b306\",\"public\": false,\"name\": \"Example Route\"}")
$client = new \Stellify\ApiClient($token);

$client->route->update('480c8f3b-5da1-49e0-8ab0-b88cbef2b306, [
      "uuid" => "480c8f3b-5da1-49e0-8ab0-b88cbef2b306",
      "type" => "web",
      "name" => "Example Route",
      "public" => false,
      "path" => "480c8f3b-5da1-49e0-8ab0-b88cbef2b306"
]);

Response

{
    "uuid": "480c8f3b-5da1-49e0-8ab0-b88cbef2b306",
    "type": "web",
    "path": "480c8f3b-5da1-49e0-8ab0-b88cbef2b306",
    "public": false,
    "name": "Example Route"
}

DELETE/v1/route/:id

Delete Route

This endpoint allows you to delete a route (and any attached descendants i.e. elements).

Request

DELETE
/v1/route/480c8f3b-5da1-49e0-8ab0-b88cbef2b306
curl -X DELETE https://api.stellify.com/v1/route/480c8f3b-5da1-49e0-8ab0-b88cbef2b306 \
  -H "Authorization: Bearer {token}"
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.messages.delete('480c8f3b-5da1-49e0-8ab0-b88cbef2b306')
from stellify_api import ApiClient

client = ApiClient(token)

client.route.delete("480c8f3b-5da1-49e0-8ab0-b88cbef2b306")
$client = new \Stellify\ApiClient($token);

$client->route->delete('480c8f3b-5da1-49e0-8ab0-b88cbef2b306');

Please be aware that our API documentation is under construction.