/api/v1_2/agendasFirst agenda must be created in Datamolino web interface and user plan must be selected. Other agendas may be created through API.
Allows to create one Folder (agenda) in one request.
Response contains an ID assigned the each Folder (agenda), in the same order as the request.
Attribute Requirements
home_currency Must have 3-character
_ Upcase format
_ Standard ISO 4217
_ Default value “EUR”
country Lowercase or uppercase. All will be converted to uppercase.
_ Standard ISO 3166-1 alpha-2
email_alias Must be unique
_ Minimal length 5 characters
_ Maximal length 32 characters
_ Without special characters (you can check allowed characters with RegExp /^[a-zA-Z\d][a-zA-Z\d._-]\\*[a-zA-Z\d]$/
external_id Must be unique in account context,
_ Maximal length 64 characters
email_whitelist Comma separated list of valid email addresses
_ The white list is used in folder spam filter
client_id Client identificator
Maximal length 255 characters
Headers
| Name | Example | Description |
|---|---|---|
Content-Type |
application/json | — |
Request body
{
"agendas": [
{
"name": "Demo Trading Ltd",
"address": {
"street": "Street name",
"building_no": "6 - 8",
"city": "Bratislava",
"postal_code": "811 03",
"country": "sk"
},
"company_id": "12345678",
"company_tax_id": "1002003000",
"company_vat_id": null,
"home_currency": "EUR",
"client_id": "demo_client_id"
}
]
}Code examples
curl --request POST 'https://app.datamolino.com/api/v1_2/agendas' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer demo_access_token' \
--data '{
"agendas": [
{
"name": "Demo Trading Ltd",
"address": {
"street": "Street name",
"building_no": "6 - 8",
"city": "Bratislava",
"postal_code": "811 03",
"country": "sk"
},
"company_id": "12345678",
"company_tax_id": "1002003000",
"company_vat_id": null,
"home_currency": "EUR",
"client_id": "demo_client_id"
}
]
}'POST /api/v1_2/agendas HTTP/1.1
Host: app.datamolino.com
Content-Type: application/json
Authorization: Bearer demo_access_token
{
"agendas": [
{
"name": "Demo Trading Ltd",
"address": {
"street": "Street name",
"building_no": "6 - 8",
"city": "Bratislava",
"postal_code": "811 03",
"country": "sk"
},
"company_id": "12345678",
"company_tax_id": "1002003000",
"company_vat_id": null,
"home_currency": "EUR",
"client_id": "demo_client_id"
}
]
}const response = await fetch("https://app.datamolino.com/api/v1_2/agendas", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer demo_access_token"
},
body: JSON.stringify({
"agendas": [
{
"name": "Demo Trading Ltd",
"address": {
"street": "Street name",
"building_no": "6 - 8",
"city": "Bratislava",
"postal_code": "811 03",
"country": "sk"
},
"company_id": "12345678",
"company_tax_id": "1002003000",
"company_vat_id": null,
"home_currency": "EUR",
"client_id": "demo_client_id"
}
]
}),
});
const data = await response.json();import axios from "axios";
const response = await axios({
method: "post",
url: "https://app.datamolino.com/api/v1_2/agendas",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer demo_access_token"
},
data: {
"agendas": [
{
"name": "Demo Trading Ltd",
"address": {
"street": "Street name",
"building_no": "6 - 8",
"city": "Bratislava",
"postal_code": "811 03",
"country": "sk"
},
"company_id": "12345678",
"company_tax_id": "1002003000",
"company_vat_id": null,
"home_currency": "EUR",
"client_id": "demo_client_id"
}
]
}
});
console.log(response.data);import requests
url = "https://app.datamolino.com/api/v1_2/agendas"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer demo_access_token"
}
payload = {
"agendas": [
{
"name": "Demo Trading Ltd",
"address": {
"street": "Street name",
"building_no": "6 - 8",
"city": "Bratislava",
"postal_code": "811 03",
"country": "sk"
},
"company_id": "12345678",
"company_tax_id": "1002003000",
"company_vat_id": None,
"home_currency": "EUR",
"client_id": "demo_client_id"
}
]
}
response = requests.request("POST", url, headers=headers, json=payload)
response.raise_for_status()
print(response.json())require 'json'
require 'net/http'
uri = URI("https://app.datamolino.com/api/v1_2/agendas")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer demo_access_token"
request.body = <<~JSON
{
"agendas": [
{
"name": "Demo Trading Ltd",
"address": {
"street": "Street name",
"building_no": "6 - 8",
"city": "Bratislava",
"postal_code": "811 03",
"country": "sk"
},
"company_id": "12345678",
"company_tax_id": "1002003000",
"company_vat_id": null,
"home_currency": "EUR",
"client_id": "demo_client_id"
}
]
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts JSON.parse(response.body)# app/services/datamolino_client.rb
require 'json'
require 'net/http'
class DatamolinoClient
BASE_URL = "https://app.datamolino.com"
def initialize(access_token: Rails.application.credentials.dig(:datamolino, :access_token))
@access_token = access_token
end
def request_create_agenda
uri = URI("#{BASE_URL}/api/v1_2/agendas")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer #{@access_token}"
request.body = <<~JSON
{
"agendas": [
{
"name": "Demo Trading Ltd",
"address": {
"street": "Street name",
"building_no": "6 - 8",
"city": "Bratislava",
"postal_code": "811 03",
"country": "sk"
},
"company_id": "12345678",
"company_tax_id": "1002003000",
"company_vat_id": null,
"home_currency": "EUR",
"client_id": "demo_client_id"
}
]
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
JSON.parse(response.body)
end
end<?php
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('POST', 'https://app.datamolino.com/api/v1_2/agendas', [
'headers' => json_decode('{"Content-Type":"application/json","Authorization":"Bearer demo_access_token"}', true),
'json' => json_decode('{"agendas":[{"name":"Demo Trading Ltd","address":{"street":"Street name","building_no":"6 - 8","city":"Bratislava","postal_code":"811 03","country":"sk"},"company_id":"12345678","company_tax_id":"1002003000","company_vat_id":null,"home_currency":"EUR","client_id":"demo_client_id"}]}', true)
]);
echo $response->getBody();OkHttpClient client = new OkHttpClient();
RequestBody body = RequestBody.create("{\n \"agendas\": [\n {\n \"name\": \"Demo Trading Ltd\",\n \"address\": {\n \"street\": \"Street name\",\n \"building_no\": \"6 - 8\",\n \"city\": \"Bratislava\",\n \"postal_code\": \"811 03\",\n \"country\": \"sk\"\n },\n \"company_id\": \"12345678\",\n \"company_tax_id\": \"1002003000\",\n \"company_vat_id\": null,\n \"home_currency\": \"EUR\",\n \"client_id\": \"demo_client_id\"\n }\n ]\n}", MediaType.parse("application/json"));
Request request = new Request.Builder()
.url("https://app.datamolino.com/api/v1_2/agendas")
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer demo_access_token")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://app.datamolino.com/api/v1_2/agendas");
request.Headers.Add("Authorization", "Bearer demo_access_token");
request.Content = new StringContent("{\n \"agendas\": [\n {\n \"name\": \"Demo Trading Ltd\",\n \"address\": {\n \"street\": \"Street name\",\n \"building_no\": \"6 - 8\",\n \"city\": \"Bratislava\",\n \"postal_code\": \"811 03\",\n \"country\": \"sk\"\n },\n \"company_id\": \"12345678\",\n \"company_tax_id\": \"1002003000\",\n \"company_vat_id\": null,\n \"home_currency\": \"EUR\",\n \"client_id\": \"demo_client_id\"\n }\n ]\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());client := &http.Client{}
req, err := http.NewRequest("POST", "https://app.datamolino.com/api/v1_2/agendas", strings.NewReader("{\n \"agendas\": [\n {\n \"name\": \"Demo Trading Ltd\",\n \"address\": {\n \"street\": \"Street name\",\n \"building_no\": \"6 - 8\",\n \"city\": \"Bratislava\",\n \"postal_code\": \"811 03\",\n \"country\": \"sk\"\n },\n \"company_id\": \"12345678\",\n \"company_tax_id\": \"1002003000\",\n \"company_vat_id\": null,\n \"home_currency\": \"EUR\",\n \"client_id\": \"demo_client_id\"\n }\n ]\n}"))
if err != nil { panic(err) }
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer demo_access_token")
res, err := client.Do(req)
if err != nil { panic(err) }
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil { panic(err) }
fmt.Println(string(body))import Foundation
var request = URLRequest(url: URL(string: "https://app.datamolino.com/api/v1_2/agendas")!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.setValue("Bearer demo_access_token", forHTTPHeaderField: "Authorization")
request.httpBody = "{\n \"agendas\": [\n {\n \"name\": \"Demo Trading Ltd\",\n \"address\": {\n \"street\": \"Street name\",\n \"building_no\": \"6 - 8\",\n \"city\": \"Bratislava\",\n \"postal_code\": \"811 03\",\n \"country\": \"sk\"\n },\n \"company_id\": \"12345678\",\n \"company_tax_id\": \"1002003000\",\n \"company_vat_id\": null,\n \"home_currency\": \"EUR\",\n \"client_id\": \"demo_client_id\"\n }\n ]\n}".data(using: .utf8)
let (data, _) = try await URLSession.shared.data(for: request)
print(String(data: data, encoding: .utf8)!)Responses
201 Created
Content type: application/json; charset=utf-8
{
"agendas": [
{
"id": 23698
}
]
}