Methods

Methods are parents to statements and child nodes of files.

Method Object

A method object includes properties that describe the method including dependencies and enclosed statements.

Properties

  • Name
    name
    Type
    string
    Description

    Name of the method.

  • Name
    uuid
    Type
    string
    Description

    Unique identifier for the method.

  • Name
    data
    Type
    array
    Description

    References to statement uuids.

  • Name
    scope
    Type
    string
    Description

    The scope of the method.

  • Name
    return-type
    Type
    string
    Description

    The return type of the method.

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp of when the method was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    Timestamp of when the method was last updated.


GET/v1/method/:id

Retrieve Method

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

Request

GET
/v1/method
curl -G https://api.stellify.com/v1/method/bb50f9b7-47bb-4740-8db0-33159569f74e \
  -H "Authorization: Bearer {token}" 


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

const client = new ApiClient(token)

await client.method.get('bb50f9b7-47bb-4740-8db0-33159569f74e')
from stellify_api import ApiClient

client = ApiClient(token)

client.method.get('bb50f9b7-47bb-4740-8db0-33159569f74e')
$client = new \Stellify\ApiClient($token);

$client->method->get('bb50f9b7-47bb-4740-8db0-33159569f74e');

Response

{
    "uuid": "bb50f9b7-47bb-4740-8db0-33159569f74e",
    "type": "php",
    "name": "Example method"
}

POST/v1/method

Create Method

This endpoint allows you to create a new method and attach it to either a page or another method.

Required attributes

  • Name
    file_id
    Type
    string
    Description

    The file in which to create the method.

Request

POST
/v1/method
curl https://api.stellify.com/v1/method \
  -H "Authorization: Bearer {token}" \
  -d file_id="3eebb320-1820-4af5-948b-f4ed48e8d257" 
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.method.create({
  file_id: '3eebb320-1820-4af5-948b-f4ed48e8d257',
})
from stellify_api import ApiClient

client = ApiClient(token)

client.method.create(
  file_id="3eebb320-1820-4af5-948b-f4ed48e8d257",
)
$client = new \Stellify\ApiClient($token);

$client->method->create([
  'file_id' => '3eebb320-1820-4af5-948b-f4ed48e8d257',
]);

Response

{
    "uuid": "bb50f9b7-47bb-4740-8db0-33159569f74e",
    "type": "php",
    "name": "Example method"
}

PATCH/v1/method/:id

Update Method

This endpoint allows you to perform a partial update to a method.

Elective attributes

  • Name
    name
    Type
    string
    Description

    The method name.

Request

PUT
/v1/method/13f56e50-77d8-4c5b-8ca8-abed7bed60a1
curl -X PUT https://api.stellify.com/v1/method/13f56e50-77d8-4c5b-8ca8-abed7bed60a1 \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d name="My New Method"
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

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

client = ApiClient(token)

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

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

Response

{
    "uuid": "bb50f9b7-47bb-4740-8db0-33159569f74e",
    "type": "php",
    "name": "My New Method"
}

DELETE/v1/method/:id

Delete Method

This endpoint allows you to delete a method and any attached statements and clauses.

Request

DELETE
/v1/method/bb50f9b7-47bb-4740-8db0-33159569f74e
curl -X DELETE https://api.stellify.com/v1/method/bb50f9b7-47bb-4740-8db0-33159569f74e \
  -H "Authorization: Bearer {token}"
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.messages.delete('bb50f9b7-47bb-4740-8db0-33159569f74e')
from stellify_api import ApiClient

client = ApiClient(token)

client.method.delete("bb50f9b7-47bb-4740-8db0-33159569f74e")
$client = new \Stellify\ApiClient($token);

$client->method->delete('bb50f9b7-47bb-4740-8db0-33159569f74e');

Please be aware that our API documentation is under construction.