Files
Files are parents to methods and child nodes of directories.
File Object
A file object includes properties that describe the file including dependencies and enclosed methods. In relation to PHP, file objects also define "class" properties such as the class' namespace and instance variables.
Properties
-
- Name
name
- Type
- string
- Description
-
Name of the file.
-
- Name
uuid
- Type
- string
- Description
-
Unique identifier for the file.
-
- Name
namespace
- Type
- string
- Description
-
The file's namespace.
-
- Name
data
- Type
- array
- Description
-
References to method uuids.
-
- Name
type
- Type
- string
- Description
-
The type of file acts as the file extension would, it describes to the file's content.
-
- Name
created_at
- Type
- timestamp
- Description
-
Timestamp of when the file was created.
-
- Name
updated_at
- Type
- timestamp
- Description
-
Timestamp of when the file was last updated.
Retrieve File
This endpoint allows you to retrieve a file for a given uuid.
Request
curl -G https://api.stellify.com/v1/file/2629023a-50e5-4f8e-901b-655e9d07ab44 \
-H "Authorization: Bearer {token}"
import ApiClient from '@stellisoft/js-api-client'
const client = new ApiClient(token)
await client.file.get('2629023a-50e5-4f8e-901b-655e9d07ab44')
from stellify_api import ApiClient
client = ApiClient(token)
client.file.get('2629023a-50e5-4f8e-901b-655e9d07ab44')
$client = new \Stellify\ApiClient($token);
$client->file->get('2629023a-50e5-4f8e-901b-655e9d07ab44');
Response
{
"uuid": "2629023a-50e5-4f8e-901b-655e9d07ab44",
"type": "php",
"name": "Example file"
}
Create File
This endpoint allows you to create a new file and attach it to either a page or another file.
Required attributes
-
- Name
directory_id
- Type
- string
- Description
-
The directory in which to create the file.
Request
curl https://api.stellify.com/v1/file \
-H "Authorization: Bearer {token}" \
-d type="s-layout" \
-d page_id="3eebb320-1820-4af5-948b-f4ed48e8d257"
import ApiClient from '@stellisoft/js-api-client'
const client = new ApiClient(token)
await client.file.create({
directory_id: '3eebb320-1820-4af5-948b-f4ed48e8d257',
})
from stellify_api import ApiClient
client = ApiClient(token)
client.file.create(
directory_id="3eebb320-1820-4af5-948b-f4ed48e8d257",
)
$client = new \Stellify\ApiClient($token);
$client->file->create([
'directory_id' => '3eebb320-1820-4af5-948b-f4ed48e8d257',
]);
Response
{
"uuid": "2629023a-50e5-4f8e-901b-655e9d07ab44",
"type": "php",
"name": "Example file"
}
Update File
This endpoint allows you to perform a partial update to a file.
Elective attributes
-
- Name
name
- Type
- string
- Description
The filename.
Request
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 File"
import ApiClient from '@stellisoft/js-api-client'
const client = new ApiClient(token)
await client.method.update('13f56e50-77d8-4c5b-8ca8-abed7bed60a1', {
"name": "My New File",
});
from stellify_api import ApiClient
client = ApiClient(token)
client.method.update("13f56e50-77d8-4c5b-8ca8-abed7bed60a1", name="My New File")
$client = new \Stellify\ApiClient($token);
$client->method->update('13f56e50-77d8-4c5b-8ca8-abed7bed60a1, [
"name" => "My New File",
]);
Response
{
"uuid": "2629023a-50e5-4f8e-901b-655e9d07ab44",
"type": "php",
"name": "My New File"
}
Delete File
This endpoint allows you to delete a file and any attached methods, statements and clauses.
Request
curl -X DELETE https://api.stellify.com/v1/file/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.file.delete("2629023a-50e5-4f8e-901b-655e9d07ab44")
$client = new \Stellify\ApiClient($token);
$client->file->delete('2629023a-50e5-4f8e-901b-655e9d07ab44');