Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

GET reports/meta

Resource Information

Requires Authentication?

Yes

Response Formats

json

HTTP Methods

GET

Returns a slit of meta data information used for Daily Report configuration.

Resource URL

http://{host}/api/2.0/reports/meta/.format

Example Request

GET 

  1. http://44.235.52.211/api/2.0/reports/meta/.json

{
    "ReportTypes": {
        "2": "Configuration Report"
    },
    "AgentTypes": {
        "5": "Email",
        "15": "FTP"
    }
}

 


 

GET reports

Resource Information

Requires Authentication?

Yes

Response Formats

json

HTTP Methods

GET

Returns a list of all Reports configuration data.

Resource URL

http://{host}/api/2.0/reports/.format

Example Request

GET 

  1. http://44.235.52.211/api/2.0/reports/.json

[
    {
        "Report": {
            "id": 1,
            "type_id": 2,
            "device_id": 9011,
            "agent_type_id": 15,
            "agent_id": 1,
            "time": "00:00",
            "modified": "1619412644269",
            "created": "1619412644269"
        }
    },
    {
        "Report": {
            "id": 2,
            "type_id": 2,
            "device_id": 9011,
            "agent_type_id": 15,
            "agent_id": 2,
            "time": "00:00",
            "modified": "1619412667474",
            "created": "1619412667474"
        }
    }
]

 


 

GET reports/{id}

Resource Information

Requires Authentication?

Yes

Response Formats

json

HTTP Methods

GET

Returns a single specific Report configuration data.

Resource URL

http://{host}/api/2.0/reports/{id}/.format

Parameters

Parameter

Data Type

Description

id
(required)

integer

The ID of the desired Daily Report to be viewed.

Example Request

GET 

  1. http://44.235.52.211/api/2.0/reports/1/.json

{
    "Report": {
        "id": 1,
        "type_id": 2,
        "device_id": 9011,
        "agent_type_id": 5,
        "agent_id": 1,
        "time": "00:00",
        "modified": "1617036009750",
        "created": "1617036009750"
    }
}

 


 

POST reports

Resource Information

Requires Authentication?

Yes

Response Formats

json

HTTP Methods

POST

Adds a new Daily Report.

Resource URL

http://{host}/api/2.0/reports/.format

Example Request

POST 

  1. http://44.235.52.211/api/2.0/reports/.json

Body

{
    "Report": {
        "type_id": 2,
        "device_id": 9011,
        "agent_type_id": 5,
        "agent_id": 1,
        "time": "23:00"
        }
}

Response

{
    "Report": {
        "id": 4,
        "type_id": 2,
        "device_id": 9011,
        "agent_type_id": 5,
        "agent_id": 1,
        "time": "23:00",
        "modified": "1619413335948",
        "created": "1619413335948"
    }
}

 


 

PUT reports/{id}

Resource Information

Requires Authentication?

Yes

Response Formats

json

HTTP Methods

PUT

Updates a single specific Report.

Resource URL

http://{host}/api/2.0/reports/{id}/.format

Parameters

Parameter

Data Type

Description

id
(required)

integer

The ID of the desired Daily Report to be updated.

Example Request

PUT 

  1. http://44.235.52.211/api/2.0/reports/1/.json

Body

{
"Report": {
   "type_id": 2,
   "device_id": 9011,
   "agent_type_id": 15,
   "agent_id": 1,
   "time": "05:00"
}
}

Response

{
    "Report": {
        "id": 1,
        "type_id": 2,
        "device_id": 9011,
        "agent_type_id": 15,
        "agent_id": 1,
        "time": "05:00",
        "modified": "1619414952489",
        "created": "1619414466172"
    }
}

 


 

DELETE reports/{id}

Resource Information

Requires Authentication?

Yes

Response Formats

json

HTTP Methods

DELETE

Deletes a single specific Report configuration.

Resource URL

http://{host}/api/2.0/reports/{id}/.format

Parameters

Parameter

Data Type

Description

id
(required)

integer

The ID of the desired Daily Report to be deleted.

Example Request

DELETE 

  1. http://44.235.52.211/api/2.0/reports/2/.json

{
    "success": true
}

 


 

GET reports/command/sendReport/{report_id}/{device_id}

Resource Information

Requires Authentication?

Yes

Response Formats

json

HTTP Methods

GET

Sends the specified report immediately, disregarded the configured Time.

Resource URL

http://{host}/api/2.0/reports/command/sendReport/{report_id}/{device_id}/.format

Parameters

Parameter

Data Type

Description

report_id
(required)

integer

The ID of the desired report configuration to be used to send the report.

device_id
(optional)

integer

The ID of the desired device the report will be sent from. If left blank, the report will be sent from local device.

Example Request

GET 

  1. http://44.235.52.211/api/2.0/reports/command/sendReport/1/9011/.json

{
    "Task": {
        "id": 876136,
        "device_id": 9011,
        "type": "Send Report",
        "type_id": 14,
        "mode": "Starting",
        "mode_id": 1,
        "status": null,
        "description": null,
        "total": 0,
        "completed": 0,
        "time_remained": 0,
        "modified": "1617955525989"
    }
}

  • No labels