Examples of API operations
Sending a JSON with an event
Example of a file containing a package of statements:
Example of a client query:
Example of a response:
Parameters
appid
Client id
Yes
ts
Time in miliseconds (field name can be modified in config file)
Yes
event_id
Event type (field name can be modified in config file)
Yes
user_id
User id (field name can be modified in config file)
Yes
Response codes
403 Forbidden
No appid
200
"error": "Error during json parsing"
Error during json parsing
Query about user's profile (list of aggregates)
Example of a client query:
Example of a response:
Parameters
appid
Client id
Yes
userid
User id
Yes
Response codes
403 Forbidden
No appid
400 Bad request
No userid
Adding a model
Example of a client query:
Example of a response:
{} - no error
Parameters
appid
Client id
Yes
modelid
Model id
Yes
value
CPC (in programmatic)
Yes
client_value
Client CPC (in programmatic)
No
use_category
If 1 - model will be buid on categories, if 0 - model will be build on campaigns
Yes
category_id
Model category id (in programmatic - campaign category)
Yes, if use_category=1
positive_target_cnt
In programmatic - a number of ordered clicks
No
excluded or included
List of urls to exclude or include in a model (it could be either exclude or include field)
No
Response codes
403 Forbidden
No appid
404 Not Found
No modelid
400 Bad request
Invalid format of modelid
200
"error": "Parameter use_category must be set and must be an integer (0 or 1)"
No use_category or invalid format
200
"error": "Parameter value must be set and must be numeric"
No value or invalid format
200
"error": "Parameter category_id must be provided if use_category=1"
No category_id while use_category=1
200
"error": "Exactly one parameter must be set (either included or excluded)"
No excluded/included set or both excluded and included set
Model desactivation
Example of a client query:
Example of a response:
{} - no error
Parameters
appid
Client id
Yes
modelid
Model id
Yes
Response codes
403 Forbidden
No appid
404 Not Found
No modelid
400 Bad request
Invalid format of modelid
200
"error": "model does not exist."
The model does not exist
Adding urls to exclude/include during modeling (in programmatic)
Example of a client query:
Example of a response:
{} - no error
Parameters
appid
Client id
Yes
modelid
Model id
Yes
excluded or included
A list of urls to exclude or include during modeling
Yes
Response codes
403 Forbidden
No appid
404 Not Found
No modelid
400 Bad request
Invalid format of modelid
200
"error": "Exactly one parameter must be set (either included or excluded)""
No excluded/included set or both excluded and included set
Downloading information about chosen model
Example of a client query:
Example of a response:
Parameters
appid
Client id
Yes
modelid
Model id
No - if empty, all models will be returned
Response codes
403 Forbidden
No appid
400 Bad request
Invalid format of modelid
200
{}
The model does not exist
Downloading information about all models
Example of a client query:
Example of a response:
Parameters
appid
Client id
Yes
Response codes
[]
There are no models for chosen appid
Downloading information about used/unused, active models
Example of a client query:
Example of a response:
Parameters
appid
Client id
Yes
used
1 - list of used models in on-line scoring (active=1 and used=1 in metadata), 0 - list of active models, but with used=0
Response codes
[]
There are no models for chosen appid and used value
Last updated