Favorites API
Prerequisites:
- Set up API access
- Verify that you have API access and obtain a token via get_token call
Table of contents:
1. Access Admin > System > API Toolkit
2. Get Favorite Folders
- Item: favorite
- Methods: GET
-
Optionally provide ID of the Favorite Folder to retrieve its' data.
- If this parameter is not provided, all Favorite Folders' data is returned.
- Enter an API Token
- [Run request]
- The returned object contains an array of objects representing Favorite Folders
- See Example Response and Fields Description for details
{
"favorites": [
{
"id": "382",
"name": "Most Popular",
"include_in_favorites_digest_ind": "N",
"include_in_digest_on": "element update"
},
{
"id": "381",
"name": "My Favorites",
"include_in_favorites_digest_ind": "Y",
"include_in_digest_on": "element update"
},
{
"id": "564",
"name": "Weekly Popular",
"include_in_favorites_digest_ind": "Y",
"include_in_digest_on": "trigger event"
}
]
}
Fields Description
3. Create Favorite Folder
- Item: favorite
- Methods: POST
- Enter ID of an existing Favorite Folder
- Select JSON request and enter JSON providing the needed values for your Folder:
- name: The name of the new Favorite Folder
-
include_in_favorites_digest_ind: Whether or not the Favorite Folder is included in Favorites Digest. Available values are
yes
andno
-
include_in_digest_on: Whether the Favorite Folder is included in Favorites Digest on
element update
ortrigger event
- Enter an API Token
- [Run request]
- The returned object representing the new Favorite Folder
- See Example Response and Fields Description for details
4. Delete Folder from Favorites
- Item: favorite
- Methods: DELETE
- Enter ID of the Favorite Folder that needs to be deleted
- Enter an API Token
- [Run request]
5. Get Favorite Elements
- Item: favorite_element
- Methods: GET
-
Optionally assign parameter favorite the value of the Favorite Folder ID to retrieve its' elements only.
- If this parameter is not provided, all Favorite Folders' elements are returned.
- Enter an API Token
- [Run request]
- The returned object contains an array of objects representing Favorite Folders' elements.
- See Example Response and Fields Description for details
{
"favorite_elements": [
{
"user_dashboard_element_instance_id": "478869",
"user_id": "118",
"element_id": "2344",
"segment_value_id": "0",
"section_type": "Category",
"favorite_id": "0",
"category_id": "83",
"element_type": "multi-metric chart",
"in_dashboard_ind_flag": "Y",
"last_stoplight_value": "0",
"is_expired": "0",
"is_owned": "0",
"topics": null,
"refresh_frequency_text": "Daily",
"refresh_frequency_sec": "86400",
"description_markdown_ind": "N",
"element_info": "World-wide Sales Multi-metric Multi-Metric",
"metric_unit_of_measure": null,
"last_measurement_time": "2021-07-15 00:00:00",
"external_report_download_url_info": null,
"certified_ind": "N",
"certification_level_id": null,
"last_certified_time": null,
"metric_display_on_tile": "value",
"metric_moving_average_interval": null,
"metric_display_on_tile_prefix": null,
"metric_home_page_compare_value_type": "last value",
"metric_home_page_compare_line_id": null,
"metric_home_page_compare_target_id": null,
"report_single_unit_label": null,
"report_multiple_units_label": null,
"report_no_units_label": null,
"report_on_demand_generation_ind": "Y",
"external_report_display": null,
"certification_level_name": null,
"certification_level_color": null,
"last_certified_by_name": null,
"last_certified_by_email": null,
"business_owner": "Anna Kennedy",
"business_owner_email": "[email protected]",
"data_steward": null,
"data_steward_email": null,
"technical_owner": "Anna Kennedy",
"technical_owner_email": "[email protected]",
"data_source_name": "Manual Entry",
"supports_last_refreshed_check": null,
"display_order": "1000000",
"total_view_count": null,
"in_favorites": null,
"is_in_favorites": "0",
"is_in_folders": "0",
"mi_name": "Daily",
"mi_sequence": "30",
"pct_variance_text": "from last day",
"total_ind": "N",
"parent_segment_value_id": null,
"last_measurement_value_formatted": "8.23M",
"last_measurement_time_formatted": "Thursday 07/15/2021",
"metric_last_moving_average_value_formatted": null,
"last_updated_time": "2022-08-18 08:09:25",
"total_forecast_amount_formatted": null,
"last_activity_time": "2018-08-10 00:00:00",
"last_annotation_text": null,
"last_commentary_text": null,
"element_dashboard_name": "World-wide Sales Multi-metric",
"is_empty_instance_ind": "N",
"metric_tile_display_pct_variance": null,
"report_rows": null,
"last_display_generation_time": "2023-10-18 03:59:22",
"last_file_updated_time": "",
"last_modified": "today",
"favorite_content": null,
"alert_event_id": null,
"last_alert_text": null,
"last_alert_news_type": null,
"is_alert_active": "0",
"is_collaborative_alert_active": "0",
"is_collaborative_annotation_active": "0",
"is_annotation_active": "0",
"is_commentary_active": "0",
"last_notable_event_activity_time": "2018-08-10 00:00:00",
"last_user_annotation_activity_time": null,
"last_user_note_activity_time": null,
"last_alert_event_activity_time": null,
"reporting_tool_name": null,
"remove_preview_link_ind": null,
"is_tech_editor": "N",
"external_content_type_name": null,
"enable_click_in_mobile_ind": null,
"content_type": "Multi-Metric",
"global_total_view_count": null,
"has_access": "Y"
}]
}
Fields Description
6. Add Element to Favorite Folder
- Item: favorite_element
- Methods: POST
- Enter any number
- Select JSON request and enter JSON providing the needed values:
- favorite_id: The ID of the Favorite Folder
- element_id: The ID of the Element
-
segment_value_id:
- If the Element is non-dimensioned, assign any numeric value to this parameter, the parameter will be ignored.
- If the Element is dimensioned, provide its dimension value.
- Enter an API Token
- [Run request]
7. Delete Element from Favorite Folder
$.ajax({
url: '/api/favorite_element/id/elementId?favorite_id=favoriteId&elementSegment=0',
type: 'DELETE',
});
Provide values for the following parameters:
-
elementId
- the ID of the Element, -
favoriteFolderId
- the ID of the Favorite Folder from which the Element will be removed, -
elementSegment
- dimension value of the Element,- If the Element is non-dimensioned, assign any numeric value to this parameter, the parameter will be ignored.