Utilities

Stellify provides a suite of endpoints that allow you to execute routines aimed at maintaining and managing your application.


GET/v1/code/:file_uuid

Export Code

This endpoint allows you to retrieve code as raw output.

Request

GET
/v1/code
curl -G https://api.stellify.com/v1/code/ba5cc02b-19ac-41e5-8f57-a129fc303a19 \
  -H "Authorization: Bearer {token}" 


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

const client = new ApiClient(token)

await client.config.get('ba5cc02b-19ac-41e5-8f57-a129fc303a19')
from stellify_api import ApiClient

client = ApiClient(token)

client.config.get('ba5cc02b-19ac-41e5-8f57-a129fc303a19')
$client = new \Stellify\ApiClient($token);

$client->config->get('ba5cc02b-19ac-41e5-8f57-a129fc303a19');

Response


<?php
    class MyController {
      ...
    }

POST/v1/code/run

Execute Code

This endpoint allows you execute PHP code.

Request

POST
/v1/code/run
curl https://api.stellify.com/v1/code/run \
  -H "Authorization: Bearer {token}" \
  -d file_uuid="ba5cc02b-19ac-41e5-8f57-a129fc303a19" \
  -d method_uuid="3eebb320-1820-4af5-948b-f4ed48e8d257" 
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.code.run()
from stellify_api import ApiClient

client = ApiClient(token)

client.code.run()
$client = new \Stellify\ApiClient($token);

$client->code->run();

Response

{
    "status": "200",
    "message": "Code executed",
    "output": null,
    "errors": null
}

PUT/v1/code/:file_id/:method_id

Import code

This endpoint allows you to import code, add it to a method and persist it.

Required attributes

  • Name
    file_uuid
    Type
    string
    Description

    The file that contains the method you wish to attach the imported code to.

  • Name
    method_uuid
    Type
    string
    Description

    The the method you wish to attach the imported code to.

Request

PUT
/v1/code/13f56e50-77d8-4c5b-8ca8-abed7bed60a1/def8ceed-05e1-48fd-9016-28c06d12e9e6
curl -X PUT https://api.stellify.com/v1/file/13f56e50-77d8-4c5b-8ca8-abed7bed60a1 \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d "{\"uuid\":\"2629023a-50e5-4f8e-901b-655e9d07ab44\",\"name\":\"My new file name\,\"type\":\"php\"}"
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.file.update('13f56e50-77d8-4c5b-8ca8-abed7bed60a1', {
    "name": "My New File",
});
from stellify_api import ApiClient

client = ApiClient(token)

client.file.update("13f56e50-77d8-4c5b-8ca8-abed7bed60a1", name="My New File")
$client = new \Stellify\ApiClient($token);

$client->file->update('13f56e50-77d8-4c5b-8ca8-abed7bed60a1, [
      "name" => "My New File",
]);

Response

{
    "uuid": "2629023a-50e5-4f8e-901b-655e9d07ab44",
    "type": "php",
    "name": "My New File"
}

POST/v1/element/htmlToElement

HTML to Elements

This endpoint allows you transform HTML to element objects that are then attached to a route/ page or a designated parent element.

Required attributes

  • Name
    elements
    Type
    string
    Description

    The HTML markup you wish to convert.

Elected attributes

  • Name
    page_uuid
    Type
    string
    Description

    The route/ page uuid that you wish to attach the root element(s) to.

  • Name
    element_uuid
    Type
    string
    Description

    The element uuid that you wish to attach the root element(s) to.

  • Name
    test
    Type
    boolean
    Description

    Lets you indicate whether you simply wish to see the output without persisting the elements in the database.

Request

POST
/v1/element/htmlToElement
curl https://api.stellify.com/v1/element/htmlToElement \
  -H "Authorization: Bearer {token}" \
  -d elements="<p>My first paragraph.<\p>" \
  -d page_uuid="ba5cc02b-19ac-41e5-8f57-a129fc303a19" 
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.element.htmlToElement("ba5cc02b-19ac-41e5-8f57-a129fc303a19")
from stellify_api import ApiClient

client = ApiClient(token)

client.element.htmlToElement("ba5cc02b-19ac-41e5-8f57-a129fc303a19")
$client = new \Stellify\ApiClient($token);

$client->element->htmlToElement(["page" => "ba5cc02b-19ac-41e5-8f57-a129fc303a19", "elements" => "<p>My first paragraph.<\p>"]);

Response

