Sample Request and Response
It’s best to take a look at the "shape" of a sample request and response before discussing its structure in detail.
Sample Request
In JSON a sample Kaseya REST API client request looks like this:
GET <yourVSA>/API/v1.0/automation/agentprocs HTTP/1.1
Host: 10.10.32.110
Authorization: Bearer 61373158
Notice the header contains an Authorization
attribute. This was returned in a previous Auth
command.
Sample Response
The JSON response from the Kaseya Server looks like this:
{
"TotalRecords": 3,
"Result": [
{
"AgentProcedureId": 123,
"AgentProcedureName": "Config Windows Automatic Update",
"Path": "shared/smapleProc/windows",
"Description": null,
"Attributes": null
},
{
"AgentProcedureId": 345,
"AgentProcedureName": "Reset Windows Automatic Update",
"Path": "shared/smapleProc/windows/windows updates",
"Description": null,
"Attributes": null
},
{
"AgentProcedureId": 891,
"AgentProcedureName": "Disable Windows Automatic Update",
"Path": "shared/smapleProc/Linux",
"Description": null,
"Attributes": null
}
],
"ResponseCode": 0,
"Status": "OK",
"Error": "None"
}
The Result
field in the response contains one or more records of business data. When multiple records are returned, a Total Records
field is returned. The other top-level fields—ResponseCode
, Status and Error
—are used to confirm the entire request was successfully processed.
Sample Basic Response
When an action is performed, no business data may be returned in the response. In this case the response looks like this:
{
"Result": true,
"ResponseCode": 0,
"Status": "string",
"Error": "string"
}