View Creation - ABO

Back Office Integration Guide

Product
ABO
AFS_Version
7.9
Category
Reference Guides
language
English

This API allows to create a view. For more information, see Views chapter of the AFS Back Office User Guide.

A "View Creation" API request takes the following form:

curl -H Expect: -H "Content-Type:application/json" --data "{\"afs:t\":\"bows.view\",\"name\":\"For Demonstration Purposes\",\"queryParams\":{\"afs:t\":\"collection\",\"x:values\":[\"my_query\"]},\"filters\":{\"x:values\":[{\"afs:t\":\"net.antidot.protobuf.ac.views.Views.Filter\",\"rawData\":\"my_filter=my_value\"}],\"afs:t\":\"collection\"},\"customParams\":{\"x:values\":[{\"afs:t\":\"Custom\",\"name\":\"afs:log\",\"value\":\"example\"},{\"afs:t\":\"Custom\",\"name\":\"my_parameter\",\"value\":\"my_parameter_value\"}],\"afs:t\":\"collection\"}}" "http://$HOST/bo-ws/service/$SERVICE_ID/instance/$SERVICE_STATUS/view?afs:login=login://$USER:$PASSWORD@AUTHENTICATION_AUTHORITY"

Method: POST

Hereafter, more details about the post data (some parameters have been duplicated):

{
"afs:t": "bows.view",
"name": "For Demonstration Purposes", // Name of the view
"queryParams": {
"afs:t": "collection",
"x:values": [
"my_query" // Associated query(ies) (Unlimited)
]
},
"filters": {
"afs:t": "collection",
"x:values": [
{
"afs:t": "net.antidot.protobuf.ac.views.Views.Filter",
"rawData": "my_filter=my_value" // First filter
},
{
"afs:t": "net.antidot.protobuf.ac.views.Views.Filter",
"rawData": "my_filter=my_value" // Second filter (Unlimited)
}
]
},
"customParams": {
"afs:t": "collection",
"x:values": [
{
"afs:t": "Custom",
"name": "afs:log",
"value": "example" // First log
},
{
"afs:t": "Custom",
"name": "afs:log",
"value": "example2" // second log (Unlimited)
},
{
"afs:t": "Custom",
"name": "my_parameter", // Name of the first custom parameter
"value": "my_parameter_value" // Value of the first custom parameter
},
{
"afs:t": "Custom",
"name": "my_parameter2", // Name of the second custom parameter
"value": "my_parameter2_value" // Value of the second custom parameter (number of custom parameters is unlimited)
}
]
}
}

Response in case of maximum views (10) reaching.

<afs:value xsi:schemaLocation="http://ref.antidot.net/v7/bo/output http://ref.antidot.net/v7.4/bo/output.xsd" xsi:type="afs:ws.response" xmlns:afs="http://ref.antidot.net/v7/bo/output" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><afs:error xsi:type="afs:ws.information.status"><afs:id>400</afs:id><afs:message>Bad Request</afs:message><afs:code>400</afs:code><afs:description>The maximum number of views have been reached. You can't create another view</afs:description><afs:specURI>http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1</afs:specURI></afs:error><afs:query xsi:type="afs:ws.response.query"><afs:locale>*</afs:locale><afs:properties xsi:type="afs:dynamic"></afs:properties></afs:query></afs:value>