Definitions

Definitions allow you to create reusable objects and arrays that are decoupled from your main codebase. This means you can reference, update, or share these structures independently, making your code more modular, maintainable, and flexible.

Definition Object

A definition object is simply the data structure of the object or array you are defining and therefore there are no "set" properties it must contain.


GET/v1/definition/:id

Retrieve Definition

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

Request

GET
/v1/definition
curl -G https://api.stellify.com/v1/definition/2629023a-50e5-4f8e-901b-655e9d07ab44 \
  -H "Authorization: Bearer {token}" 


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

const client = new ApiClient(token)

await client.definition.get('2629023a-50e5-4f8e-901b-655e9d07ab44')
from stellify_api import ApiClient

client = ApiClient(token)

client.definition.get('2629023a-50e5-4f8e-901b-655e9d07ab44')
$client = new \Stellify\ApiClient($token);

$client->definition->get('2629023a-50e5-4f8e-901b-655e9d07ab44');

Response

[
    "apples"
    "oranges"
    "pears"
]

POST/v1/definition

Create Definition

This endpoint allows you to create a new definition.

Required attributes

  • Name
    name
    Type
    string
    Description

    The name you wish to assign to the definition.

    Name
    type
    Type
    string
    Description

    The data structure of the definition, either an object or an array.

Optional attributes

  • Name
    public
    Type
    boolean
    Description

    Is the definition publically accessible, if false the definition cannot be accessed on the client.

Request

POST
/v1/definition
curl https://api.stellify.com/v1/definition \
  -H "Authorization: Bearer {token}" \
  -d name="Example definition" \
  -d type="object" 
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.definition.create({
  name: 'Example definition',
  type: 'object'
})
from stellify_api import ApiClient

client = ApiClient(token)

client.definition.create(
  name="Example definition",
  type="object"
)
$client = new \Stellify\ApiClient($token);

$client->definition->create([
  'name' => 'Example definition',
  'type' => 'object'
]);

Response

{
    "name": "Example definition"
}

PUT/v1/definition/:id

Update Definition

This endpoint allows you to perform an update on a definition.

Required attributes

  • Name
    Request JSON Body
    Type
    object
    Description

    The definition data structure.

Request

PUT
/v1/definition/a5f240aa-73e1-4466-af79-ba2c5a064bd2
curl -X PUT https://api.stellify.com/v1/definition/a5f240aa-73e1-4466-af79-ba2c5a064bd2 \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d "{\"uuid\":\"a5f240aa-73e1-4466-af79-ba2c5a064bd2\",\"type\":\"s-layout\",\"tag\":\"div\",\"classes\":[\"m-4\"],\"routeParent\":\"480c8f3b-5da1-49e0-8ab0-b88cbef2b306\"}"
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.definition.update('a5f240aa-73e1-4466-af79-ba2c5a064bd2', {
    "uuid": "a5f240aa-73e1-4466-af79-ba2c5a064bd2",
    "type": "s-layout",
    "tag": "div",
    "classes": ["m-4"],
    "routeParent": "480c8f3b-5da1-49e0-8ab0-b88cbef2b306"
});
from stellify_api import ApiClient

client = ApiClient(token)

client.definition.update("a5f240aa-73e1-4466-af79-ba2c5a064bd2",
{\"uuid\":\"a5f240aa-73e1-4466-af79-ba2c5a064bd2\",\"type\":\"s-layout\",\"tag\":\"div\",\"classes\":[\"m-4\"],\"routeParent\":\"480c8f3b-5da1-49e0-8ab0-b88cbef2b306\"})
$client = new \Stellify\ApiClient($token);

$client->definition->update('a5f240aa-73e1-4466-af79-ba2c5a064bd2, [
      "uuid" => "a5f240aa-73e1-4466-af79-ba2c5a064bd2",
      "type" => "s-layout",
      "tag" => "div",
      "classes" => ["m-4"],
      "routeParent" => "480c8f3b-5da1-49e0-8ab0-b88cbef2b306"
]);

Response

{
    "uuid": "a5f240aa-73e1-4466-af79-ba2c5a064bd2",
    "type": "s-layout",
    "tag": "div",
    "classes": ["m-4"],
    "routeParent": "480c8f3b-5da1-49e0-8ab0-b88cbef2b306"
}

DELETE/v1/definition/:id

Delete Definition

This endpoint allows you to delete a definition.

Request

DELETE
/v1/definition/2629023a-50e5-4f8e-901b-655e9d07ab44
curl -X DELETE https://api.stellify.com/v1/definition/2629023a-50e5-4f8e-901b-655e9d07ab44 \
  -H "Authorization: Bearer {token}"
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.messages.delete('2629023a-50e5-4f8e-901b-655e9d07ab44')
from stellify_api import ApiClient

client = ApiClient(token)

client.definition.delete("2629023a-50e5-4f8e-901b-655e9d07ab44")
$client = new \Stellify\ApiClient($token);

$client->definition->delete('2629023a-50e5-4f8e-901b-655e9d07ab44');

Please be aware that our API documentation is under construction.