{
   'status' => 200,
   'message' => 'Elements generated.',
   "data": {
      "bd5261e7-adc0-4e47-a483-84c696f33e2b": {
         "tag": "p",
         "type": "s-wrapper",
         "uuid": "bd5261e7-adc0-4e47-a483-84c696f33e2b",
         "text": "My first paragraph.",
         "routeParent": "ba5cc02b-19ac-41e5-8f57-a129fc303a19"
      }
   }
}

POST/v1/element/elementToHtml

Elements to HTML

This endpoint allows you transform element objects to HTML.

Required attributes

  • Name
    elements
    Type
    string
    Description

    The "root" element ids you wish to convert into HTML.

Request

POST
/v1/elementToHtml
curl https://api.stellify.com/v1/element/htmlToElement \
  -H "Authorization: Bearer {token}" \
  -d "{\"elements\":[\"bd5261e7-adc0-4e47-a483-84c696f33e2b\"]}" 
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.element.htmlToElement("{\"elements\":[\"bd5261e7-adc0-4e47-a483-84c696f33e2b\"]})
from stellify_api import ApiClient

client = ApiClient(token)

client.element.htmlToElement("{\"elements\":[\"bd5261e7-adc0-4e47-a483-84c696f33e2b\"]}")
$client = new \Stellify\ApiClient($token);

$client->element->htmlToElement("{\"elements\":[\"bd5261e7-adc0-4e47-a483-84c696f33e2b\"]}");

Response


<p>My first paragraph.<\p>
                  

POST/v1/page/clear

Clear Page Elements

This endpoint allows you clear the elements attached to a route/ page.

Required attributes

  • Name
    page_uuid
    Type
    string
    Description

    The route/ page uuid that you wish to delete the elements for.

Request

POST
/v1/page/clear
curl https://api.stellify.com/v1/page/clear \
  -H "Authorization: Bearer {token}" \
  -d page_uuid="ba5cc02b-19ac-41e5-8f57-a129fc303a19" 
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.page.clear("ba5cc02b-19ac-41e5-8f57-a129fc303a19")
from stellify_api import ApiClient

client = ApiClient(token)

client.page.clear("ba5cc02b-19ac-41e5-8f57-a129fc303a19")
$client = new \Stellify\ApiClient($token);

$client->page->clear("ba5cc02b-19ac-41e5-8f57-a129fc303a19");

Response

{
   'status' => 200,
   'message' => 'Page elements cleared.',
   'data' => [
      'deleted_count' => 1
   ]
}

POST/v1/definition/hierarchy

Create Page Hierarchy

This endpoint will create (and store) a page hierarchy as a definition based upon the routes/pages you have defined. You can then access this definition on the server or client to construct a navigation tree.

Required attributes

  • Name
    uuid
    Type
    string
    Description

    The page you wish to start constructing the hierarchy from.

  • Name
    name
    Type
    string
    Description

    The name you wish to store the hierarchy definintion as.

Optional attributes

  • Name
    test
    Type
    boolean
    Description

    Lets you indicate whether you simply wish to see the output without persisting the definition in the database.

Request

POST
/v1/definition/hierarchy
curl https://api.stellify.com/v1/definition/hierarchy \
  -H "Authorization: Bearer {token}" \
  -d name="Main nav" \
  -d uuid="12af29de-2858-4742-b2ee-f7a543c672ff" 
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.definition.hierarchy({"page" => "12af29de-2858-4742-b2ee-f7a543c672ff", "name" => "Main nav"})
from stellify_api import ApiClient

client = ApiClient(token)

client.definition.hierarchy({"page" => "12af29de-2858-4742-b2ee-f7a543c672ff", "name" => "Main nav"})
$client = new \Stellify\ApiClient($token);

$client->definition->hierarchy(["page" => "12af29de-2858-4742-b2ee-f7a543c672ff", "name" => "Main nav"]);

Response

{
   'status' => 200,
   'message' => 'Page hierarchy created.',
   "data": {
        "12af29de-2858-4742-b2ee-f7a543c672ff": [
            "258f8cee-9298-47ef-9046-078b850fa0d5",
            "70683437-4180-4979-a191-df3f7f892b4e"
        ],
        "258f8cee-9298-47ef-9046-078b850fa0d5": [
            "93b75dfe-e0ea-4e20-9d83-c1708ed709cc"
        ],
        "93b75dfe-e0ea-4e20-9d83-c1708ed709cc": null,
        "70683437-4180-4979-a191-df3f7f892b4e": null
    }
}

Please be aware that our API documentation is under construction.