Report Schedule

Report Schedule call is used to fetch the report schedules for a logged-in user from the Mojo Server or the Arista Cloud Services. The types of report schedules that can be fetched are onetimereportschedule and recurringreportschedule. Based on the parameters passed, this API call can be used to fetch -all the schedules available to the logged in user at the top-most location that the user has access to, a specified schedule, all the schedules for a specified report, all the schedules for a specified location, and all the schedules for a specified report and location.

API Calls

/V5/reports/schedules

/V5/reports/schedules/location

/V5/reports/schedule/{scheduleid}

/V5/reports/schedules/{reportid}

/V5/reports/schedule/report/{reportid}

/V5/reports/schedule

<Base_URL>/V2/analytics/associationdata/{startdate}/{enddate}

/V5/reports/schedule

/V5/reports/schedule/{scheduleid}

Get Report Schedules

Description This API is used to fetch the report schedules for a logged-in user from the Arista
Server or the Arista Cloud Services. The types of report schedules that can be fetched
are onetimereportschedule and recurringreportschedule. Based on the parameters passed,
this API call can be used to fetch:

  • all the schedules available to the logged in user at the top-most location
    that the user has access to
  • a specified schedule
  • all the schedules for a specified report
  • all the schedules for a specified location
  • all the schedules for a specified report and location
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
GET <Base_URL>/reports/schedules?reportid=<value>&scheduleid=<value>
&locationid=<value>
  • locationid

    It takes an integer value specifying the ID of the location for which the schedules
    defined at that location have to be fetched.

  • reportid

    It takes an integer value specifying the ID of the report for which the schedules
    have to be fetched.

  • scheduleid

    It takes an integer value specifying the ID of the schedule that has to be fetched.

Sample code
GET
https://training.mojonetworks.com/new/webservice/v5/reports/schedules?
scheduleid=5&locationid=1&reportid=21
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains the details of all the fetched report schedules.

Get Report Schedules for a Location

Description This API is used to fetch all the report schedules created by the logged-in user
for a specified location and optionally for its child locations too from Arista Server
or Arista Cloud Services. The types of report schedules that can be fetched are
onetimereportschedule and recurringreportschedule.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
GET <Base_URL>/reports/schedules/location?locationid=<value>&subtree=<value>
  • locationid

    It is an integer value specifying the location for which the report schedules
    have to be fetched. To retrieve the value for location id refer Location call.

  • subtree

    It takes a boolean value specifying whether or not the schedules for the child
    locations must be fetched.

Sample code
GET
https://training.mojonetworks.com/new/webservice/v5/reports/schedules/
location?locationid=1&subtree=false
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains the details of the fetched report schedules. The response is in the
application/json format.

Get a Report Schedule

Description This API is used to fetch a report schedule based on the specified schedule ID from
Arista Server or Arista Cloud Services.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
GET <Base_URL>/reports/schedule/{scheduleid}
  • scheduleid

    Is an integer value indicating the ID of the report schedule whose details have to
    be fetched. For example, 2.

Sample code
GET
https://training.mojonetworks.com/new/webservice/V5/reports/schedule/2
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains the details of the report schedule fetched based on the specified
schedule ID. The response is in the application/json format.

Get Schedule for a Report

Description This API is used to fetch the details of schedules created for a report based on
the specified report ID. The schedule details are fetched from the Arista Server or
the Arista Cloud Services.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
GET <Base_URL>/reports/schedules/{reportid}
  • reportid

    Is an integer value indicating the ID of the report for which
    the corresponding schedule details have to be fetched. For example, 21

Sample code
GET
https://training.mojonetworks.com/new/webservice/V5/reports/schedules/21
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains the details of the report schedules fetched based on the specified
report ID. The response is in the application/json format.

Get Schedule for a Report and Location

Description This API is used to fetch the schedule details of a report based on the specified
report ID and for a specified location. The schedule details are fetched from Arista
Server or Arista Cloud Services.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
GET <Base_URL>/reports/schedule/report/{reportid}
  • reportid

    Is an integer value indicating the ID of the report for which the corresponding
    schedule details are to be fetched. For example, 21.

  • locationid

    It accepts an integer value specifying the ID of the location for which the
    report schedule has to be fetched. To retrieve the value for location id refer Location call.

Sample code
GET
https://training.mojonetworks.com/new/webservice/v5/reports/schedules/21?
locationid=1
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains the details of the report schedule fetched based on the specified
report ID and location. The response is in the application/json format.

Create a Report Schedule

