Sign in
Most calls require an authToken. In normal conditions one authToken expires after one month.
Files
Or in an url: https://alpha.wvr.io/api/file/download?target=project_id&fileId=file_id (this only works if the authtoken is sent on the header)
Projects
Branches
This call is a little bit weird since it passes a GET call via a POST call
Write
The nodes, attributes and relations in Weaver are created and updated using write operations. These are atomic operations that are sent to a branch in a project.
These are the supported write operations:
(*) optional
Plugins
import requests
response = requests.get(
endpoint + '/plugins' ,
)
|
This will not only list all available plugins but also their possible arguments.
Example:
[
{
"name" : "weaver-importer-exporter" ,
"version" : "6.4.0-rc.0" ,
"apiVersion" : "4.0.0" ,
"description" : "Import to and export from weaver" ,
"functions" : [
{
"route" : "plugin.function.weaver-importer-exporter.export" ,
...
"signature" : {
"summary" : "Export to a file" ,
"description" : "Exports data to a file using a profile" ,
"operationId" : "export" ,
"requestBody" : {
"content" : {
"multipart/form-data" : {
"schema" : {
"required" : [
"project" ,
"user"
],
"properties" : {
"project" : {
"type" : "string" ,
"description" : "The id of the project to import into"
},
"user" : {
"type" : "string" ,
"description" : "The authToken of a user to import as"
},
"profile" : {
"type" : "string" ,
"description" : "The name of the profile. This determines how the excel file is read. Default is 'model-driven'."
},
"branch" : {
"type" : "string" ,
"description" : "The branch uid" ,
"default" : "main"
},
"graph" : {
"type" : "string" ,
"description" : "The graph the export should read from"
},
"config" : {
"type" : "object" ,
"description" : "A stringified json containing any field the profile needs" ,
"default" : "undefined"
},
"zipped" : {
"type" : "boolean" ,
"description" : "If the export should be zipped" ,
"default" : true
}
...
|
The properties listed here can be sent as fields. The two fields project and user get sent in a different way using target and authToken:
|
---|
projectId = weaver.currentProject().id()
authToken = Weaver.getInstance().currentUser().authToken
res = await supertest.agent(WEAVER_ENDPOINT)
.post( '/plugin/function/weaver-importer-exporter/export' )
# System fields
.field( 'target' , projectId)
.field( 'authToken' , authToken)
# Plugin fields
.field( 'profile' , 'turtle' )
res.status.should.equal(200)
report = await waitForPlugin(plugin, JSON.parse(res.text))
expectDone(report)
|