#Is it possible to update TXT records between quotation marks?

20 messages · Page 1 of 1 (latest)

violet oracle
#

Currently the script I have updates it but on the panel its shown without quotation marks and it gives warning

violet oracle
#

????

violet oracle
#

anyone know how to do?

vale raven
violet oracle
#

I mean yeah but is there a way to make it with quotes just so it doesn't give the damn warning?

vale raven
#

Sure, just add the (escaped) quotes to your script

violet oracle
#

I've tried it doesn't seem to work

vale raven
#

let me try, one second

violet oracle
#

I can send you the script i got

vale raven
#

Just works for me

#

"content": "\"hallo\""

#

This has the warning, the above does not:
"content": "hallo"

violet oracle
#

i got this part:

          -H "Authorization: Bearer $API_TOKEN" \
          -H "Content-Type: application/json" \
          --data "{\"type\":\"$type\",\"name\":\"$name\",\"content\":\"\"$content\",\"ttl\":1,\"proxied\":false}")


        if [[ "$update_response" == *"\"success\":true"* ]]; then
            echo "$name updated successfully."
        else
            echo "Error updating $name. Response: $update_response"
        fi
    fi
}```
#

don't seem to find what may be wrong

vale raven
#

Why do you escape every quote?

violet oracle
vale raven
#

curl https://api.cloudflare.com/client/v4/zones/blablabla/dns_records -X POST -H "X-Auth-Key: blablabla" -H "X-Auth-Email: blablabla" -d '{"name": "txt.laudian.de", "type": "TXT", "content": "hallo"}'

#

curl https://api.cloudflare.com/client/v4/zones/blablabla/dns_records -X POST -H "X-Auth-Key: blablabla" -H "X-Auth-Email: blablabla" -d '{"name": "txt.laudian.de", "type": "TXT", "content": "\"hallo\""}'

#

With escaped quotes so the warning is gone

violet oracle
#

ok yeah it works