Server

Create a database and sync items

You can create a database by synching your items via a POST-Request against our batch-endpoint

the url for the batch-endpoint is:

https://api.aiphilos.com/v1/{language}/items/{db}/batch

Because for the time being, aiPhilos is only available in german, you will need to replace {langauge} with ‘de-de’ (without the quotes) and {db} with the database name of your choice.

Database names do not need to be unique across users.

Send the items that should be synchronized in json-format like this:

{ items :
    [
        {
            "_id": "0",
            "_action": "POST",
            "additional_property1" : "additional_information",
            "additional_property2" : "additional_information"
        },
        {
            "_id": "1",
            "_action": "POST",
            "additional_property1" : "additional_information",
            "additional_property2" : "additional_information"
        }
    ]
}

Two important points:

Note

The properties ‘_id’ and ‘_action’ are mandatory. the _id property for every item needs to be unique and _action needs to be set to POST so the item gets indexed by aiPhilos*

Note

Please be aware that the batch-endpoint has a limit of 1000 items per request. Please make sure to send the items that should be indexed in chunks of no more than 1000.

The full documentation for the batch endpoint is available at:

https://docs.aiphilos.com/api/#/items/post__language__items__db__batch

Set an appropriate scheme

Setting a scheme means telling aiPhilos how the data contained in the sent items is structured. To be precise: What fields it should analyze and what kind of data they hold.

Have a look at the following example:

{ items :
    [
        {
            "_id": "0",
            "_action": "POST",
            "custom_prop": 4.3
        },
        {
            "_id": "1",
            "_action": "POST",
            "custom_prop": 50
        }
    ]
}

Here custom_prop could mean several things. It could be a price, a rating or even a measurement.

By setting a scheme you can make sure that your data is interpreted as expected. Depending on the search query this could mean that that prices or ratings are used to order items appropriately, that manufacturers are recognized as such and that gtins or that the frequency of an item being ordered is being taken into account when searching with aiPhilos

To set a scheme you will need to send a POST-Request against our scheme-endpoint.

The url of the endpoint is:

https://api.aiphilos.com/v1/{language}/items/{db}/scheme

as before, replace {language} with ‘de-de’(without the quotes) and {db} with the name of the database that you created earlier.

Again, the payload needs to be sent in json format, similar to this example:

{
    "custom_prop1": "general.auto",
    "custom_prop2": "product.price",
    "custom_prop3": "product.rating"
}

the following scheme-types are available:

general.auto
general.off
product.number
product.name
product.category
product.description
product.price
product.gtin
product.manufacturer
product.manufacturer_number
product.stock
product.supplier
product.supplier_number
product.rating
product.state
order.frequency

For more information about schemes have a look at scheme/scheme-type.

The full documentation for the scheme endpoint is available at:

https://docs.aiphilos.com/api/#/items/put__language__items__db__scheme

Important Information

After synchronizing items with aiPhilos and after setting a scheme, aiPhilos needs to analyze and interpret the data contained in the synchronized items. Depending on the complexity of the data and the amount of the items this may take between three days and a week. During this time search results are not reflective of the final result. It is important that you include an option to prepare the synchronized data, which, as long as activated, does not replace the original search and only syncs the data to the aiPhilos-Cloud. It is also important to inform the user that enabling this mode is recommended as long as the synchronized data is not yet fully analyzed. Disabling this mode, after the analysis and interpretation of the synchronized items is finished, should then switch to the actual aiPhilos search via the search-endpoint.

It would be advisable to implement additional parameters like “forceAi” to be able to test search results without setting the plugin to fully active.

The full documentation for both endpoints can be looked up here:

https://docs.aiphilos.com/api/#/items/get__language__items__db__search https://docs.aiphilos.com/api/#/items/post__language__items__db__search

Further documentation

For more detailed information regarding the API have a look at our API-Documentation:

https://docs.aiphilos.com/api/