Get Predictions
/utility/predict
Request
There are no request parameters for this operation.
- application/json
objecttrue-
object
Extensible
Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`.
-
object
type
Specifies the input parameters for the request.
object-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
account_id: string
Specifies the customer account ID.
-
model_names(required): array
model_names
Lists the algorithms to use for the prediction service - knn, dnn, or cosine.
-
msisdn: string
Specifies the customer's MSISDN.
arrayResponse
200 Response
array-
Array of:
object Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "PredictResponse":"#/components/schemas/PredictResponse" } }Additional Properties Allowed:true
objectDiscriminator Values
true-
object
Extensible
Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`.
-
object
Discriminator: @type-allOf[1]
Additional Properties Allowed:
trueReturns the result output.
object-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
objecttrue-
predictions(required): array
predictions
Recommendations returned by each algorithm.
-
status(required): string
Indicates the current status of the service.
array-
Array of:
object Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "PredictionDetails":"#/components/schemas/PredictionDetails" } }Additional Properties Allowed:true
objectDiscriminator Values
true-
object
Extensible
Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`.
-
object
Discriminator: @type-allOf[1]
Additional Properties Allowed:
trueProvides the details for a recommendation.
objecttrue-
algorithm: string
Specifies the algorithm used to generate the recommendation.
-
top_results(required): array
top_results
Lists the recommendation results.
array-
Array of:
object Discriminator: @type
Discriminator:
{ "propertyName":"@type", "mapping":{ "ResultDetails":"#/components/schemas/ResultDetails" } }Additional Properties Allowed:true
objectDiscriminator Values
true-
object
Extensible
Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`.
-
object
Discriminator: @type-allOf[1]
Additional Properties Allowed:
trueLists the predicted outcomes.
objecttrue-
prediction: string
Returns the next best offer.
-
probability_or_distance: number
Indicates the confidence score or distance for the recommendation.
400 Response
objectDiscriminator Values
-
object
Extensible
Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`.
-
object
Discriminator: @type-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
object-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
401 Response
objectDiscriminator Values
-
object
Extensible
Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`.
-
object
Discriminator: @type-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
object-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
403 Response
objectDiscriminator Values
-
object
Extensible
Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`.
-
object
Discriminator: @type-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
object-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
404 Response
objectDiscriminator Values
-
object
Extensible
Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`.
-
object
Discriminator: @type-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
object-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
405 Response
objectDiscriminator Values
-
object
Extensible
Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`.
-
object
Discriminator: @type-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
object-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
409 Response
objectDiscriminator Values
-
object
Extensible
Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`.
-
object
Discriminator: @type-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
object-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
500 Response
objectDiscriminator Values
-
object
Extensible
Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`.
-
object
Discriminator: @type-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
object-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
501 Response
objectDiscriminator Values
-
object
Extensible
Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`.
-
object
Discriminator: @type-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
object-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
503 Response
objectDiscriminator Values
-
object
Extensible
Base extensible schema for use with TM Forum Open APIs. When used in a schema, the entity must be extended by specifying `@type`.
-
object
Discriminator: @type-allOf[1]
Indicates an error response from the API, usually accompanied by an HTTP status code (3xx, 4xx, or 5xx).
object-
@baseType: string
Specifies the superclass while subclassing.
-
@schemaLocation: string
Provides a URI to the JSON Schema file that defines additional attributes and relationships.
-
@type(required): string
When subclassing, specifies the extensible name of the subclass.
object-
code(required): string
Provides application-specific details, as defined by the API or a common list.
-
message: string
Provides additional error details and recommended corrective actions to display to the client user.
-
reason(required): string
Provides an explanation of the error to display to the client user.
-
referenceError: string
Provides a URI to documentation that describes the error.
-
status: string
Specifies the extended HTTP error code.
Examples
Example 1: Predictions Through the REST API
This example shows the cURL command for sending a Predict request through the REST API:
curl -X POST 'http://hostname:port/utility/predict' -H 'Content-Type: application/json' -d @file1.json
where:
-
hostname is the host name of the application server.
-
port is the port for the application server.
-
file1.json is the JSON file that specifies the prediction request.
Request Body
The following example shows the contents of the file1.json file sent as the request body.
{
"@type": "PredictRequest",
"account_id": "2824533",
"model_names": [
"recommend_knn",
"dnn"
]
}
Response Body
If successful, the response code 200 is returned with the following response body.
[
{
"@type": "PredictResponse",
"status": "Success",
"predictions": [
{
"@type": "PredictionDetails",
"algorithm": "knn",
"model_name": "recommend_knn",
"account_id": "2824533",
"present_deal": "Deal 10 - Data Storm",
"top_results": [
{
"@type": "ResultDetails",
"prediction": "Deal 12 - Data Mini",
"probability_or_distance": 0.0
},
{
"@type": "ResultDetails",
"prediction": "Deal 4 - SMS Special",
"probability_or_distance": 0.0
},
{
"@type": "ResultDetails",
"prediction": "Deal 3 - CO for Voice 40 ",
"probability_or_distance": 0.0
}
]
},
{
"@type": "PredictionDetails",
"algorithm": "dnn",
"model_name": "dnn",
"account_id": "2824533",
"present_deal": "Deal 10 - Data Storm",
"top_results": [
{
"@type": "ResultDetails",
"prediction": "Deal 1 - Data 30",
"probability_or_distance": 0.11470177
},
{
"@type": "ResultDetails",
"prediction": "Deal 11 - Data Blaze",
"probability_or_distance": 0.11470167
},
{
"@type": "ResultDetails",
"prediction": "Deal 10 - Data Storm",
"probability_or_distance": 0.11470162
}
]
}
]
}
]
Example 2: Predictions Through the MCP Tool
This example shows the cURL command for calling the prediction tool through the MCP endpoint:
curl -X POST 'http://hostname:port/monetization/nbo/v1/mcp' -H 'Content-Type: application/json' -d @file2.json
where:
-
hostname is the host name of the application server.
-
port is the port for the application server.
-
file2.json is the JSON file that specifies the MCP tool call and its prediction arguments.
Request Body
The following example shows the contents of the file2.json file sent as the request body.
{
"jsonrpc": "2.0",
"id": "1",
"method": "tools/call",
"params": {
"name": "predict-service",
"arguments": {
"@type": "PredictRequest",
"account_id": "2824533",
"model_names": [
"recommend_knn",
"dnn"
]
}
}
}
Response Body
The following illustrative MCP response expands the abbreviated engineering response using the prediction results from Example 1 for the same inputs. The JSON-RPC response ID matches the request ID.
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"content": [
{
"type": "text",
"text": "{\"account_id\":\"2824533\",\"status\":\"Success\",\"predictions\":[{\"@type\":\"PredictionDetails\",\"algorithm\":\"knn\",\"model_name\":\"recommend_knn\",\"account_id\":\"2824533\",\"present_deal\":\"Deal 10 - Data Storm\",\"top_results\":[{\"@type\":\"ResultDetails\",\"prediction\":\"Deal 12 - Data Mini\",\"probability_or_distance\":0.0},{\"@type\":\"ResultDetails\",\"prediction\":\"Deal 4 - SMS Special\",\"probability_or_distance\":0.0},{\"@type\":\"ResultDetails\",\"prediction\":\"Deal 3 - CO for Voice 40 \",\"probability_or_distance\":0.0}]},{\"@type\":\"PredictionDetails\",\"algorithm\":\"dnn\",\"model_name\":\"dnn\",\"account_id\":\"2824533\",\"present_deal\":\"Deal 10 - Data Storm\",\"top_results\":[{\"@type\":\"ResultDetails\",\"prediction\":\"Deal 1 - Data 30\",\"probability_or_distance\":0.11470177},{\"@type\":\"ResultDetails\",\"prediction\":\"Deal 11 - Data Blaze\",\"probability_or_distance\":0.11470167},{\"@type\":\"ResultDetails\",\"prediction\":\"Deal 10 - Data Storm\",\"probability_or_distance\":0.11470162}]}]}"
}
],
"isError": false
}
}