x-control-panel/api.spec.json

99 lines
2.7 KiB
JSON

{
"Auth" : {
"name" : "Auth",
"methods" : [ {
"name" : "generateToken",
"description" : "Generates a new API token and returns its details",
"return" : "Object",
"accessLevel" : "User",
"params" : [ {
"name" : "permanent",
"type" : "boolean",
"description" : "If true, creates a token that never expires",
"optional" : true
}, {
"name" : "name",
"type" : "string",
"description" : "Display name for the token. If not provided, the User-Agent header will be used",
"optional" : true
} ]
}, {
"name" : "authenticateByPassword",
"description" : "Authenticates a user using login and password. Returns true if authentication is successful.",
"return" : "boolean",
"accessLevel" : "Guest",
"params" : [ {
"name" : "login",
"type" : "string",
"description" : "User's login name",
"optional" : false
}, {
"name" : "password",
"type" : "string",
"description" : "User's password",
"optional" : false
} ]
}, {
"name" : "logout",
"description" : "Logs out the current user. Returns true if logout is successful, false if the user is not logged in",
"return" : "boolean",
"accessLevel" : "User",
"params" : [ ]
}, {
"name" : "getTokens",
"description" : "Retrieves all API tokens associated with the current user",
"return" : "Array",
"accessLevel" : "User",
"params" : [ ]
}, {
"name" : "authenticateByToken",
"description" : "Authenticates a user using an API token. Returns true if authentication is successful.",
"return" : "boolean",
"accessLevel" : "Guest",
"params" : [ {
"name" : "token",
"type" : "string",
"description" : "API token string for authentication",
"optional" : false
} ]
} ]
},
"Profile" : {
"name" : "Profile",
"methods" : [ {
"name" : "get",
"description" : "",
"return" : "void",
"accessLevel" : "User",
"params" : [ ]
}, {
"name" : "save",
"description" : "",
"return" : "void",
"accessLevel" : "User",
"params" : [ ]
} ]
},
"UserManagement" : {
"name" : "UserManagement",
"methods" : [ {
"name" : "save",
"description" : "",
"return" : "void",
"accessLevel" : "Admin",
"params" : [ ]
}, {
"name" : "getAll",
"description" : "",
"return" : "void",
"accessLevel" : "Admin",
"params" : [ ]
}, {
"name" : "getById",
"description" : "",
"return" : "void",
"accessLevel" : "Admin",
"params" : [ ]
} ]
}
}