Create export config
curl --request POST \
--url https://apiweb.mile.app/api/v3/export-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Report Daily",
"collection": "task",
"description": "Template for daily report with bill item detail",
"flowIds": [
"66a988d53ae08a7ab52867c2",
"66c6a05440d39b2616275622",
"66c6a05c40d39b2616275624",
"66c6a06412d3f54e2f425e22"
],
"fields": [
{
"component": "input",
"id": "_id",
"inputType": "string",
"source": "reservedKey",
"title": "Id",
"uniqueTitle": "Id"
},
{
"component": "input",
"id": "flow",
"inputType": "string",
"source": "reservedKey",
"title": "Flow",
"uniqueTitle": "Flow"
},
{
"component": "input",
"id": "hub",
"inputType": "string",
"source": "reservedKey",
"title": "Hub",
"uniqueTitle": "Hub"
},
{
"component": "input",
"id": "title",
"inputType": "string",
"source": "reservedKey",
"title": "Title",
"uniqueTitle": "Title"
},
{
"component": "input",
"id": "status",
"inputType": "string",
"source": "reservedKey",
"title": "Status",
"uniqueTitle": "Status"
},
{
"component": "input",
"id": "orderNumber",
"title": "Order Number",
"inputType": "string",
"default": null,
"routeAs": null,
"showAs": "title",
"required": false,
"visible": true,
"page": "page0",
"flowId": [
"66a988d53ae08a7ab52867c2",
"66c6a05440d39b2616275622",
"66c6a05c40d39b2616275624",
"66c6a06412d3f54e2f425e22"
],
"flowName": [
"Export Bill",
"Flow A",
"Flow B",
"Flow C"
],
"uniqueTitle": "Order Number"
},
{
"component": "bill",
"id": "billItem",
"title": "Bill Item",
"addNew": true,
"required": false,
"value": null,
"editable": [],
"costs": [
"Discount",
"Shipping Cost"
],
"visible": true,
"masterItems": [
{
"name": "Snack",
"unit_price": 10000
},
{
"name": "Cold Drink",
"unit_price": 5000
},
{
"name": "Bread",
"unit_price": 7000
},
{
"name": "Egg",
"unit_price": 2500
}
],
"masterCosts": [
{
"type": "number",
"name": "Discount",
"amount": 10000
},
{
"type": "number",
"name": "Shipping Cost",
"amount": 7000
}
],
"qtyRule": null,
"page": "page1",
"flowId": [
"66a988d53ae08a7ab52867c2"
],
"flowName": [
"Export Bill"
],
"additionalField": [
"billItem.Discount",
"billItem.Shipping Cost",
"billItem.totalCost"
],
"uniqueTitle": "Bill Item"
}
]
}
'import requests
url = "https://apiweb.mile.app/api/v3/export-config"
payload = {
"name": "Report Daily",
"collection": "task",
"description": "Template for daily report with bill item detail",
"flowIds": ["66a988d53ae08a7ab52867c2", "66c6a05440d39b2616275622", "66c6a05c40d39b2616275624", "66c6a06412d3f54e2f425e22"],
"fields": [
{
"component": "input",
"id": "_id",
"inputType": "string",
"source": "reservedKey",
"title": "Id",
"uniqueTitle": "Id"
},
{
"component": "input",
"id": "flow",
"inputType": "string",
"source": "reservedKey",
"title": "Flow",
"uniqueTitle": "Flow"
},
{
"component": "input",
"id": "hub",
"inputType": "string",
"source": "reservedKey",
"title": "Hub",
"uniqueTitle": "Hub"
},
{
"component": "input",
"id": "title",
"inputType": "string",
"source": "reservedKey",
"title": "Title",
"uniqueTitle": "Title"
},
{
"component": "input",
"id": "status",
"inputType": "string",
"source": "reservedKey",
"title": "Status",
"uniqueTitle": "Status"
},
{
"component": "input",
"id": "orderNumber",
"title": "Order Number",
"inputType": "string",
"default": None,
"routeAs": None,
"showAs": "title",
"required": False,
"visible": True,
"page": "page0",
"flowId": ["66a988d53ae08a7ab52867c2", "66c6a05440d39b2616275622", "66c6a05c40d39b2616275624", "66c6a06412d3f54e2f425e22"],
"flowName": ["Export Bill", "Flow A", "Flow B", "Flow C"],
"uniqueTitle": "Order Number"
},
{
"component": "bill",
"id": "billItem",
"title": "Bill Item",
"addNew": True,
"required": False,
"value": None,
"editable": [],
"costs": ["Discount", "Shipping Cost"],
"visible": True,
"masterItems": [
{
"name": "Snack",
"unit_price": 10000
},
{
"name": "Cold Drink",
"unit_price": 5000
},
{
"name": "Bread",
"unit_price": 7000
},
{
"name": "Egg",
"unit_price": 2500
}
],
"masterCosts": [
{
"type": "number",
"name": "Discount",
"amount": 10000
},
{
"type": "number",
"name": "Shipping Cost",
"amount": 7000
}
],
"qtyRule": None,
"page": "page1",
"flowId": ["66a988d53ae08a7ab52867c2"],
"flowName": ["Export Bill"],
"additionalField": ["billItem.Discount", "billItem.Shipping Cost", "billItem.totalCost"],
"uniqueTitle": "Bill Item"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Report Daily',
collection: 'task',
description: 'Template for daily report with bill item detail',
flowIds: [
'66a988d53ae08a7ab52867c2',
'66c6a05440d39b2616275622',
'66c6a05c40d39b2616275624',
'66c6a06412d3f54e2f425e22'
],
fields: [
{
component: 'input',
id: '_id',
inputType: 'string',
source: 'reservedKey',
title: 'Id',
uniqueTitle: 'Id'
},
{
component: 'input',
id: 'flow',
inputType: 'string',
source: 'reservedKey',
title: 'Flow',
uniqueTitle: 'Flow'
},
{
component: 'input',
id: 'hub',
inputType: 'string',
source: 'reservedKey',
title: 'Hub',
uniqueTitle: 'Hub'
},
{
component: 'input',
id: 'title',
inputType: 'string',
source: 'reservedKey',
title: 'Title',
uniqueTitle: 'Title'
},
{
component: 'input',
id: 'status',
inputType: 'string',
source: 'reservedKey',
title: 'Status',
uniqueTitle: 'Status'
},
{
component: 'input',
id: 'orderNumber',
title: 'Order Number',
inputType: 'string',
default: null,
routeAs: null,
showAs: 'title',
required: false,
visible: true,
page: 'page0',
flowId: [
'66a988d53ae08a7ab52867c2',
'66c6a05440d39b2616275622',
'66c6a05c40d39b2616275624',
'66c6a06412d3f54e2f425e22'
],
flowName: ['Export Bill', 'Flow A', 'Flow B', 'Flow C'],
uniqueTitle: 'Order Number'
},
{
component: 'bill',
id: 'billItem',
title: 'Bill Item',
addNew: true,
required: false,
value: null,
editable: [],
costs: ['Discount', 'Shipping Cost'],
visible: true,
masterItems: [
{name: 'Snack', unit_price: 10000},
{name: 'Cold Drink', unit_price: 5000},
{name: 'Bread', unit_price: 7000},
{name: 'Egg', unit_price: 2500}
],
masterCosts: [
{type: 'number', name: 'Discount', amount: 10000},
{type: 'number', name: 'Shipping Cost', amount: 7000}
],
qtyRule: null,
page: 'page1',
flowId: ['66a988d53ae08a7ab52867c2'],
flowName: ['Export Bill'],
additionalField: ['billItem.Discount', 'billItem.Shipping Cost', 'billItem.totalCost'],
uniqueTitle: 'Bill Item'
}
]
})
};
fetch('https://apiweb.mile.app/api/v3/export-config', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/export-config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Report Daily',
'collection' => 'task',
'description' => 'Template for daily report with bill item detail',
'flowIds' => [
'66a988d53ae08a7ab52867c2',
'66c6a05440d39b2616275622',
'66c6a05c40d39b2616275624',
'66c6a06412d3f54e2f425e22'
],
'fields' => [
[
'component' => 'input',
'id' => '_id',
'inputType' => 'string',
'source' => 'reservedKey',
'title' => 'Id',
'uniqueTitle' => 'Id'
],
[
'component' => 'input',
'id' => 'flow',
'inputType' => 'string',
'source' => 'reservedKey',
'title' => 'Flow',
'uniqueTitle' => 'Flow'
],
[
'component' => 'input',
'id' => 'hub',
'inputType' => 'string',
'source' => 'reservedKey',
'title' => 'Hub',
'uniqueTitle' => 'Hub'
],
[
'component' => 'input',
'id' => 'title',
'inputType' => 'string',
'source' => 'reservedKey',
'title' => 'Title',
'uniqueTitle' => 'Title'
],
[
'component' => 'input',
'id' => 'status',
'inputType' => 'string',
'source' => 'reservedKey',
'title' => 'Status',
'uniqueTitle' => 'Status'
],
[
'component' => 'input',
'id' => 'orderNumber',
'title' => 'Order Number',
'inputType' => 'string',
'default' => null,
'routeAs' => null,
'showAs' => 'title',
'required' => false,
'visible' => true,
'page' => 'page0',
'flowId' => [
'66a988d53ae08a7ab52867c2',
'66c6a05440d39b2616275622',
'66c6a05c40d39b2616275624',
'66c6a06412d3f54e2f425e22'
],
'flowName' => [
'Export Bill',
'Flow A',
'Flow B',
'Flow C'
],
'uniqueTitle' => 'Order Number'
],
[
'component' => 'bill',
'id' => 'billItem',
'title' => 'Bill Item',
'addNew' => true,
'required' => false,
'value' => null,
'editable' => [
],
'costs' => [
'Discount',
'Shipping Cost'
],
'visible' => true,
'masterItems' => [
[
'name' => 'Snack',
'unit_price' => 10000
],
[
'name' => 'Cold Drink',
'unit_price' => 5000
],
[
'name' => 'Bread',
'unit_price' => 7000
],
[
'name' => 'Egg',
'unit_price' => 2500
]
],
'masterCosts' => [
[
'type' => 'number',
'name' => 'Discount',
'amount' => 10000
],
[
'type' => 'number',
'name' => 'Shipping Cost',
'amount' => 7000
]
],
'qtyRule' => null,
'page' => 'page1',
'flowId' => [
'66a988d53ae08a7ab52867c2'
],
'flowName' => [
'Export Bill'
],
'additionalField' => [
'billItem.Discount',
'billItem.Shipping Cost',
'billItem.totalCost'
],
'uniqueTitle' => 'Bill Item'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/export-config"
payload := strings.NewReader("{\n \"name\": \"Report Daily\",\n \"collection\": \"task\",\n \"description\": \"Template for daily report with bill item detail\",\n \"flowIds\": [\n \"66a988d53ae08a7ab52867c2\",\n \"66c6a05440d39b2616275622\",\n \"66c6a05c40d39b2616275624\",\n \"66c6a06412d3f54e2f425e22\"\n ],\n \"fields\": [\n {\n \"component\": \"input\",\n \"id\": \"_id\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Id\",\n \"uniqueTitle\": \"Id\"\n },\n {\n \"component\": \"input\",\n \"id\": \"flow\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Flow\",\n \"uniqueTitle\": \"Flow\"\n },\n {\n \"component\": \"input\",\n \"id\": \"hub\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Hub\",\n \"uniqueTitle\": \"Hub\"\n },\n {\n \"component\": \"input\",\n \"id\": \"title\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Title\",\n \"uniqueTitle\": \"Title\"\n },\n {\n \"component\": \"input\",\n \"id\": \"status\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Status\",\n \"uniqueTitle\": \"Status\"\n },\n {\n \"component\": \"input\",\n \"id\": \"orderNumber\",\n \"title\": \"Order Number\",\n \"inputType\": \"string\",\n \"default\": null,\n \"routeAs\": null,\n \"showAs\": \"title\",\n \"required\": false,\n \"visible\": true,\n \"page\": \"page0\",\n \"flowId\": [\n \"66a988d53ae08a7ab52867c2\",\n \"66c6a05440d39b2616275622\",\n \"66c6a05c40d39b2616275624\",\n \"66c6a06412d3f54e2f425e22\"\n ],\n \"flowName\": [\n \"Export Bill\",\n \"Flow A\",\n \"Flow B\",\n \"Flow C\"\n ],\n \"uniqueTitle\": \"Order Number\"\n },\n {\n \"component\": \"bill\",\n \"id\": \"billItem\",\n \"title\": \"Bill Item\",\n \"addNew\": true,\n \"required\": false,\n \"value\": null,\n \"editable\": [],\n \"costs\": [\n \"Discount\",\n \"Shipping Cost\"\n ],\n \"visible\": true,\n \"masterItems\": [\n {\n \"name\": \"Snack\",\n \"unit_price\": 10000\n },\n {\n \"name\": \"Cold Drink\",\n \"unit_price\": 5000\n },\n {\n \"name\": \"Bread\",\n \"unit_price\": 7000\n },\n {\n \"name\": \"Egg\",\n \"unit_price\": 2500\n }\n ],\n \"masterCosts\": [\n {\n \"type\": \"number\",\n \"name\": \"Discount\",\n \"amount\": 10000\n },\n {\n \"type\": \"number\",\n \"name\": \"Shipping Cost\",\n \"amount\": 7000\n }\n ],\n \"qtyRule\": null,\n \"page\": \"page1\",\n \"flowId\": [\n \"66a988d53ae08a7ab52867c2\"\n ],\n \"flowName\": [\n \"Export Bill\"\n ],\n \"additionalField\": [\n \"billItem.Discount\",\n \"billItem.Shipping Cost\",\n \"billItem.totalCost\"\n ],\n \"uniqueTitle\": \"Bill Item\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiweb.mile.app/api/v3/export-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Report Daily\",\n \"collection\": \"task\",\n \"description\": \"Template for daily report with bill item detail\",\n \"flowIds\": [\n \"66a988d53ae08a7ab52867c2\",\n \"66c6a05440d39b2616275622\",\n \"66c6a05c40d39b2616275624\",\n \"66c6a06412d3f54e2f425e22\"\n ],\n \"fields\": [\n {\n \"component\": \"input\",\n \"id\": \"_id\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Id\",\n \"uniqueTitle\": \"Id\"\n },\n {\n \"component\": \"input\",\n \"id\": \"flow\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Flow\",\n \"uniqueTitle\": \"Flow\"\n },\n {\n \"component\": \"input\",\n \"id\": \"hub\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Hub\",\n \"uniqueTitle\": \"Hub\"\n },\n {\n \"component\": \"input\",\n \"id\": \"title\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Title\",\n \"uniqueTitle\": \"Title\"\n },\n {\n \"component\": \"input\",\n \"id\": \"status\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Status\",\n \"uniqueTitle\": \"Status\"\n },\n {\n \"component\": \"input\",\n \"id\": \"orderNumber\",\n \"title\": \"Order Number\",\n \"inputType\": \"string\",\n \"default\": null,\n \"routeAs\": null,\n \"showAs\": \"title\",\n \"required\": false,\n \"visible\": true,\n \"page\": \"page0\",\n \"flowId\": [\n \"66a988d53ae08a7ab52867c2\",\n \"66c6a05440d39b2616275622\",\n \"66c6a05c40d39b2616275624\",\n \"66c6a06412d3f54e2f425e22\"\n ],\n \"flowName\": [\n \"Export Bill\",\n \"Flow A\",\n \"Flow B\",\n \"Flow C\"\n ],\n \"uniqueTitle\": \"Order Number\"\n },\n {\n \"component\": \"bill\",\n \"id\": \"billItem\",\n \"title\": \"Bill Item\",\n \"addNew\": true,\n \"required\": false,\n \"value\": null,\n \"editable\": [],\n \"costs\": [\n \"Discount\",\n \"Shipping Cost\"\n ],\n \"visible\": true,\n \"masterItems\": [\n {\n \"name\": \"Snack\",\n \"unit_price\": 10000\n },\n {\n \"name\": \"Cold Drink\",\n \"unit_price\": 5000\n },\n {\n \"name\": \"Bread\",\n \"unit_price\": 7000\n },\n {\n \"name\": \"Egg\",\n \"unit_price\": 2500\n }\n ],\n \"masterCosts\": [\n {\n \"type\": \"number\",\n \"name\": \"Discount\",\n \"amount\": 10000\n },\n {\n \"type\": \"number\",\n \"name\": \"Shipping Cost\",\n \"amount\": 7000\n }\n ],\n \"qtyRule\": null,\n \"page\": \"page1\",\n \"flowId\": [\n \"66a988d53ae08a7ab52867c2\"\n ],\n \"flowName\": [\n \"Export Bill\"\n ],\n \"additionalField\": [\n \"billItem.Discount\",\n \"billItem.Shipping Cost\",\n \"billItem.totalCost\"\n ],\n \"uniqueTitle\": \"Bill Item\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/export-config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Report Daily\",\n \"collection\": \"task\",\n \"description\": \"Template for daily report with bill item detail\",\n \"flowIds\": [\n \"66a988d53ae08a7ab52867c2\",\n \"66c6a05440d39b2616275622\",\n \"66c6a05c40d39b2616275624\",\n \"66c6a06412d3f54e2f425e22\"\n ],\n \"fields\": [\n {\n \"component\": \"input\",\n \"id\": \"_id\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Id\",\n \"uniqueTitle\": \"Id\"\n },\n {\n \"component\": \"input\",\n \"id\": \"flow\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Flow\",\n \"uniqueTitle\": \"Flow\"\n },\n {\n \"component\": \"input\",\n \"id\": \"hub\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Hub\",\n \"uniqueTitle\": \"Hub\"\n },\n {\n \"component\": \"input\",\n \"id\": \"title\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Title\",\n \"uniqueTitle\": \"Title\"\n },\n {\n \"component\": \"input\",\n \"id\": \"status\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Status\",\n \"uniqueTitle\": \"Status\"\n },\n {\n \"component\": \"input\",\n \"id\": \"orderNumber\",\n \"title\": \"Order Number\",\n \"inputType\": \"string\",\n \"default\": null,\n \"routeAs\": null,\n \"showAs\": \"title\",\n \"required\": false,\n \"visible\": true,\n \"page\": \"page0\",\n \"flowId\": [\n \"66a988d53ae08a7ab52867c2\",\n \"66c6a05440d39b2616275622\",\n \"66c6a05c40d39b2616275624\",\n \"66c6a06412d3f54e2f425e22\"\n ],\n \"flowName\": [\n \"Export Bill\",\n \"Flow A\",\n \"Flow B\",\n \"Flow C\"\n ],\n \"uniqueTitle\": \"Order Number\"\n },\n {\n \"component\": \"bill\",\n \"id\": \"billItem\",\n \"title\": \"Bill Item\",\n \"addNew\": true,\n \"required\": false,\n \"value\": null,\n \"editable\": [],\n \"costs\": [\n \"Discount\",\n \"Shipping Cost\"\n ],\n \"visible\": true,\n \"masterItems\": [\n {\n \"name\": \"Snack\",\n \"unit_price\": 10000\n },\n {\n \"name\": \"Cold Drink\",\n \"unit_price\": 5000\n },\n {\n \"name\": \"Bread\",\n \"unit_price\": 7000\n },\n {\n \"name\": \"Egg\",\n \"unit_price\": 2500\n }\n ],\n \"masterCosts\": [\n {\n \"type\": \"number\",\n \"name\": \"Discount\",\n \"amount\": 10000\n },\n {\n \"type\": \"number\",\n \"name\": \"Shipping Cost\",\n \"amount\": 7000\n }\n ],\n \"qtyRule\": null,\n \"page\": \"page1\",\n \"flowId\": [\n \"66a988d53ae08a7ab52867c2\"\n ],\n \"flowName\": [\n \"Export Bill\"\n ],\n \"additionalField\": [\n \"billItem.Discount\",\n \"billItem.Shipping Cost\",\n \"billItem.totalCost\"\n ],\n \"uniqueTitle\": \"Bill Item\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"code": 201,
"message": "Export Config has been added successfully.",
"data": {
"name": "Report Daily",
"description": "Template for daily report with bill item detail",
"collection": "task",
"fields": [
{
"component": "input",
"id": "_id",
"inputType": "string",
"source": "reservedKey",
"title": "Id",
"uniqueTitle": "Id"
},
{
"component": "input",
"id": "flow",
"inputType": "string",
"source": "reservedKey",
"title": "Flow",
"uniqueTitle": "Flow"
},
{
"component": "input",
"id": "hub",
"inputType": "string",
"source": "reservedKey",
"title": "Hub",
"uniqueTitle": "Hub"
},
{
"component": "input",
"id": "title",
"inputType": "string",
"source": "reservedKey",
"title": "Title",
"uniqueTitle": "Title"
},
{
"component": "input",
"id": "status",
"inputType": "string",
"source": "reservedKey",
"title": "Status",
"uniqueTitle": "Status"
},
{
"component": "input",
"id": "orderNumber",
"title": "Order Number",
"inputType": "string",
"default": null,
"routeAs": null,
"showAs": "title",
"required": false,
"visible": true,
"page": "page0",
"flowId": [
"66a988d53ae08a7ab52867c2",
"66c6a05440d39b2616275622",
"66c6a05c40d39b2616275624",
"66c6a06412d3f54e2f425e22"
],
"flowName": [
"Export Bill",
"Flow A",
"Flow B",
"Flow C"
],
"uniqueTitle": "Order Number"
},
{
"component": "bill",
"id": "billItem",
"title": "Bill Item",
"addNew": true,
"required": false,
"value": null,
"editable": [],
"costs": [
"Discount",
"Shipping Cost"
],
"visible": true,
"masterItems": [
{
"name": "Snack",
"unit_price": 10000
},
{
"name": "Cold Drink",
"unit_price": 5000
},
{
"name": "Bread",
"unit_price": 7000
},
{
"name": "Egg",
"unit_price": 2500
}
],
"masterCosts": [
{
"type": "number",
"name": "Discount",
"amount": 10000
},
{
"type": "number",
"name": "Shipping Cost",
"amount": 7000
}
],
"qtyRule": null,
"page": "page1",
"flowId": [
"66a988d53ae08a7ab52867c2"
],
"flowName": [
"Export Bill"
],
"additionalField": [
"billItem.Discount",
"billItem.Shipping Cost",
"billItem.totalCost"
],
"uniqueTitle": "Bill Item"
}
],
"flowIds": [
"66a988d53ae08a7ab52867c2",
"66c6a05440d39b2616275622",
"66c6a05c40d39b2616275624",
"66c6a06412d3f54e2f425e22"
],
"organizationId": "66791b2bf001a712b77b3622",
"updatedTime": "2024-11-26T09:59:39.860000Z",
"createdTime": "2024-11-26T09:59:39.860000Z",
"_id": "67459c0b9778e36baa076802"
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}Export Config
Create export config
POST
/
export-config
Create export config
curl --request POST \
--url https://apiweb.mile.app/api/v3/export-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Report Daily",
"collection": "task",
"description": "Template for daily report with bill item detail",
"flowIds": [
"66a988d53ae08a7ab52867c2",
"66c6a05440d39b2616275622",
"66c6a05c40d39b2616275624",
"66c6a06412d3f54e2f425e22"
],
"fields": [
{
"component": "input",
"id": "_id",
"inputType": "string",
"source": "reservedKey",
"title": "Id",
"uniqueTitle": "Id"
},
{
"component": "input",
"id": "flow",
"inputType": "string",
"source": "reservedKey",
"title": "Flow",
"uniqueTitle": "Flow"
},
{
"component": "input",
"id": "hub",
"inputType": "string",
"source": "reservedKey",
"title": "Hub",
"uniqueTitle": "Hub"
},
{
"component": "input",
"id": "title",
"inputType": "string",
"source": "reservedKey",
"title": "Title",
"uniqueTitle": "Title"
},
{
"component": "input",
"id": "status",
"inputType": "string",
"source": "reservedKey",
"title": "Status",
"uniqueTitle": "Status"
},
{
"component": "input",
"id": "orderNumber",
"title": "Order Number",
"inputType": "string",
"default": null,
"routeAs": null,
"showAs": "title",
"required": false,
"visible": true,
"page": "page0",
"flowId": [
"66a988d53ae08a7ab52867c2",
"66c6a05440d39b2616275622",
"66c6a05c40d39b2616275624",
"66c6a06412d3f54e2f425e22"
],
"flowName": [
"Export Bill",
"Flow A",
"Flow B",
"Flow C"
],
"uniqueTitle": "Order Number"
},
{
"component": "bill",
"id": "billItem",
"title": "Bill Item",
"addNew": true,
"required": false,
"value": null,
"editable": [],
"costs": [
"Discount",
"Shipping Cost"
],
"visible": true,
"masterItems": [
{
"name": "Snack",
"unit_price": 10000
},
{
"name": "Cold Drink",
"unit_price": 5000
},
{
"name": "Bread",
"unit_price": 7000
},
{
"name": "Egg",
"unit_price": 2500
}
],
"masterCosts": [
{
"type": "number",
"name": "Discount",
"amount": 10000
},
{
"type": "number",
"name": "Shipping Cost",
"amount": 7000
}
],
"qtyRule": null,
"page": "page1",
"flowId": [
"66a988d53ae08a7ab52867c2"
],
"flowName": [
"Export Bill"
],
"additionalField": [
"billItem.Discount",
"billItem.Shipping Cost",
"billItem.totalCost"
],
"uniqueTitle": "Bill Item"
}
]
}
'import requests
url = "https://apiweb.mile.app/api/v3/export-config"
payload = {
"name": "Report Daily",
"collection": "task",
"description": "Template for daily report with bill item detail",
"flowIds": ["66a988d53ae08a7ab52867c2", "66c6a05440d39b2616275622", "66c6a05c40d39b2616275624", "66c6a06412d3f54e2f425e22"],
"fields": [
{
"component": "input",
"id": "_id",
"inputType": "string",
"source": "reservedKey",
"title": "Id",
"uniqueTitle": "Id"
},
{
"component": "input",
"id": "flow",
"inputType": "string",
"source": "reservedKey",
"title": "Flow",
"uniqueTitle": "Flow"
},
{
"component": "input",
"id": "hub",
"inputType": "string",
"source": "reservedKey",
"title": "Hub",
"uniqueTitle": "Hub"
},
{
"component": "input",
"id": "title",
"inputType": "string",
"source": "reservedKey",
"title": "Title",
"uniqueTitle": "Title"
},
{
"component": "input",
"id": "status",
"inputType": "string",
"source": "reservedKey",
"title": "Status",
"uniqueTitle": "Status"
},
{
"component": "input",
"id": "orderNumber",
"title": "Order Number",
"inputType": "string",
"default": None,
"routeAs": None,
"showAs": "title",
"required": False,
"visible": True,
"page": "page0",
"flowId": ["66a988d53ae08a7ab52867c2", "66c6a05440d39b2616275622", "66c6a05c40d39b2616275624", "66c6a06412d3f54e2f425e22"],
"flowName": ["Export Bill", "Flow A", "Flow B", "Flow C"],
"uniqueTitle": "Order Number"
},
{
"component": "bill",
"id": "billItem",
"title": "Bill Item",
"addNew": True,
"required": False,
"value": None,
"editable": [],
"costs": ["Discount", "Shipping Cost"],
"visible": True,
"masterItems": [
{
"name": "Snack",
"unit_price": 10000
},
{
"name": "Cold Drink",
"unit_price": 5000
},
{
"name": "Bread",
"unit_price": 7000
},
{
"name": "Egg",
"unit_price": 2500
}
],
"masterCosts": [
{
"type": "number",
"name": "Discount",
"amount": 10000
},
{
"type": "number",
"name": "Shipping Cost",
"amount": 7000
}
],
"qtyRule": None,
"page": "page1",
"flowId": ["66a988d53ae08a7ab52867c2"],
"flowName": ["Export Bill"],
"additionalField": ["billItem.Discount", "billItem.Shipping Cost", "billItem.totalCost"],
"uniqueTitle": "Bill Item"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Report Daily',
collection: 'task',
description: 'Template for daily report with bill item detail',
flowIds: [
'66a988d53ae08a7ab52867c2',
'66c6a05440d39b2616275622',
'66c6a05c40d39b2616275624',
'66c6a06412d3f54e2f425e22'
],
fields: [
{
component: 'input',
id: '_id',
inputType: 'string',
source: 'reservedKey',
title: 'Id',
uniqueTitle: 'Id'
},
{
component: 'input',
id: 'flow',
inputType: 'string',
source: 'reservedKey',
title: 'Flow',
uniqueTitle: 'Flow'
},
{
component: 'input',
id: 'hub',
inputType: 'string',
source: 'reservedKey',
title: 'Hub',
uniqueTitle: 'Hub'
},
{
component: 'input',
id: 'title',
inputType: 'string',
source: 'reservedKey',
title: 'Title',
uniqueTitle: 'Title'
},
{
component: 'input',
id: 'status',
inputType: 'string',
source: 'reservedKey',
title: 'Status',
uniqueTitle: 'Status'
},
{
component: 'input',
id: 'orderNumber',
title: 'Order Number',
inputType: 'string',
default: null,
routeAs: null,
showAs: 'title',
required: false,
visible: true,
page: 'page0',
flowId: [
'66a988d53ae08a7ab52867c2',
'66c6a05440d39b2616275622',
'66c6a05c40d39b2616275624',
'66c6a06412d3f54e2f425e22'
],
flowName: ['Export Bill', 'Flow A', 'Flow B', 'Flow C'],
uniqueTitle: 'Order Number'
},
{
component: 'bill',
id: 'billItem',
title: 'Bill Item',
addNew: true,
required: false,
value: null,
editable: [],
costs: ['Discount', 'Shipping Cost'],
visible: true,
masterItems: [
{name: 'Snack', unit_price: 10000},
{name: 'Cold Drink', unit_price: 5000},
{name: 'Bread', unit_price: 7000},
{name: 'Egg', unit_price: 2500}
],
masterCosts: [
{type: 'number', name: 'Discount', amount: 10000},
{type: 'number', name: 'Shipping Cost', amount: 7000}
],
qtyRule: null,
page: 'page1',
flowId: ['66a988d53ae08a7ab52867c2'],
flowName: ['Export Bill'],
additionalField: ['billItem.Discount', 'billItem.Shipping Cost', 'billItem.totalCost'],
uniqueTitle: 'Bill Item'
}
]
})
};
fetch('https://apiweb.mile.app/api/v3/export-config', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/export-config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Report Daily',
'collection' => 'task',
'description' => 'Template for daily report with bill item detail',
'flowIds' => [
'66a988d53ae08a7ab52867c2',
'66c6a05440d39b2616275622',
'66c6a05c40d39b2616275624',
'66c6a06412d3f54e2f425e22'
],
'fields' => [
[
'component' => 'input',
'id' => '_id',
'inputType' => 'string',
'source' => 'reservedKey',
'title' => 'Id',
'uniqueTitle' => 'Id'
],
[
'component' => 'input',
'id' => 'flow',
'inputType' => 'string',
'source' => 'reservedKey',
'title' => 'Flow',
'uniqueTitle' => 'Flow'
],
[
'component' => 'input',
'id' => 'hub',
'inputType' => 'string',
'source' => 'reservedKey',
'title' => 'Hub',
'uniqueTitle' => 'Hub'
],
[
'component' => 'input',
'id' => 'title',
'inputType' => 'string',
'source' => 'reservedKey',
'title' => 'Title',
'uniqueTitle' => 'Title'
],
[
'component' => 'input',
'id' => 'status',
'inputType' => 'string',
'source' => 'reservedKey',
'title' => 'Status',
'uniqueTitle' => 'Status'
],
[
'component' => 'input',
'id' => 'orderNumber',
'title' => 'Order Number',
'inputType' => 'string',
'default' => null,
'routeAs' => null,
'showAs' => 'title',
'required' => false,
'visible' => true,
'page' => 'page0',
'flowId' => [
'66a988d53ae08a7ab52867c2',
'66c6a05440d39b2616275622',
'66c6a05c40d39b2616275624',
'66c6a06412d3f54e2f425e22'
],
'flowName' => [
'Export Bill',
'Flow A',
'Flow B',
'Flow C'
],
'uniqueTitle' => 'Order Number'
],
[
'component' => 'bill',
'id' => 'billItem',
'title' => 'Bill Item',
'addNew' => true,
'required' => false,
'value' => null,
'editable' => [
],
'costs' => [
'Discount',
'Shipping Cost'
],
'visible' => true,
'masterItems' => [
[
'name' => 'Snack',
'unit_price' => 10000
],
[
'name' => 'Cold Drink',
'unit_price' => 5000
],
[
'name' => 'Bread',
'unit_price' => 7000
],
[
'name' => 'Egg',
'unit_price' => 2500
]
],
'masterCosts' => [
[
'type' => 'number',
'name' => 'Discount',
'amount' => 10000
],
[
'type' => 'number',
'name' => 'Shipping Cost',
'amount' => 7000
]
],
'qtyRule' => null,
'page' => 'page1',
'flowId' => [
'66a988d53ae08a7ab52867c2'
],
'flowName' => [
'Export Bill'
],
'additionalField' => [
'billItem.Discount',
'billItem.Shipping Cost',
'billItem.totalCost'
],
'uniqueTitle' => 'Bill Item'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/export-config"
payload := strings.NewReader("{\n \"name\": \"Report Daily\",\n \"collection\": \"task\",\n \"description\": \"Template for daily report with bill item detail\",\n \"flowIds\": [\n \"66a988d53ae08a7ab52867c2\",\n \"66c6a05440d39b2616275622\",\n \"66c6a05c40d39b2616275624\",\n \"66c6a06412d3f54e2f425e22\"\n ],\n \"fields\": [\n {\n \"component\": \"input\",\n \"id\": \"_id\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Id\",\n \"uniqueTitle\": \"Id\"\n },\n {\n \"component\": \"input\",\n \"id\": \"flow\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Flow\",\n \"uniqueTitle\": \"Flow\"\n },\n {\n \"component\": \"input\",\n \"id\": \"hub\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Hub\",\n \"uniqueTitle\": \"Hub\"\n },\n {\n \"component\": \"input\",\n \"id\": \"title\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Title\",\n \"uniqueTitle\": \"Title\"\n },\n {\n \"component\": \"input\",\n \"id\": \"status\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Status\",\n \"uniqueTitle\": \"Status\"\n },\n {\n \"component\": \"input\",\n \"id\": \"orderNumber\",\n \"title\": \"Order Number\",\n \"inputType\": \"string\",\n \"default\": null,\n \"routeAs\": null,\n \"showAs\": \"title\",\n \"required\": false,\n \"visible\": true,\n \"page\": \"page0\",\n \"flowId\": [\n \"66a988d53ae08a7ab52867c2\",\n \"66c6a05440d39b2616275622\",\n \"66c6a05c40d39b2616275624\",\n \"66c6a06412d3f54e2f425e22\"\n ],\n \"flowName\": [\n \"Export Bill\",\n \"Flow A\",\n \"Flow B\",\n \"Flow C\"\n ],\n \"uniqueTitle\": \"Order Number\"\n },\n {\n \"component\": \"bill\",\n \"id\": \"billItem\",\n \"title\": \"Bill Item\",\n \"addNew\": true,\n \"required\": false,\n \"value\": null,\n \"editable\": [],\n \"costs\": [\n \"Discount\",\n \"Shipping Cost\"\n ],\n \"visible\": true,\n \"masterItems\": [\n {\n \"name\": \"Snack\",\n \"unit_price\": 10000\n },\n {\n \"name\": \"Cold Drink\",\n \"unit_price\": 5000\n },\n {\n \"name\": \"Bread\",\n \"unit_price\": 7000\n },\n {\n \"name\": \"Egg\",\n \"unit_price\": 2500\n }\n ],\n \"masterCosts\": [\n {\n \"type\": \"number\",\n \"name\": \"Discount\",\n \"amount\": 10000\n },\n {\n \"type\": \"number\",\n \"name\": \"Shipping Cost\",\n \"amount\": 7000\n }\n ],\n \"qtyRule\": null,\n \"page\": \"page1\",\n \"flowId\": [\n \"66a988d53ae08a7ab52867c2\"\n ],\n \"flowName\": [\n \"Export Bill\"\n ],\n \"additionalField\": [\n \"billItem.Discount\",\n \"billItem.Shipping Cost\",\n \"billItem.totalCost\"\n ],\n \"uniqueTitle\": \"Bill Item\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiweb.mile.app/api/v3/export-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Report Daily\",\n \"collection\": \"task\",\n \"description\": \"Template for daily report with bill item detail\",\n \"flowIds\": [\n \"66a988d53ae08a7ab52867c2\",\n \"66c6a05440d39b2616275622\",\n \"66c6a05c40d39b2616275624\",\n \"66c6a06412d3f54e2f425e22\"\n ],\n \"fields\": [\n {\n \"component\": \"input\",\n \"id\": \"_id\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Id\",\n \"uniqueTitle\": \"Id\"\n },\n {\n \"component\": \"input\",\n \"id\": \"flow\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Flow\",\n \"uniqueTitle\": \"Flow\"\n },\n {\n \"component\": \"input\",\n \"id\": \"hub\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Hub\",\n \"uniqueTitle\": \"Hub\"\n },\n {\n \"component\": \"input\",\n \"id\": \"title\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Title\",\n \"uniqueTitle\": \"Title\"\n },\n {\n \"component\": \"input\",\n \"id\": \"status\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Status\",\n \"uniqueTitle\": \"Status\"\n },\n {\n \"component\": \"input\",\n \"id\": \"orderNumber\",\n \"title\": \"Order Number\",\n \"inputType\": \"string\",\n \"default\": null,\n \"routeAs\": null,\n \"showAs\": \"title\",\n \"required\": false,\n \"visible\": true,\n \"page\": \"page0\",\n \"flowId\": [\n \"66a988d53ae08a7ab52867c2\",\n \"66c6a05440d39b2616275622\",\n \"66c6a05c40d39b2616275624\",\n \"66c6a06412d3f54e2f425e22\"\n ],\n \"flowName\": [\n \"Export Bill\",\n \"Flow A\",\n \"Flow B\",\n \"Flow C\"\n ],\n \"uniqueTitle\": \"Order Number\"\n },\n {\n \"component\": \"bill\",\n \"id\": \"billItem\",\n \"title\": \"Bill Item\",\n \"addNew\": true,\n \"required\": false,\n \"value\": null,\n \"editable\": [],\n \"costs\": [\n \"Discount\",\n \"Shipping Cost\"\n ],\n \"visible\": true,\n \"masterItems\": [\n {\n \"name\": \"Snack\",\n \"unit_price\": 10000\n },\n {\n \"name\": \"Cold Drink\",\n \"unit_price\": 5000\n },\n {\n \"name\": \"Bread\",\n \"unit_price\": 7000\n },\n {\n \"name\": \"Egg\",\n \"unit_price\": 2500\n }\n ],\n \"masterCosts\": [\n {\n \"type\": \"number\",\n \"name\": \"Discount\",\n \"amount\": 10000\n },\n {\n \"type\": \"number\",\n \"name\": \"Shipping Cost\",\n \"amount\": 7000\n }\n ],\n \"qtyRule\": null,\n \"page\": \"page1\",\n \"flowId\": [\n \"66a988d53ae08a7ab52867c2\"\n ],\n \"flowName\": [\n \"Export Bill\"\n ],\n \"additionalField\": [\n \"billItem.Discount\",\n \"billItem.Shipping Cost\",\n \"billItem.totalCost\"\n ],\n \"uniqueTitle\": \"Bill Item\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/export-config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Report Daily\",\n \"collection\": \"task\",\n \"description\": \"Template for daily report with bill item detail\",\n \"flowIds\": [\n \"66a988d53ae08a7ab52867c2\",\n \"66c6a05440d39b2616275622\",\n \"66c6a05c40d39b2616275624\",\n \"66c6a06412d3f54e2f425e22\"\n ],\n \"fields\": [\n {\n \"component\": \"input\",\n \"id\": \"_id\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Id\",\n \"uniqueTitle\": \"Id\"\n },\n {\n \"component\": \"input\",\n \"id\": \"flow\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Flow\",\n \"uniqueTitle\": \"Flow\"\n },\n {\n \"component\": \"input\",\n \"id\": \"hub\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Hub\",\n \"uniqueTitle\": \"Hub\"\n },\n {\n \"component\": \"input\",\n \"id\": \"title\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Title\",\n \"uniqueTitle\": \"Title\"\n },\n {\n \"component\": \"input\",\n \"id\": \"status\",\n \"inputType\": \"string\",\n \"source\": \"reservedKey\",\n \"title\": \"Status\",\n \"uniqueTitle\": \"Status\"\n },\n {\n \"component\": \"input\",\n \"id\": \"orderNumber\",\n \"title\": \"Order Number\",\n \"inputType\": \"string\",\n \"default\": null,\n \"routeAs\": null,\n \"showAs\": \"title\",\n \"required\": false,\n \"visible\": true,\n \"page\": \"page0\",\n \"flowId\": [\n \"66a988d53ae08a7ab52867c2\",\n \"66c6a05440d39b2616275622\",\n \"66c6a05c40d39b2616275624\",\n \"66c6a06412d3f54e2f425e22\"\n ],\n \"flowName\": [\n \"Export Bill\",\n \"Flow A\",\n \"Flow B\",\n \"Flow C\"\n ],\n \"uniqueTitle\": \"Order Number\"\n },\n {\n \"component\": \"bill\",\n \"id\": \"billItem\",\n \"title\": \"Bill Item\",\n \"addNew\": true,\n \"required\": false,\n \"value\": null,\n \"editable\": [],\n \"costs\": [\n \"Discount\",\n \"Shipping Cost\"\n ],\n \"visible\": true,\n \"masterItems\": [\n {\n \"name\": \"Snack\",\n \"unit_price\": 10000\n },\n {\n \"name\": \"Cold Drink\",\n \"unit_price\": 5000\n },\n {\n \"name\": \"Bread\",\n \"unit_price\": 7000\n },\n {\n \"name\": \"Egg\",\n \"unit_price\": 2500\n }\n ],\n \"masterCosts\": [\n {\n \"type\": \"number\",\n \"name\": \"Discount\",\n \"amount\": 10000\n },\n {\n \"type\": \"number\",\n \"name\": \"Shipping Cost\",\n \"amount\": 7000\n }\n ],\n \"qtyRule\": null,\n \"page\": \"page1\",\n \"flowId\": [\n \"66a988d53ae08a7ab52867c2\"\n ],\n \"flowName\": [\n \"Export Bill\"\n ],\n \"additionalField\": [\n \"billItem.Discount\",\n \"billItem.Shipping Cost\",\n \"billItem.totalCost\"\n ],\n \"uniqueTitle\": \"Bill Item\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"code": 201,
"message": "Export Config has been added successfully.",
"data": {
"name": "Report Daily",
"description": "Template for daily report with bill item detail",
"collection": "task",
"fields": [
{
"component": "input",
"id": "_id",
"inputType": "string",
"source": "reservedKey",
"title": "Id",
"uniqueTitle": "Id"
},
{
"component": "input",
"id": "flow",
"inputType": "string",
"source": "reservedKey",
"title": "Flow",
"uniqueTitle": "Flow"
},
{
"component": "input",
"id": "hub",
"inputType": "string",
"source": "reservedKey",
"title": "Hub",
"uniqueTitle": "Hub"
},
{
"component": "input",
"id": "title",
"inputType": "string",
"source": "reservedKey",
"title": "Title",
"uniqueTitle": "Title"
},
{
"component": "input",
"id": "status",
"inputType": "string",
"source": "reservedKey",
"title": "Status",
"uniqueTitle": "Status"
},
{
"component": "input",
"id": "orderNumber",
"title": "Order Number",
"inputType": "string",
"default": null,
"routeAs": null,
"showAs": "title",
"required": false,
"visible": true,
"page": "page0",
"flowId": [
"66a988d53ae08a7ab52867c2",
"66c6a05440d39b2616275622",
"66c6a05c40d39b2616275624",
"66c6a06412d3f54e2f425e22"
],
"flowName": [
"Export Bill",
"Flow A",
"Flow B",
"Flow C"
],
"uniqueTitle": "Order Number"
},
{
"component": "bill",
"id": "billItem",
"title": "Bill Item",
"addNew": true,
"required": false,
"value": null,
"editable": [],
"costs": [
"Discount",
"Shipping Cost"
],
"visible": true,
"masterItems": [
{
"name": "Snack",
"unit_price": 10000
},
{
"name": "Cold Drink",
"unit_price": 5000
},
{
"name": "Bread",
"unit_price": 7000
},
{
"name": "Egg",
"unit_price": 2500
}
],
"masterCosts": [
{
"type": "number",
"name": "Discount",
"amount": 10000
},
{
"type": "number",
"name": "Shipping Cost",
"amount": 7000
}
],
"qtyRule": null,
"page": "page1",
"flowId": [
"66a988d53ae08a7ab52867c2"
],
"flowName": [
"Export Bill"
],
"additionalField": [
"billItem.Discount",
"billItem.Shipping Cost",
"billItem.totalCost"
],
"uniqueTitle": "Bill Item"
}
],
"flowIds": [
"66a988d53ae08a7ab52867c2",
"66c6a05440d39b2616275622",
"66c6a05c40d39b2616275624",
"66c6a06412d3f54e2f425e22"
],
"organizationId": "66791b2bf001a712b77b3622",
"updatedTime": "2024-11-26T09:59:39.860000Z",
"createdTime": "2024-11-26T09:59:39.860000Z",
"_id": "67459c0b9778e36baa076802"
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}Authorizations
Use a valid Bearer token to authenticate.
Body
application/json
The name of export config. Name must be unique.
Example: Report Daily
The collection from which the data will be exported.
Example: task
The flow identifier used to filter the components refers only to the selected flow IDs. Use Flow /flows API to get the list of flow id.
Example: ['66a988d53ae08a7ab52867c2']
⌘I