And yet another way to create tags with the API (but still only for admins): the undocumented api /tags/upload.json
, used by the Upload Tags
menu. Use it like this:
const tags = ['tag1', 'tag2']
const file = new Blob([tags.join('n')], { type: 'text/plain' })
const formData = new FormData()
formData.append('file', file)
$.ajax({
type: 'POST',
url: '/tags/upload.json',
data: formData,
contentType: false,
processData: false
})