Quick Start

You can use the Service Health Metrics REST APIs to monitor the overall health status of various services and features available within the Oracle B2C Service application.

Step 1: Consider Before You Start

Review the basics. If you're new to REST APIs, make sure you understand the basics of REST and JSON, and scan our list of important terms.

Choose a REST client. REST APIs connect software programs over the HTTP protocol. You need a software client to send the HTTP requests. In our examples, we use cURL. But, cURL isn't the only tool you can use. To help you choose one, see Work with your REST Client.

Validate Access. Make sure you've a site administrator account that has access to Configuration Assistant.

Step 2: Get Your Service Health Metrics Account Info

To make a REST HTTP request, you need to gather a few bits of information:

  • REST Server URL. The URL of your Service Health Metrics server, which can access all your Oracle B2C Service sites:
    https://monitoring.custhelp.com
  • User name and password. A site administrator account that has access to Configuration Assistant.

Step 3: Configure Your Client

With the information gathered so far, you're ready to configure your client to send a REST HTTP request.

Construct the request URL. The URL consists of the server name and the resource path:
https://<server>/<resource-path>

The <server> is the REST Server URL from Step 2, as in:

https://monitoring.custhelp.com

The <resource-path> is the relative path or endpoint to the resource you're working with. You can pick any endpoint in All REST Endpoints. For example, we're interested in getting all the metrics data for the site:

/v1/sitemetrics

Combine the REST Server URL and, in this example, the resource path and your request URL is complete. For more information, see URL Path.

https://monitoring.custhelp.com/v1/sitemetrics

If you're not familiar with any of the syntax used in the example, check out Work with your REST Client.

Step 4: Integrate Service Health Metrics with Configuration Assistant

  1. Open a command prompt.
  2. Generate a private key by using this command:
    openssl genpkey -out rsakey.pem -algorithm RSA -pkeyopt rsa_keygen_bits:2048
  3. Extract the public key from the private key by using this command:
    openssl pkey -in rsakey.pem -pubout -out rsapubkey.pem
  4. Copy the public key.
  5. Upload the public key in Configuration Assistant, to enable Service Health integration for your site, by using these steps:
    1. Sign in to Configuration Assistant as a site administrator.
    2. From the Configuration Assistant main page, click the Service site for which you want to enable Service Health Metrics.
    3. Click the Integrations tile.
    4. Scroll down to Service Health Metrics.
    5. Click Enable.
    6. In the Enable Health Metrics Endpoint window, paste the public key.
    7. Click Save.

      This creates the JSON Wek Key (JWK) for the site against which the JWT is validated.

Step 5: Authenticate and Authorize

Now that you've configured the client with a complete request URL, it's time to authenticate and authorize yourself. Authentication proves that your credentials are genuine, and authorization allows you to apply your access privileges.

Authentication

To make sure data access over a network is secure, you must pass a JSON Web Token (JWT) as a Bearer Authorization header when you access a REST API operation. For more information on how to generate a JWT token, see Use JSON Web Token for Authorization.

When passing the JWT token in Postman, the authorization type must be Bearer Token, as shown in this screenshot:

This is how you pass a Bearer Token in Postman.

You can now access the REST APIs by passing the JWT authentication token in your requests.

Step 6: Send an HTTP Request

You're almost done. Now that your authentication and authorization are set, you're ready to send a test HTTP request. Continuing with our example, we want to get all the metrics data for the site. You can do this using the following command in cURL:

curl -X GET "https://monitoring.custhelp.com/v1/sitemetrics" -H "Authorization: Bearer HMeyJraWQiOiIxMDAwZXllc19sbiIsImFsZyI6Il"

This is how the request looks in Postman:

This is how a request looks in Postman.

If your request for the report for named users is successful, you receive a response with a body similar to the following abbreviated example. If your request fails, and you're using cURL, review the response comments, adjust your request, and then try again. If you're using other clients, review the failure Status Codes, and then try again.