Description This API is used to create a report schedule by the logged-in user in Arista Server
or Arista Cloud Services.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
PUT <Base_URL>/reports/schedule
Sample code
PUT https://training.mojonetworks.com/new/webservice/V5/reports/schedule
Request Body This API call requires the details of the report schedule to be created, which is passed
as parameters in the request body. The parameters are passed in the application/json format. 

A sample request body for the report with a schedule type as onetimereportschedule:

{
	"type": "onetimereportschedule",
	"oneTimeReportPeriodType": "CUSTOM",
	"deliveryTime": 1560504289455,
	"fromDateTime": 1560417889455,
	"toDateTime": 1560504289455,
	"zipBeforeEmail": true,
	"format": "HTML",
	"langId": 0,
	"archivalInfo": {
		"deleteAfterDays": 10,
		"neverDelete": false
	},
	"recipients": [{
		"userId": 2,
		"emailAddress": "teammsp@atn.com"
	}],
	"reportId": 7
}

A sample request body for the report with a schedule type as recurringreportschedule:

{
	"type": "recurringreportschedule",
	"startScheduleDateTime": 1560417294129,
	"endScheduleDateTime": 1560503694129,
	"scheduleFrequencyValue": 1,
	"scheduleFrequencyUnit": "HOURS",
	"reportTimePeriodValue": 8,
	"reportTimePeriodUnit": "HOURS",
	"zipBeforeEmail": true,
	"format": "HTML",
	"langId": 0,
	"archivalInfo": {
		"deleteAfterDays": 10,
		"neverDelete": true
	},
	"recipients": [{
		"userId": 2,
		"emailAddress": "teammsp@atn.com"
	}],
	"reportId": 21
}
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains the details of the report schedule created. The response is in
the application/json format.

Modify a Report Schedule

Description This API is used to modify a report schedule fetched from Arista Server or Arista
Cloud Services.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
POST <Base_URL>/reports/schedule
Sample code
POST https://training.mojonetworks.com/new/webservice/V5/reports/schedule
Request Body This API call requires the modified details of the report schedule,
which is passed as parameters in the request body. The parameters are passed
in the application/json format.A sample request body is as follows:

{
	"type": "onetimereportschedule",
	"oneTimeReportPeriodType": "CUSTOM",
	"deliveryTime": 1560503897451,
	"fromDateTime": 1560417497451,
	"toDateTime": 1560503897451,
	"zipBeforeEmail": true,
	"format": "HTML",
	"langId": 0,
	"archivalInfo": {
		"deleteAfterDays": 10,
		"neverDelete": false
	},
	"recipients": [{
		"userId": 2,
		"emailAddress": "teammsp@atn.com"
	}],
	"scheduleId": 49,
	"reportId": 11
}
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains modified details of the report schedule. The response is in the application/json format.

Delete a Report Schedule

Description This API is used to delete a report schedule from the Arista Server or the Arista
Cloud Services.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
DELETE <Base_URL>/reports/schedule/{scheduleid}
  • scheduleId

    Is an integer value indicating the ID of the report schedule that has to be deleted.
    For example, 0.

Sample code
DELETE https://training.mojonetworks.com/new/webservice/V5/reports/schedule/2
Request Body This API call does not require any request body parameters
Response Body If the API call is successful, the HTTP response status is 204.
The response body does not contain any information.

Test APIs

Description This API is used to fetch the APs that match the specified filter criteria from the allowed locations for the logged-in user. If no filters are specified, all the APs from the allowed locations are fetched. However, this API is not supported in a server cluster environment.

Note: Do not use this API to fetch more than 100 devices. For fetching larger number of devices, consider using the Get Paged List of APs API.

User Privileges Users with the following roles can call this API: superuser, administrator, and operator.

Request Body Parameters
This API call does not require any request body parameters.

Response Body
If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Error codes
If the API call is successful, the HTTP response status is 200.

Syntax
GET /devices/aps
Sample code
GET https://training.mojonetworks.com/new/webservice/v2/devices/aps
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?macaddress=00:11:74:33:23:12&macaddress=00:11:74:45:12:21
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?capability=49&locationid=10&locationid=12&sortcolumn=devicename&sortascending=false
URL Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Query Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.
JSON Table

