-
Notifications
You must be signed in to change notification settings - Fork 2
User Flow
What do to do to make Phoenix working properly. There are few steps that needs to be taken in order to make everything work. β
β
First of all, we need to create a Model. The model will hold also the data that needs to be served, hence it is important to create it immediately.
To create a model we need to run a POST request to the internal
service, in the following way
β
POST /management/models
{
"name": "modelname",
"signalOrder": ["signal1","signal2"],
"concatenator": "-"
}
β
After that, you can upload some data. To do so, you can either use the Streaming or Batch endpoint.
β
If you want to see which models already exist, you need to make a GET request to the internal
service in the following way:
β
GET /management/models/all
β
If you want to retrieve metadata, like the signalorder or the concatenator, about an existing model, you need to make a GET request to the internal
service in the following way:
GET /management/models/?name=modelname
β
β
You can upload the data in streaming and to do so you can do the following request to the internal
service.
β
POST /streaming
{
"modelName": "modelName",
"signalId": "11",
"recommendations": [{"item":"1","score":"0.8","type":"article"}]
}
β These above are simple examples. You can obviously tailor it according to your data. β
β
If you opt to upload data in batch, you can use either an S3
location or you can submit multiple rows at the same time. The S3
example looks like the following
β
POST /batch
{
"modelName": "modelName",
"dataLocation": "s3://bucket/path/data.json"
}
β If you want to upload data in bulk but row-by-row, you can do the following request β
POST /batch
{
"modelName": "modelName",
"data": [{"item":"11","score":"0.6","type":"movie"},{"item":"12","score":"0.6","type":"movie"}]
}
β
β After you created a Model, you need to create a container. The container can be created by running a POST request in the following way β
POST /management/containers
{
"publicationPoint":"website",
"campaign":"homepage",
"models":["modelName"]
}
β
Note: before you can create a container, you need to create the model(s).
β
If you want to see which containers already exist, you need to make a GET request to the internal
service in the following way:
β
GET /management/containers/all
β
β
If you want to get a preview of the data in a specific model, you need to make a GET request to the internal
service in the following way:
β
GET /management/models/preview?name=modelname
β β
β
Now that you have a model, data in the model and a container, you can query the public
endpoint. To access your data you can run the following request
β
GET /recommend?publicationPoint=website&campaign=homepage&model=modelName&signalId=11
β and this will return something like the following β
{
"recommendations": [
{
"item": "1",
"score": "0.8",
"type": "article"
}
]
}