Update and Delete existing Resources
The interface for updating data is the same for presets and productions.
Update a Production or Preset and Reset Data
It’s possible to reset a production or preset to its initial state while
adding the flag reset_data
in a request to https://auphonic.com/api/{preset|production}/{uuid}.json
:
all metadata, chapters,
output files, external services, intros, outros etc. are deleted but not the
input_file (so that you don’t have to upload it again)!
This can be useful if you don’t want to delete and re-add output files, chapters, etc., but want to change a whole production/preset with just one request. A possible usecase would be a desktop or mobile app, which keeps all information about a production/preset in a local copy and wants to update it on the server in one request.
If you have the following existing production:
{
"uuid": "X2bUTQ8z888YaKukkU6vfJ",
"input_file": "http://auphonic.com/myfile.flac",
"metadata": {
"album": "Some more unique album title",
"artist": "My Artist",
"track": 99
},
"chapters": [
{"start": "00:00:01", "title": "first"},
{"start": "00:00:02.500", "title": "second"}
],
"output_files": [
{"format": "aac", "bitrate": 128},
{"format": "vorbis", "bitrate": 64}
],
...
}
and post a request to https://auphonic.com/api/production/X2bUTQ8z888YaKukkU6vfJ.json
using the reset_data
flag:
{
"reset_data": true,
"output_basename": "basename1",
"metadata": {
"title": "Production Title",
"artist": "The unique Artist",
"album": "Our unique Album",
"track": 1,
"url": "http://auphonic.com/test",
"license": "Creative Commons Attribution 3.0 Austria",
"license_url": "http://creativecommons.org/licenses/by/3.0/at/"
},
"output_files": [
{"format":"flac"}
],
"algorithms": {
"filtering": true, "leveler": false,
"denoise": false, "normloudness": true,
"loudnesstarget": -23
},
"chapters": [
{"start": "00:00:02", "title": "first"},
{"start": "00:00:03.500", "title": "second"}
],
}
Now all previous fields are cleared and you get the exact same result as if you would have created a new production.
Warning
It’s not possible to use a preset while updating a production using
the reset_data
flag!
Delete a Cover Image
You can also delete the cover image by including the reset_cover_image
flag
in a POST request to https://auphonic.com/api/production/{uuid}.json
:
curl -X POST -H "Content-Type: application/json" \
https://auphonic.com/api/production/{uuid}.json \
-u username:password \
-d '{"reset_cover_image": true}'
Use a cover image from a preset
You can reuse the preset cover image by including the preset_cover_image
parameter in a POST request to https://auphonic.com/api/production/{uuid}.json
:
curl -X POST -H "Content-Type: application/json" \
https://auphonic.com/api/production/{uuid}.json \
-u username:password \
-d '{"preset_cover_image": preset_uuid}'
Further Examples
Delete a production (or preset):
curl -X DELETE https://auphonic.com/api/production/{uuid}.json -u username:password
Stop a production:
curl -X POST https://auphonic.com/api/production/{uuid}/stop.json -u username:password
Update metada of an existing production:
curl -X POST -H "Content-Type: application/json" \
https://auphonic.com/api/production/{uuid}.json \
-u username:password \
-d '{"metadata": {"title": "New Title", "track": 2}}'
Add an outgoing file transfer to an existing preset:
curl -X POST -H "Content-Type: application/json" \
https://auphonic.com/api/preset/{uuid}/outgoing_services.json \
-u username:password
-d '[{"uuid": "{service_uuid}"}]'
Delete all audio output files and add a new mp3 output format in a production:
curl -X DELETE https://auphonic.com/api/production/{uuid}/output_files.json -u username:password
curl -X POST -H "Content-Type: application/json" \
https://auphonic.com/api/production/{uuid}/output_files.json \
-u username:password \
-d '[{"format":"mp3", "bitrate":"96", "filename":"MyFilename.mp3"}]'
Update metadata of an existing production and add two additional output files in one request:
curl -X POST -H "Content-Type: application/json" \
https://auphonic.com/api/production/{uuid}.json \
-u username:password \
-d '{"metadata": {"title": "New Title", "track": 2, "artist": "New"},
"output_files": [
{"format":"mp3", "bitrate":"96", "filename":"MyFilename.mp3"},
{"format": "flac", "split_on_chapters": true}
]
}'
And now restart audio encoding:
curl -X POST https://auphonic.com/api/production/{uuid}/start.json -u username:password
Enable noise reduction in an existing preset:
curl -X POST -H "Content-Type: application/json" \
https://auphonic.com/api/preset/{uuid}/algorithms.json \
-u username:password \
-d '{"denoise":true}'
Add one additional chapter in a production:
curl -X POST -H "Content-Type: application/json" \
https://auphonic.com/api/production/{uuid}/chapters.json \
-u username:password \
-d '[{"start":"00:20:00.000", "title": "20 minutes"}]'
Delete all chapters of a production and add two new ones:
curl -X DELETE https://auphonic.com/api/production/7Aw6285eFS7RfBTCcEyNoh/chapters.json -u username:pwd
curl -X POST https://auphonic.com/api/production/7Aw6285eFS7RfBTCcEyNoh/chapters.json \
-u username:pwd -H "Content-Type: application/json" \
-d '[{"start": "00:00:00", "title": "erste"},{"start": "00:00:10", "title": "zweite"}]'
Remove speech recognition server from a production (or preset):
curl -X DELETE https://auphonic.com/api/production/7Aw628AeFS7RfBTCcEyNoh/speech_recognition.json -u username:pwd