JSON
Type of Data
Custom Data Feed
Description
Similar to the HTTP Get Data Feed (with Optional OAuth2 Configuration), the JSON feed pulls content from a customer supplied URL and makes this data available to an Openmix application. The data is assumed to always be a valid JSON. Fusion wraps the result in a wrapper JSON object to add metadata before sending the data to Openmix. The Openmix app is responsible for retrieving the data and making any decisions for error conditions.
Note: The customer’s JSON data combined with the JSON wrapper must be under 10K in size or Fusion will reject it. This is a hard limit imposed by the infrastructure app servers.
Similar to the HTTP Get Fusion data feed, this feed also provides optional OAuth2 integration (primarily used to retrieve data from the portal API).
Data Feed Format
Success example: Retrieving valid JSON
{
"body": {
"active_user_sessions": 9,
"available": "YES",
"component": "fusion",
"current_time": "2017-05-31 17:16:19"
},
"responseCode": 200,
"status": "success",
"timestamp": "2017-05-31T17:16:19.655Z"
}
<!--NeedCopy-->
Success example: Retrieving data from portal API
{"body":[["Akamai CDN,"856244],["Telenor CDN,"1575138],["Arkena North,"1567285]],"timestamp":"2017-04-18T19:21:20.490Z","responseCode":200,"status":"success"}
Fields
- Body: Validated JSON payload retrieved from customer URL or empty JSON object “{}” if no valid JSON retrieved
- Response Code: Indicates whether a specific HTTP request was successfully completed.
- Status: “Success” if Fusion received a response with a valid JSON in the body. Otherwise, some type of failure, for example, “invalid_json,” “failure,” “timeout” and so on
- Timestamp: ISO 8601 string representing the UTC time of the Fusion call.
Set up in Fusion
You can access Fusion Data Feeds from the left navigation pane, under Openmix. For initial steps please refer to the Fusion Integration Documentation.
When you get to the service-specific configuration dialog box, enter the following:
- Name: The name given to the data feed. This defaults to “Service - Platform Name” if not specified.
- Run Every: The frequency with which the data feed is updated from the service.
- Platform: The Platform that is associated with the data feed.
- URL: The URL is an endpoint on the customer’s network that returns some data that the customer wants to see in Openmix. The response body is retrieved from the URL and pushed as-is to Openmix. The only requirement is that it must return valid JSON.
Optional OAuth2 configuration
The optional OAuth2 configuration was originally designed to pull Openmix and Radar data via the ITM API.
-
Use the following technical implementation:
- Before calling the customer’s desired (target) endpoint, first obtain an OAuth2 request token
- The OAuth2 token is requested via the customer’s token endpoint.
-
In the OAuth2 token POST request which must be HTTPS, the following request body is passed to the customer’s token generator:
- client_id (user input)
- client_secret (user input)
-
grant_type, hard-coded to
client_credentials
- An OAuth2 token is returned for subsequent API requests.
- With a valid OAuth2 token, the customer’s target URL is called passing in the
Authorization: Bearer {token}
request header
The good news for the JSON OAuth implementation is that if you are calling an API endpoint (Openmix or radar), the OAuth2 configuration fields are not required. Fusion already knows the user’s OAuth2 client credentials and therefore passes them automatically for all ITM based API URLs.
Once the installation is complete, the data feed will be listed on the Fusion data feeds home page with a green status and monitoring metrics in the log history.
To edit a Fusion data feed click the data feed in the list and then click the Edit button. Once you have changed the configuration, click Save. This brings you back to the data feed list with your changes saved and applied to the data feed.