Attribute Data Type Description
type String Report type. The applicable values are recurringreportschedule and onetimereportschedule.
scheduleId int System-generated ID of this schedule that can be used to retrieve, modify, delete the schedule.
recipients application/json Recipients who will receive the report via email.
recipients/userId int System-generated ID of the user who will receive this report via email.
recipients/emailAddress String Email address of a user not added to the system.
deleteAfterDays int The days after which the archived report will be deleted.
archivalStatus boolean True or false value indicating whether the report is to be archived.
zipBeforeEmail boolean True or false value indicating whether the report must be zipped (compressed) before sending it via email.
locationId JSON for LocationId LocationId at which the report is generated. For complete details about the JSON, click Location ID.
userId int System-generated ID of the user who added the schedule.
reportId int System-generated ID of the report.
format String The format in which the report is generated. The applicable values are PDF, XML, and HTML.
langId int System-generated ID of the language in which the report is to be generated.
startScheduleDateTime long The schedule start time in milliseconds. Applicable only when the report schedule type is recurringreportschedule.
endScheduleDateTime long The schedule stop time in milliseconds. Applicable only when the report schedule type is recurringreportschedule.
scheduleFrequencyValue int Number of hours/days/months after which this report must be generated and delivered. Applicable only when the report schedule type is recurringreportschedule.
scheduleFrequencyUnit String The schedule frequency unit. The applicable values are HOURS, DAYS, and MONTHS. Applicable only when the report schedule type is recurringreportschedule.
reportTimePeriodValue int The number of hours/days/months of data that the report must contain. Applicable only when the report schedule type is recurringreportschedule.
reportTimePeriodUnit String The time period unit in which the report will be generated. The applicable values are HOURS, DAYS, and MONTHS. Applicable only when the report schedule type is recurringreportschedule.
deliveryTime long The time when the report is to be delivered. Applicable only when the report schedule type is onetimereportschedule.
fromDateTime long Data starting from this time will be available in the report. The time unit is milliseconds. Applicable only when the report schedule type is onetimereportschedule.
toDateTime long Data till this time will be available in the report. The time unit is milliseconds. Applicable only when the report schedule type is onetimereportschedule.
oneTimeReportPeriodType String The reporting period type. The applicable values are FIXED and CUSTOM. If set to FIXED, then values for fromDateTime and toDateTime must be specified. If set to CUSTOM, then values for oneTimeReportPeriodValue and oneTimeReportPeriodUnit must be specified. Applicable only when the report schedule type is onetimereportschedule.
oneTimeReportPeriodValue int The number of hours/days/months of data that the report must contain. Applicable only when the report schedule type is onetimereportschedule.
oneTimeReportPeriodUnit String The time period unit in which the report will be generated. The applicable values are HOURS, DAYS, and MONTHS. Applicable only when the report schedule type is onetimereportschedule.

Sample JSON
[
    {
        "type": "recurringreportschedule",
        "scheduleId": 3,
        "recipients": [
            {
                "userId": 1,
                "emailAddress": "admin@admin.com"
            }
        ],
        "deleteAfterDays": -1,
        "archivalStatus": false,
        "zipBeforeEmail": false,
        "locationId": {
            "type": "locallocationid",
            "id": 0
        },
        "userId": 1,
        "reportId": 21,
        "format": "XML",
        "langId": 0,
        "startScheduleDateTime": 1518633000000,
        "endScheduleDateTime": 1519324200000,
        "scheduleFrequencyValue": 1,
        "scheduleFrequencyUnit": "HOURS",
        "reportTimePeriodValue": 1,
        "reportTimePeriodUnit": "HOURS"
    },
    {
        "type": "onetimereportschedule",
        "scheduleId": 2,
        "recipients": [
            {
                "userId": 1,
                "emailAddress": "admin@admin.com"
            }
        ],
        "deleteAfterDays": -1,
        "archivalStatus": false,
        "zipBeforeEmail": false,
        "locationId": {
            "type": "locallocationid",
            "id": 0
        },
        "userId": 1,
        "reportId": 22,
        "format": "PDF",
        "langId": -2,
        "deliveryTime": 1518723000000,
        "fromDateTime": 0,
        "toDateTime": 0,
        "oneTimeReportPeriodType": "FIXED",
        "oneTimeReportPeriodValue": 6,
        "oneTimeReportPeriodUnit": "HOURS"
    },
    {
        "type": "onetimereportschedule",
        "scheduleId": 4,
        "recipients": [
            {
                "userId": 1,
                "emailAddress": "admin@admin.com"
            }
        ],
        "deleteAfterDays": -1,
        "archivalStatus": false,
        "zipBeforeEmail": false,
        "locationId": {
            "type": "locallocationid",
            "id": 0
        },
        "userId": 1,
        "reportId": 38,
        "format": "PDF",
        "langId": 0,
        "deliveryTime": 1518742140000,
        "fromDateTime": 0,
        "toDateTime": 0,
        "oneTimeReportPeriodType": "FIXED",
        "oneTimeReportPeriodValue": 1,
        "oneTimeReportPeriodUnit": "HOURS"
    }
]