MU Opens

You cannot configure the MU Opens output file. The output is designed to be compatible with the SmartSync Import MU Opens feature. Output fields are described below in Output Field Descriptions.

API Specifications

Description Creates a task for workmanager to execute exportEngine  for MU Opens exporter.
Authentication
Required
yes
URL https://<domain or IP>/SMARTSync/services/rs/exporters/v1/mu-opens
Method POST
Request Headers

Cookie: JSESSIONID={jsessionId}

Content-Type: application/json

Request Params (See below)

API Specification: Request Params

startDate - String, format:  YYYY-MM-YY

Required: true.

Notes: cannot be after the endDate

endDate - String, format:  YYYY-MM-YY

Required: true.

Notes: cannot be before the startDate

outputFormat - String, supported formats: XML, JSON

Required: true.

Notes: is not case sensitive

muIds - array of Integers. 

Should be one or more IDs user has permission to use.

Required: true.

Notes: is not case sensitive 

keepEmptyJsonFields - boolean field.

Required: false.

Notes: This field can be set only if outputFormat is set to JSON. By default it is false. If set to true then JSON output will contain empty values ({},[],"") for fields.

API Specification (cont)

Response
Data

Response has a unique JobId:

jobId is a 32 length string 

Example

{
"jobId": "9b2fe7bb8362429fb85a16c9373cf50c"
}
Response
Headers
Content-Type: application/json
Success
Response
Code: 200 OK
Content : [Response Data]
Error
Response

Code: 401 Unauthorized

Error message:

{
"message": "Unauthorized",
"status": 401
}
Code: 400 Bad Request
All fields are invalid:
{
"message": "One or more request validations failed",
"status": 400,
"details": [
"Invalid outputFormat value: 'pipe'",
"Invalid dateFormat value: 'wrongDateFormat'",
"Invalid timeFormat value: 'wrongTimeFormat'",
"startDate must match the provided yyyy-MM-dd format",
"endDate must match the provided yyyy-MM-dd format",
"Insufficient permissions to view entities 'MU 8888'",
"Invalid entity: 'MU 1234567'"
    ]
}
Start date>end date
{
"message": "One or more request validations failed",
"status": 400,
"details": [
"endDate must be either equal to or after the startDate"
    ]
}
Code: 500 Internal server error
Sample Call for XML outputFormat

https://localhost/SMARTSync/services/rs/exporters/v1/mu-opens

request body(request for all fields):

{
"startDate":"2023-01-01",
"endDate":"2023-03-01",
"outputFormat":"XML",
"dateFormat":"ddmmyyyy",
"timeFormat":"12",
"muIds":[500]
}
Sample Call for JSON outputFormat

https://localhost/SMARTSync/services/rs/exporters/v1/mu-opens

request body(request for all fields):


{
"startDate":"2023-01-01",
"endDate":"2023-03-01",
"outputFormat":"JSON",
"dateFormat":"ddmmyyyy",
"keepEmptyJsonFields": true,
"timeFormat":"12",
"muIds":[500]
}

Output Field Descriptions

  • This export runs for each MU specified in the muIds list.

  • If the export runs for multiple MUs, all the data is saved in the same output file.

  • For each MU and each date in the specified date range, the output file contains a record, an muOpens element, for each CT for which the MU has data in MUSchedOpen.

The MU Opens output can contain these fields:

Field

Description

Values

opens

The root element.

If no data exists for any MU for any of the dates being processed, this element is empty. Otherwise, this element contains one muOpens child for each date on which the MU has records within the specified date range.

muOpens

This element contains all the data for a single MU, CT, and date.

This element contains one muID child, one ctID child, one date child, and zero or more openValue children.

muID

The ID of the MU being processed.

 

ctID

The CT for which the MU has open data on the date being processed.

This value may be -1.

date

The schedule date, not activity code date, being processed. The date is exported using a day child, a month child, and a year child.

 

time

An attribute of the openValue element. This is the start time of the 15-minute period, in 24-hour format.

Since MUSchedOpen and MUExternalOpen records both include data for 48 hours, all 192 periods in each record may be exported.

Note: Data is exported in 15-minute increments, regardless of the customer’s statistics period length. Also, the timeFoFrmat parameter is not used for this exporter.

The values in this field are between 00:00 and 47:45.

openValue

The MU’s number of scheduled open minutes for the CT. This is the opens value for the period in MUSchedOpen plus the opens value for the period in the MU external open table.

Note: Values are only added between the two tables if the records exist for the same MU, date, and CT.

Formatted to 4 decimal places. One openValue child is included in the muOpens element for each non-zero period in the day.

Periods for which the total opens value is zero are excluded.

If a record exists in the MU schedule open table or the MU external open table for the date being processed, but every period is zero, no openValue children are included in the muOpens element. If no data exists for the MU, the CT and the date in either the MU schedule open table or the MU external open table, no muOpens element is included for the date.

Supported output formats:

  • XML
  • JSON

JSON with results

JSON with empty result

XML with results

XML with empty result