{
    "serviceMetrics": [
        {
            "widgetserver": {
                "totalRequests": 724,
                "averageLatency": 1,
                "totalPercentage": 2.12,
                "successRequests": {
                    "totalRequests": 724,
                    "averageLatency": 1,
                    "totalPercentage": 100.0,
                    "metricData": [
                        {
                            "200": {
                                "totalRequests": 724,
                                "averageLatency": 1,
                                "totalPercentage": 100.0
                            }
                        }
                    ]
                },
                "errorRequests": {
                    "totalRequests": 0,
                    "averageLatency": 0,
                    "totalPercentage": 0.0,
                    "metricData": []
                },
                "subServices": [
                    {
                        "customer_portal": {
                            "totalRequests": 724,
                            "averageLatency": 1,
                            "totalPercentage": 100.0,
                            "successRequests": {
                                "totalRequests": 724,
                                "averageLatency": 1,
                                "totalPercentage": 100.0,
                                "metricData": [
                                    {
                                        "200": {
                                            "totalRequests": 724,
                                            "averageLatency": 1,
                                            "totalPercentage": 100.0
                                        }
                                    }
                                ]
                            },
                            "errorRequests": {
                                "totalRequests": 0,
                                "averageLatency": 0,
                                "totalPercentage": 0.0,
                                "metricData": []
                            }
                        }
                    }
                ]
            }
        },
        {
            "chat": {
                "totalRequests": 809,
                "averageLatency": 1311,
                "totalPercentage": 2.37,
                "successRequests": {
                    "totalRequests": 809,
                    "averageLatency": 1311,
                    "totalPercentage": 100.0,
                    "metricData": [
                        {
                            "200": {
                                "totalRequests": 809,
                                "averageLatency": 1311,
                                "totalPercentage": 100.0
                            }
                        }
                    ]
                },
                "errorRequests": {
                    "totalRequests": 0,
                    "averageLatency": 0,
                    "totalPercentage": 0.0,
                    "metricData": []
                },
                "subServices": [
                    {
                        "Chat_REST": {
                            "totalRequests": 242,
                            "averageLatency": 113,
                            "totalPercentage": 29.91,
                            "successRequests": {
                                "totalRequests": 242,
                                "averageLatency": 113,
                                "totalPercentage": 100.0,
                                "metricData": [
                                    {
                                        "200": {
                                            "totalRequests": 242,
                                            "averageLatency": 113,
                                            "totalPercentage": 100.0
                                        }
                                    }
                                ]
                            },
                            "errorRequests": {
                                "totalRequests": 0,
                                "averageLatency": 0,
                                "totalPercentage": 0.0,
                                "metricData": []
                            }
                        }
                    },
                    {
                        "Chat_SOAP": {
                            "totalRequests": 567,
                            "averageLatency": 1822,
                            "totalPercentage": 70.09,
                            "successRequests": {
                                "totalRequests": 567,
                                "averageLatency": 1822,
                                "totalPercentage": 100.0,
                                "metricData": [
                                    {
                                        "200": {
                                            "totalRequests": 567,
                                            "averageLatency": 1822,
                                            "totalPercentage": 100.0
                                        }
                                    }
                                ]
                            },
                            "errorRequests": {
                                "totalRequests": 0,
                                "averageLatency": 0,
                                "totalPercentage": 0.0,
                                "metricData": []
                            }
                        }
                    }
                ]
            }
        },
        {
            "Browser_UI": {
                "totalRequests": 23038,
                "averageLatency": 43,
                "totalPercentage": 67.61,
                "successRequests": {
                    "totalRequests": 23038,
                    "averageLatency": 43,
                    "totalPercentage": 100.0,
                    "metricData": [
                        {
                            "200": {
                                "totalRequests": 20720,
                                "averageLatency": 38,
                                "totalPercentage": 89.94
                            }
                        },
                        {
                            "204": {
                                "totalRequests": 1315,
                                "averageLatency": 30,
                                "totalPercentage": 5.71
                            }
                        },
                        {
                            "302": {
                                "totalRequests": 1003,
                                "averageLatency": 177,
                                "totalPercentage": 4.35
                            }
                        }
                    ]
                },
                "errorRequests": {
                    "totalRequests": 0,
                    "averageLatency": 0,
                    "totalPercentage": 0.0,
                    "metricData": []
                },
                "subServices": [
                    {
                        "other": {
                            "totalRequests": 23038,
                            "averageLatency": 43,
                            "totalPercentage": 100.0,
                            "successRequests": {
                                "totalRequests": 23038,
                                "averageLatency": 43,
                                "totalPercentage": 100.0,
                                "metricData": [
                                    {
                                        "200": {
                                            "totalRequests": 20720,
                                            "averageLatency": 38,
                                            "totalPercentage": 89.94
                                        }
                                    },
                                    {
                                        "204": {
                                            "totalRequests": 1315,
                                            "averageLatency": 30,
                                            "totalPercentage": 5.71
                                        }
                                    },
                                    {
                                        "302": {
                                            "totalRequests": 1003,
                                            "averageLatency": 177,
                                            "totalPercentage": 4.35
                                        }
                                    }
                                ]
                            },
                            "errorRequests": {
                                "totalRequests": 0,
                                "averageLatency": 0,
                                "totalPercentage": 0.0,
                                "metricData": []
                            }
                        }
                    }
                ]
            }
        },
        {
            "webserver": {
                "totalRequests": 9504,
                "averageLatency": 85,
                "totalPercentage": 27.89,
                "successRequests": {
                    "totalRequests": 9504,
                    "averageLatency": 85,
                    "totalPercentage": 100.0,
                    "metricData": [
                        {
                            "200": {
                                "totalRequests": 8639,
                                "averageLatency": 79,
                                "totalPercentage": 90.9
                            }
                        },
                        {
                            "302": {
                                "totalRequests": 263,
                                "averageLatency": 234,
                                "totalPercentage": 2.77
                            }
                        },
                        {
                            "201": {
                                "totalRequests": 240,
                                "averageLatency": 204,
                                "totalPercentage": 2.53
                            }
                        },
                        {
                            "404": {
                                "totalRequests": 121,
                                "averageLatency": 17,
                                "totalPercentage": 1.27
                            }
                        },
                        {
                            "206": {
                                "totalRequests": 121,
                                "averageLatency": 4,
                                "totalPercentage": 1.27
                            }
                        },
                        {
                            "401": {
                                "totalRequests": 120,
                                "averageLatency": 84,
                                "totalPercentage": 1.26
                            }
                        }
                    ]
                },
                "errorRequests": {
                    "totalRequests": 0,
                    "averageLatency": 0,
                    "totalPercentage": 0.0,
                    "metricData": []
                },
                "subServices": [
                    {
                        "connectRest": {
                            "totalRequests": 720,
                            "averageLatency": 141,
                            "totalPercentage": 7.58,
                            "successRequests": {
                                "totalRequests": 720,
                                "averageLatency": 141,
                                "totalPercentage": 100.0,
                                "metricData": [
                                    {
                                        "200": {
                                            "totalRequests": 360,
                                            "averageLatency": 119,
                                            "totalPercentage": 50.0
                                        }
                                    },
                                    {
                                        "201": {
                                            "totalRequests": 240,
                                            "averageLatency": 204,
                                            "totalPercentage": 33.33
                                        }
                                    },
                                    {
                                        "401": {
                                            "totalRequests": 120,
                                            "averageLatency": 84,
                                            "totalPercentage": 16.67
                                        }
                                    }
                                ]
                            },
                            "errorRequests": {
                                "totalRequests": 0,
                                "averageLatency": 0,
                                "totalPercentage": 0.0,
                                "metricData": []
                            }
                        }
                    },
                    {
                        "other": {
                            "totalRequests": 8301,
                            "averageLatency": 69,
                            "totalPercentage": 87.34,
                            "successRequests": {
                                "totalRequests": 8301,
                                "averageLatency": 69,
                                "totalPercentage": 100.0,
                                "metricData": [
                                    {
                                        "200": {
                                            "totalRequests": 7796,
                                            "averageLatency": 65,
                                            "totalPercentage": 93.92
                                        }
                                    },
                                    {
                                        "302": {
                                            "totalRequests": 263,
                                            "averageLatency": 234,
                                            "totalPercentage": 3.17
                                        }
                                    },
                                    {
                                        "404": {
                                            "totalRequests": 121,
                                            "averageLatency": 17,
                                            "totalPercentage": 1.46
                                        }
                                    },
                                    {
                                        "206": {
                                            "totalRequests": 121,
                                            "averageLatency": 4,
                                            "totalPercentage": 1.46
                                        }
                                    }
                                ]
                            },
                            "errorRequests": {
                                "totalRequests": 0,
                                "averageLatency": 0,
                                "totalPercentage": 0.0,
                                "metricData": []
                            }
                        }
                    },
                    {
                        "customer_portal": {
                            "totalRequests": 483,
                            "averageLatency": 270,
                            "totalPercentage": 5.08,
                            "successRequests": {
                                "totalRequests": 483,
                                "averageLatency": 270,
                                "totalPercentage": 100.0,
                                "metricData": [
                                    {
                                        "200": {
                                            "totalRequests": 483,
                                            "averageLatency": 270,
                                            "totalPercentage": 100.0
                                        }
                                    }
                                ]
                            },
                            "errorRequests": {
                                "totalRequests": 0,
                                "averageLatency": 0,
                                "totalPercentage": 0.0,
                                "metricData": []
                            }
                        }
                    }
                ]
            }
        }
    ],
    "siteMetrics": {
        "totalRequests": 34075,
        "averageLatency": 84,
        "successPercentage": 100.0
    },
    "siteName": "my_site",
    "updatedTime": "2025-01-28T06:56:00Z",
    "timeInterval": 120
}

Congratulations! Now you're ready to do more with your REST APIs.