Bulk import artists
curl --request POST \
--url https://www.fmdb.net/api/artists/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"artists": [
{
"name": "Hans Zimmer",
"type": "person",
"country": "DE",
"real_name": "Hans Florian Zimmer"
},
{
"name": "London Symphony Orchestra",
"type": "orchestra",
"country": "GB"
}
]
}
'import requests
url = "https://www.fmdb.net/api/artists/import"
payload = { "artists": [
{
"name": "Hans Zimmer",
"type": "person",
"country": "DE",
"real_name": "Hans Florian Zimmer"
},
{
"name": "London Symphony Orchestra",
"type": "orchestra",
"country": "GB"
}
] }
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({
artists: [
{
name: 'Hans Zimmer',
type: 'person',
country: 'DE',
real_name: 'Hans Florian Zimmer'
},
{name: 'London Symphony Orchestra', type: 'orchestra', country: 'GB'}
]
})
};
fetch('https://www.fmdb.net/api/artists/import', 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://www.fmdb.net/api/artists/import",
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([
'artists' => [
[
'name' => 'Hans Zimmer',
'type' => 'person',
'country' => 'DE',
'real_name' => 'Hans Florian Zimmer'
],
[
'name' => 'London Symphony Orchestra',
'type' => 'orchestra',
'country' => 'GB'
]
]
]),
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://www.fmdb.net/api/artists/import"
payload := strings.NewReader("{\n \"artists\": [\n {\n \"name\": \"Hans Zimmer\",\n \"type\": \"person\",\n \"country\": \"DE\",\n \"real_name\": \"Hans Florian Zimmer\"\n },\n {\n \"name\": \"London Symphony Orchestra\",\n \"type\": \"orchestra\",\n \"country\": \"GB\"\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://www.fmdb.net/api/artists/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"artists\": [\n {\n \"name\": \"Hans Zimmer\",\n \"type\": \"person\",\n \"country\": \"DE\",\n \"real_name\": \"Hans Florian Zimmer\"\n },\n {\n \"name\": \"London Symphony Orchestra\",\n \"type\": \"orchestra\",\n \"country\": \"GB\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.fmdb.net/api/artists/import")
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 \"artists\": [\n {\n \"name\": \"Hans Zimmer\",\n \"type\": \"person\",\n \"country\": \"DE\",\n \"real_name\": \"Hans Florian Zimmer\"\n },\n {\n \"name\": \"London Symphony Orchestra\",\n \"type\": \"orchestra\",\n \"country\": \"GB\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"summary": {
"total": 3,
"created": 1,
"skipped": 1,
"failed": 1
},
"results": [
{
"index": 0,
"status": "created",
"artist": {
"@id": "/api/artists/uuid-1",
"name": "Hans Zimmer",
"type": "person"
}
},
{
"index": 1,
"status": "skipped",
"reason": "duplicate",
"existing_artist": {
"@id": "/api/artists/uuid-2",
"name": "Hans Zimmer",
"type": "person"
}
},
{
"index": 2,
"status": "failed",
"reason": "type: Invalid artist type."
}
]
}Artist
Bulk import artists
Creates multiple artists in a single request with partial success semantics. Duplicate detection is based on name + type combination. Requires ROLE_EDITOR.
POST
/
api
/
artists
/
import
Bulk import artists
curl --request POST \
--url https://www.fmdb.net/api/artists/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"artists": [
{
"name": "Hans Zimmer",
"type": "person",
"country": "DE",
"real_name": "Hans Florian Zimmer"
},
{
"name": "London Symphony Orchestra",
"type": "orchestra",
"country": "GB"
}
]
}
'import requests
url = "https://www.fmdb.net/api/artists/import"
payload = { "artists": [
{
"name": "Hans Zimmer",
"type": "person",
"country": "DE",
"real_name": "Hans Florian Zimmer"
},
{
"name": "London Symphony Orchestra",
"type": "orchestra",
"country": "GB"
}
] }
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({
artists: [
{
name: 'Hans Zimmer',
type: 'person',
country: 'DE',
real_name: 'Hans Florian Zimmer'
},
{name: 'London Symphony Orchestra', type: 'orchestra', country: 'GB'}
]
})
};
fetch('https://www.fmdb.net/api/artists/import', 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://www.fmdb.net/api/artists/import",
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([
'artists' => [
[
'name' => 'Hans Zimmer',
'type' => 'person',
'country' => 'DE',
'real_name' => 'Hans Florian Zimmer'
],
[
'name' => 'London Symphony Orchestra',
'type' => 'orchestra',
'country' => 'GB'
]
]
]),
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://www.fmdb.net/api/artists/import"
payload := strings.NewReader("{\n \"artists\": [\n {\n \"name\": \"Hans Zimmer\",\n \"type\": \"person\",\n \"country\": \"DE\",\n \"real_name\": \"Hans Florian Zimmer\"\n },\n {\n \"name\": \"London Symphony Orchestra\",\n \"type\": \"orchestra\",\n \"country\": \"GB\"\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://www.fmdb.net/api/artists/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"artists\": [\n {\n \"name\": \"Hans Zimmer\",\n \"type\": \"person\",\n \"country\": \"DE\",\n \"real_name\": \"Hans Florian Zimmer\"\n },\n {\n \"name\": \"London Symphony Orchestra\",\n \"type\": \"orchestra\",\n \"country\": \"GB\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.fmdb.net/api/artists/import")
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 \"artists\": [\n {\n \"name\": \"Hans Zimmer\",\n \"type\": \"person\",\n \"country\": \"DE\",\n \"real_name\": \"Hans Florian Zimmer\"\n },\n {\n \"name\": \"London Symphony Orchestra\",\n \"type\": \"orchestra\",\n \"country\": \"GB\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"summary": {
"total": 3,
"created": 1,
"skipped": 1,
"failed": 1
},
"results": [
{
"index": 0,
"status": "created",
"artist": {
"@id": "/api/artists/uuid-1",
"name": "Hans Zimmer",
"type": "person"
}
},
{
"index": 1,
"status": "skipped",
"reason": "duplicate",
"existing_artist": {
"@id": "/api/artists/uuid-2",
"name": "Hans Zimmer",
"type": "person"
}
},
{
"index": 2,
"status": "failed",
"reason": "type: Invalid artist type."
}
]
}Authorizations
API token authentication
Body
application/json
Maximum array length:
100Show child attributes
Show child attributes
⌘I
